diff --git a/.gitattributes b/.gitattributes index dfe0770..d511b4e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,20 @@ -# Auto detect text files and perform LF normalization +# Set the default behavior, in case people don't have core.autocrlf set. * text=auto + +# Files with Unix line endings +*.c text eol=lf +*.cpp text eol=lf +*.h text eol=lf +*.ino text eol=lf +*.py text eol=lf +*.sh text eol=lf +*.scad text eol=lf + +# Files with native line endings +# *.sln text + +# Binary files +*.png binary +*.jpg binary +*.fon binary + diff --git a/.gitignore b/.gitignore index f152028..1eaa7fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,145 @@ -.pio +# +# Marlin 3D Printer Firmware +# Copyright (C) 2017 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 . +# + +# Our automatic versioning scheme generates the following file +# NEVER put it in the repository +_Version.h + +# +# OS +# +applet/ +*.DS_Store + + +# +# Misc +# +*~ +*.orig +*.rej +*.bak +*.idea +*.s +*.i +*.ii +*.swp +tags + +# +# C++ +# +# Compiled Object files +*.slo +*.lo +*.o +*.obj +*.ino.cpp + +# 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 + +# PlatformIO files/dirs +.pio* .pioenvs .piolibdeps -.clang_complete -.gcc-flags.json +lib/readme.txt + +#Visual Studio +*.sln +*.vcxproj +*.vcxproj.filters +Release/ +Debug/ +__vm/ +.vs/ +vc-fileutils.settings + +#VScode +.vscode +.vscode/c_cpp_properties.json + +#cmake +CMakeLists.txt +Marlin/CMakeLists.txt +CMakeListsPrivate.txt + +#CLion +cmake-build-* diff --git a/.travis.yml b/.travis.yml index b3b96f2..710bd36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,10 +22,10 @@ before_install: # install: # - # Install arduino 1.8.5 - - wget http://downloads-02.arduino.cc/arduino-1.8.5-linux64.tar.xz - - tar xf arduino-1.8.5-linux64.tar.xz - - sudo mv arduino-1.8.5 /usr/local/share/arduino + # Install arduino 1.6.10 + - wget http://downloads-02.arduino.cc/arduino-1.6.10-linux64.tar.xz + - tar xf arduino-1.6.10-linux64.tar.xz + - sudo mv arduino-1.6.10 /usr/local/share/arduino - ln -s /usr/local/share/arduino/arduino ${TRAVIS_BUILD_DIR}/buildroot/bin/arduino # # Install: LiquidCrystal_I2C library @@ -90,37 +90,26 @@ script: - opt_set TEMP_SENSOR_0 -2 - opt_set TEMP_SENSOR_1 1 - opt_set TEMP_SENSOR_BED 1 - - opt_set POWER_SUPPLY 1 - - opt_enable PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING - - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS PINS_DEBUGGING - - opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED AUTO_POWER_CONTROL NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR + - opt_enable PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS + - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS + - opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED - opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE - - opt_enable_adv ARC_P_CIRCLES ADVANCED_PAUSE_FEATURE CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE - - opt_enable_adv FWRETRACT MAX7219_DEBUG LED_CONTROL_MENU CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CODEPENDENT_XY_HOMING - - opt_set GRID_MAX_POINTS_X 16 + - opt_enable_adv FWRETRACT MAX7219_DEBUG LED_CONTROL_MENU + - opt_set ABL_GRID_POINTS_X 16 + - opt_set ABL_GRID_POINTS_Y 16 - opt_set_adv FANMUX0_PIN 53 - build_marlin # - # Test a probeless build of AUTO_BED_LEVELING_UBL, with lots of extruders + # Test a probeless build of AUTO_BED_LEVELING_UBL # - restore_configs - - opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO - - opt_set EXTRUDERS 5 - - opt_set TEMP_SENSOR_1 1 - - opt_set TEMP_SENSOR_2 5 - - opt_set TEMP_SENSOR_3 20 - - opt_set TEMP_SENSOR_4 999 - - opt_set TEMP_SENSOR_BED 1 - - opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_EDITING ENABLE_LEVELING_FADE_HEIGHT SKEW_CORRECTION - - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - - opt_enable_adv CUSTOM_USER_MENUS I2C_POSITION_ENCODERS BABYSTEPPING BABYSTEP_XY LIN_ADVANCE NANODLP_Z_SYNC QUICK_HOME JUNCTION_DEVIATION MAX7219_DEBUG - - opt_set_adv MAX7219_ROTATE 270 + - opt_enable AUTO_BED_LEVELING_UBL DEBUG_LEVELING_FEATURE G26_MESH_EDITING ENABLE_LEVELING_FADE_HEIGHT EEPROM_SETTINGS EEPROM_CHITCHAT G3D_PANEL + - opt_enable_adv CUSTOM_USER_MENUS I2C_POSITION_ENCODERS BABYSTEPPING NANODLP_Z_SYNC - build_marlin # - # Add a Sled Z Probe, use UBL Cartesian moves, use Japanese language + # Add a Sled Z Probe, use UBL Cartesian moves # - - opt_enable Z_PROBE_SLED SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE S_CURVE_ACCELERATION - - opt_set LCD_LANGUAGE kana_utf8 + - opt_enable Z_PROBE_SLED SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE - opt_disable SEGMENT_LEVELED_MOVES - opt_enable_adv BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING - build_marlin @@ -129,7 +118,7 @@ script: # ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES # - restore_configs - - opt_enable NUM_SERVOS Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE + - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE - opt_set NUM_SERVOS 1 - opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT - opt_enable_adv NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET @@ -145,8 +134,8 @@ script: # PROBE_MANUALLY feature, with LCD support, # ULTIMAKERCONTROLLER, FILAMENT_LCD_DISPLAY, FILAMENT_WIDTH_SENSOR, # PRINTCOUNTER, NOZZLE_PARK_FEATURE, NOZZLE_CLEAN_FEATURE, PCA9632, - # Z_DUAL_ENDSTOPS, BEZIER_CURVE_SUPPORT, EXPERIMENTAL_I2CBUS, - # ADVANCED_PAUSE_FEATURE, ADVANCED_PAUSE_CONTINUOUS_PURGE, PARK_HEAD_ON_PAUSE, LCD_INFO_MENU, M114_DETAIL + # Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS, BEZIER_CURVE_SUPPORT, EXPERIMENTAL_I2CBUS, + # ADVANCED_PAUSE_FEATURE, PARK_HEAD_ON_PAUSE, LCD_INFO_MENU, # EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER, # INCH_MODE_SUPPORT, TEMPERATURE_UNITS_SUPPORT # @@ -155,20 +144,32 @@ script: - opt_enable PROBE_MANUALLY AUTO_BED_LEVELING_BILINEAR G26_MESH_EDITING LCD_BED_LEVELING ULTIMAKERCONTROLLER - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT M100_FREE_MEMORY_WATCHER M100_FREE_MEMORY_DUMPER M100_FREE_MEMORY_CORRUPTOR INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT - opt_enable ULTIMAKERCONTROLLER SDSUPPORT - - opt_enable PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE PCA9632 + - opt_enable PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE PCA9632 USE_XMAX_PLUG - opt_enable_adv BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS - - opt_enable_adv ADVANCED_PAUSE_FEATURE ADVANCED_PAUSE_CONTINUOUS_PURGE FILAMENT_LOAD_UNLOAD_GCODES PARK_HEAD_ON_PAUSE LCD_INFO_MENU M114_DETAIL + - opt_enable_adv ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE LCD_INFO_MENU M114_DETAIL - opt_set_adv PWM_MOTOR_CURRENT {1300,1300,1250} - opt_set_adv I2C_SLAVE_ADDRESS 63 - build_marlin # - # Mixing Extruder with 5 steppers, Cyrillic + # Test 5 extruders on AZTEEG_X3_PRO (can use any board with >=5 extruders defined) + # Include a test for LIN_ADVANCE here also + # + - opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO + - opt_set EXTRUDERS 5 + - opt_set TEMP_SENSOR_1 1 + - opt_set TEMP_SENSOR_2 5 + - opt_set TEMP_SENSOR_3 20 + - opt_set TEMP_SENSOR_4 999 + - opt_set TEMP_SENSOR_BED 1 + - opt_enable_adv LIN_ADVANCE + - build_marlin + # + # Mixing Extruder with 5 steppers # - restore_configs - opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO - - opt_enable MIXING_EXTRUDER CR10_STOCKDISPLAY + - opt_enable MIXING_EXTRUDER - opt_set MIXING_STEPPERS 5 - - opt_set LCD_LANGUAGE ru - build_marlin # # Test DUAL_X_CARRIAGE @@ -183,11 +184,11 @@ script: # # 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 + - 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 # # Test SWITCHING_EXTRUDER # @@ -196,14 +197,15 @@ script: - 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 # # Enable COREXY # - #- restore_configs - #- opt_enable COREXY - #- build_marlin + - restore_configs + - opt_enable COREXY + - build_marlin # # Test many less common options # @@ -217,7 +219,7 @@ script: - opt_enable_adv VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL - opt_enable_adv EXTRA_FAN_SPEED FWERETRACT Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS - opt_enable_adv MENU_ADDAUTOSTART SDCARD_SORT_ALPHA - - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER BABYSTEPPING DAC_MOTOR_CURRENT_DEFAULT + - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER - opt_enable FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR - opt_enable ENDSTOP_INTERRUPTS_FEATURE FAN_SOFT_PWM SDSUPPORT - opt_enable USE_XMAX_PLUG @@ -227,15 +229,15 @@ script: # # ULTRA_LCD # - #- restore_configs - #- opt_enable ULTRA_LCD - #- build_marlin + - restore_configs + - opt_enable ULTRA_LCD + - build_marlin # # DOGLCD # - #- restore_configs - #- opt_enable DOGLCD - #- build_marlin + - restore_configs + - opt_enable DOGLCD + - build_marlin # # MAKRPANEL # Needs to use Melzi and Sanguino hardware @@ -246,33 +248,29 @@ script: # # REPRAP_DISCOUNT_SMART_CONTROLLER, SDSUPPORT, BABYSTEPPING, RIGIDBOARD_V2, and DAC_MOTOR_CURRENT_DEFAULT # - #- restore_configs - #- opt_set MOTHERBOARD BOARD_RIGIDBOARD_V2 - #- opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING DAC_MOTOR_CURRENT_DEFAULT - #- build_marlin - # # + - restore_configs + - opt_set MOTHERBOARD BOARD_RIGIDBOARD_V2 + - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING DAC_MOTOR_CURRENT_DEFAULT + - build_marlin + # # G3D_PANEL with SDCARD_SORT_ALPHA and STATUS_MESSAGE_SCROLLING # - #- restore_configs - #- opt_enable G3D_PANEL SDSUPPORT - #- opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES - #- opt_set_adv SDSORT_GCODE true - #- opt_set_adv SDSORT_USES_RAM true - #- opt_set_adv SDSORT_USES_STACK true - #- opt_set_adv SDSORT_CACHE_NAMES true - #- build_marlin - # - # REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER with LIGHTWEIGHT_UI - # - restore_configs - - opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT - - opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES LIGHTWEIGHT_UI + - opt_enable G3D_PANEL SDSUPPORT + - opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES - opt_set_adv SDSORT_GCODE true - opt_set_adv SDSORT_USES_RAM true - opt_set_adv SDSORT_USES_STACK true - opt_set_adv SDSORT_CACHE_NAMES true - build_marlin # + # REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER with SDCARD_SORT_ALPHA and STATUS_MESSAGE_SCROLLING + # + - restore_configs + - opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT + - opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES + - build_marlin + # # REPRAPWORLD_KEYPAD # # Cant find configuration details to get it to compile @@ -282,9 +280,9 @@ script: # # RA_CONTROL_PANEL # - #- restore_configs - #- opt_enable RA_CONTROL_PANEL PINS_DEBUGGING - #- build_marlin + - restore_configs + - opt_enable RA_CONTROL_PANEL PINS_DEBUGGING + - build_marlin # ######## I2C LCD/PANELS ############## # @@ -292,10 +290,10 @@ script: # Most I2C configurations are failing at the moment because they require # a different Liquid Crystal library "LiquidTWI2". # - # LCD_SAINSMART_I2C_1602 + # LCD_I2C_SAINSMART_YWROBOT # #- restore_configs - #- opt_enable LCD_SAINSMART_I2C_1602 + #- opt_enable LCD_I2C_SAINSMART_YWROBOT #- build_marlin # # LCD_I2C_PANELOLU2 @@ -312,19 +310,9 @@ script: # # LCM1602 # - #- restore_configs - #- opt_enable LCM1602 - #- build_marlin - # - # Language files test with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - # - #- restore_configs - #- opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT - #- for lang in an bg ca zh_CN zh_TW cz da de el el-gr en es eu fi fr gl hr it jp-kana nl pl pt pt-br ru sk tr uk test; do opt_set LCD_LANGUAGE $lang; echo "compile with language $lang ..."; build_marlin - # - #- restore_configs - #- opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT - #- for lang in an bg ca zh_CN zh_TW cz da de el el-gr en es eu fi fr gl hr it jp-kana nl pl pt pt-br ru sk tr uk test; do opt_set LCD_LANGUAGE $lang; echo "compile with language $lang ..."; build_marlin + - restore_configs + - opt_enable LCM1602 + - build_marlin # # ######## Example Configurations ############## @@ -342,8 +330,8 @@ script: # Delta Config (generic) + UBL + ALLEN_KEY + OLED_PANEL_TINYBOY2 + EEPROM_SETTINGS # - use_example_configs delta/generic - - opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 Z_PROBE_ALLEN_KEY EEPROM_SETTINGS EEPROM_CHITCHAT - - opt_enable OLED_PANEL_TINYBOY2 MESH_EDIT_GFX_OVERLAY + - opt_disable DISABLE_MIN_ENDSTOPS + - opt_enable AUTO_BED_LEVELING_UBL Z_PROBE_ALLEN_KEY EEPROM_SETTINGS EEPROM_CHITCHAT OLED_PANEL_TINYBOY2 MESH_EDIT_GFX_OVERLAY - build_marlin # # Delta Config (FLSUN AC because it's complex) @@ -360,20 +348,14 @@ script: # - use_example_configs SCARA - opt_enable AUTO_BED_LEVELING_BILINEAR FIX_MOUNTED_PROBE USE_ZMIN_PLUG EEPROM_SETTINGS EEPROM_CHITCHAT ULTIMAKERCONTROLLER - - opt_set X_DRIVER_TYPE TMC2130 - - opt_set Y_DRIVER_TYPE TMC2130 - - opt_set Z_DRIVER_TYPE TMC2130 - - opt_set E0_DRIVER_TYPE TMC2130 - - opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD SENSORLESS_HOMING + - opt_enable_adv HAVE_TMC2130 X_IS_TMC2130 Y_IS_TMC2130 Z_IS_TMC2130 + - opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG SENSORLESS_HOMING - build_marlin # # TMC2208 Config # - restore_configs - - opt_set X_DRIVER_TYPE TMC2208 - - opt_set Y_DRIVER_TYPE TMC2208 - - opt_set Z_DRIVER_TYPE TMC2208 - - opt_set E0_DRIVER_TYPE TMC2208 + - opt_enable_adv HAVE_TMC2208 X_IS_TMC2208 Y_IS_TMC2208 Z_IS_TMC2208 - opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG - build_marlin # diff --git a/Marlin/AnycubicTFT.cpp b/Marlin/AnycubicTFT.cpp index 1f60157..744fae4 100644 --- a/Marlin/AnycubicTFT.cpp +++ b/Marlin/AnycubicTFT.cpp @@ -65,9 +65,7 @@ char* itostr3(const int x) { return &_conv[4]; } - // Convert signed float to fixed-length string with 023.45 / -23.45 format - char *ftostr32(const float &x) { long xx = x * 100; _conv[1] = MINUSOR(xx, DIGIMOD(xx, 10000)); @@ -78,7 +76,6 @@ char *ftostr32(const float &x) { _conv[6] = DIGIMOD(xx, 1); return &_conv[1]; } - #endif AnycubicTFTClass::AnycubicTFTClass() { @@ -142,16 +139,12 @@ void AnycubicTFTClass::StartPrint(){ #endif } starttime=millis(); -#ifdef SDSUPPORT card.startFileprint(); -#endif TFTstate=ANYCUBIC_TFT_STATE_SDPRINT; } void AnycubicTFTClass::PausePrint(){ -#ifdef SDSUPPORT card.pauseSDPrint(); -#endif TFTstate=ANYCUBIC_TFT_STATE_SDPAUSE_REQ; #ifdef ANYCUBIC_FILAMENT_RUNOUT_SENSOR if(FilamentTestStatus) { @@ -172,9 +165,7 @@ void AnycubicTFTClass::PausePrint(){ } void AnycubicTFTClass::StopPrint(){ -#ifdef SDSUPPORT card.stopSDPrint(); -#endif clear_command_queue(); quickstop_stepper(); print_job_timer.stop(); @@ -280,7 +271,6 @@ void AnycubicTFTClass::Ls() break; } } -#ifdef SDSUPPORT else if(card.cardOK) { uint16_t cnt=filenumber; @@ -329,9 +319,7 @@ void AnycubicTFTClass::Ls() } } } - } -#endif - else { + } else { ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); } @@ -339,10 +327,9 @@ void AnycubicTFTClass::Ls() void AnycubicTFTClass::CheckSDCardChange() { -#ifdef SDSUPPORT - if (LastSDstatus != IS_SD_INSERTED()) + if (LastSDstatus != IS_SD_INSERTED) { - LastSDstatus = IS_SD_INSERTED(); + LastSDstatus = IS_SD_INSERTED; if (LastSDstatus) { @@ -363,7 +350,6 @@ void AnycubicTFTClass::CheckSDCardChange() } } -#endif } void AnycubicTFTClass::CheckHeaterError() @@ -395,17 +381,14 @@ void AnycubicTFTClass::StateHandler() { switch (TFTstate) { case ANYCUBIC_TFT_STATE_IDLE: -#ifdef SDSUPPORT if(card.sdprinting){ TFTstate=ANYCUBIC_TFT_STATE_SDPRINT; starttime=millis(); // --> Send print info to display... most probably print started via gcode } -#endif break; case ANYCUBIC_TFT_STATE_SDPRINT: -#ifdef SDSUPPORT if(!card.sdprinting){ // It seems that we are to printing anymore... pause or stopped? if (card.isFileOpen()){ @@ -421,7 +404,6 @@ void AnycubicTFTClass::StateHandler() #endif } } -#endif break; case ANYCUBIC_TFT_STATE_SDPAUSE: break; @@ -434,7 +416,6 @@ void AnycubicTFTClass::StateHandler() #endif break; case ANYCUBIC_TFT_STATE_SDPAUSE_REQ: -#ifdef SDSUPPORT if((!card.sdprinting) && (!planner.movesplanned())){ // We have to wait until the sd card printing has been settled #ifndef ADVANCED_PAUSE_FEATURE @@ -453,11 +434,10 @@ void AnycubicTFTClass::StateHandler() #ifdef ANYCUBIC_TFT_DEBUG SERIAL_ECHOLNPGM("TFT Serial Debug: SD print paused done... J18"); #endif + } -#endif break; case ANYCUBIC_TFT_STATE_SDSTOP_REQ: -#ifdef SDSUPPORT if((!card.sdprinting) && (!planner.movesplanned())){ ANYCUBIC_SERIAL_PROTOCOLPGM("J16");// J16 stop print ANYCUBIC_SERIAL_ENTER(); @@ -465,22 +445,25 @@ void AnycubicTFTClass::StateHandler() #ifdef ANYCUBIC_TFT_DEBUG SERIAL_ECHOLNPGM("TFT Serial Debug: SD print stopped... J16"); #endif - if((current_position[Z_AXIS]>200)){ + if((current_position[Z_AXIS]>=200)){ enqueue_and_echo_commands_P(PSTR("G91")); enqueue_and_echo_commands_P(PSTR("G1 Z1 F240")); enqueue_and_echo_commands_P(PSTR("G90")); + } else if ((current_position[Z_AXIS]<200)){ + enqueue_and_echo_commands_P(PSTR("G91")); + enqueue_and_echo_commands_P(PSTR("G1 Z5 F240")); + enqueue_and_echo_commands_P(PSTR("G90")); } else if ((current_position[Z_AXIS]<190)){ enqueue_and_echo_commands_P(PSTR("G91")); - enqueue_and_echo_commands_P(PSTR("G1 Z15 F240")); + enqueue_and_echo_commands_P(PSTR("G1 Z10 F240")); enqueue_and_echo_commands_P(PSTR("G90")); } else if ((current_position[Z_AXIS]<150)){ enqueue_and_echo_commands_P(PSTR("G91")); - enqueue_and_echo_commands_P(PSTR("G1 Z50 F240")); + enqueue_and_echo_commands_P(PSTR("G1 Z35 F240")); enqueue_and_echo_commands_P(PSTR("G90")); } enqueue_and_echo_commands_P(PSTR("M84")); } -#endif break; default: break; @@ -498,22 +481,18 @@ void AnycubicTFTClass::FilamentRunout() if(FilamentRunoutCounter>=15800) { FilamentRunoutCounter=0; -#ifdef SDSUPPORT if((card.sdprinting==true)) { PausePrint(); } else if((card.sdprinting==false)) { -#endif ANYCUBIC_SERIAL_PROTOCOLPGM("J15"); //J15 FILAMENT LACK ANYCUBIC_SERIAL_ENTER(); #ifdef ANYCUBIC_TFT_DEBUG SERIAL_ECHOLNPGM("TFT Serial Debug: Filament runout... J15"); #endif -#ifdef SDSUPPORT } -#endif FilamentTestLastStatus=FilamentTestStatus; } } @@ -608,7 +587,6 @@ void AnycubicTFTClass::GetCommandFromTFT() ANYCUBIC_SERIAL_ENTER(); break; case 6: //A6 GET SD CARD PRINTING STATUS -#ifdef SDSUPPORT if(card.sdprinting){ ANYCUBIC_SERIAL_PROTOCOLPGM("A6V "); if(card.cardOK) @@ -623,7 +601,6 @@ void AnycubicTFTClass::GetCommandFromTFT() else ANYCUBIC_SERIAL_PROTOCOLPGM("A6V ---"); ANYCUBIC_SERIAL_ENTER(); -#endif break; case 7://A7 GET PRINTING TIME { @@ -647,9 +624,8 @@ void AnycubicTFTClass::GetCommandFromTFT() break; } case 8: // A8 GET SD LIST -#ifdef SDSUPPORT SelectedDirectory[0]=0; - if(!IS_SD_INSERTED()) + if(!IS_SD_INSERTED) { ANYCUBIC_SERIAL_PROTOCOLPGM("J02"); ANYCUBIC_SERIAL_ENTER(); @@ -665,10 +641,8 @@ void AnycubicTFTClass::GetCommandFromTFT() ANYCUBIC_SERIAL_PROTOCOLPGM("END"); // Filelist stop ANYCUBIC_SERIAL_ENTER(); } -#endif break; case 9: // A9 pause sd print -#ifdef SDSUPPORT if(card.sdprinting) { PausePrint(); @@ -677,10 +651,8 @@ void AnycubicTFTClass::GetCommandFromTFT() { StopPrint(); } -#endif break; case 10: // A10 resume sd print -#ifdef SDSUPPORT if((TFTstate==ANYCUBIC_TFT_STATE_SDPAUSE) || (TFTstate==ANYCUBIC_TFT_STATE_SDOUTAGE)) { StartPrint(); @@ -690,21 +662,17 @@ void AnycubicTFTClass::GetCommandFromTFT() SERIAL_ECHOLNPGM("TFT Serial Debug: SD print started... J04"); #endif } -#endif break; case 11: // A11 STOP SD PRINT -#ifdef SDSUPPORT if((card.sdprinting) || (TFTstate==ANYCUBIC_TFT_STATE_SDOUTAGE)) { StopPrint(); } -#endif break; case 12: // A12 kill kill(PSTR(MSG_KILLED)); break; case 13: // A13 SELECTION FILE -#ifdef SDSUPPORT if((!planner.movesplanned()) && (TFTstate!=ANYCUBIC_TFT_STATE_SDPAUSE) && (TFTstate!=ANYCUBIC_TFT_STATE_SDOUTAGE)) { starpos = (strchr(TFTstrchr_pointer + 4,'*')); @@ -734,10 +702,8 @@ void AnycubicTFTClass::GetCommandFromTFT() } ANYCUBIC_SERIAL_ENTER(); } -#endif break; case 14: // A14 START PRINTING -#ifdef SDSUPPORT if((!planner.movesplanned()) && (TFTstate!=ANYCUBIC_TFT_STATE_SDPAUSE) && (TFTstate!=ANYCUBIC_TFT_STATE_SDOUTAGE) && (card.isFileOpen())) { StartPrint(); @@ -747,7 +713,6 @@ void AnycubicTFTClass::GetCommandFromTFT() SERIAL_ECHOLNPGM("TFT Serial Debug: Starting SD Print... J04"); #endif } -#endif break; case 15: // A15 RESUMING FROM OUTAGE // if((!planner.movesplanned())&&(!TFTresumingflag)) @@ -800,11 +765,7 @@ void AnycubicTFTClass::GetCommandFromTFT() ANYCUBIC_SERIAL_ENTER(); break; case 19: // A19 stop stepper drivers - if((!planner.movesplanned()) -#ifdef SDSUPPORT - &&(!card.sdprinting) -#endif - ) + if((!planner.movesplanned())&&(!card.sdprinting)) { quickstop_stepper(); disable_X(); @@ -918,7 +879,6 @@ void AnycubicTFTClass::GetCommandFromTFT() } break; case 26: // A26 refresh SD -#ifdef SDSUPPORT if (SelectedDirectory[0]==0) { card.initsd(); } else { @@ -935,7 +895,7 @@ void AnycubicTFTClass::GetCommandFromTFT() SelectedDirectory[0]=0; - if(!IS_SD_INSERTED()) + if(!IS_SD_INSERTED) { ANYCUBIC_SERIAL_PROTOCOLPGM("J02"); // J02 SD Card initilized ANYCUBIC_SERIAL_ENTER(); @@ -943,7 +903,6 @@ void AnycubicTFTClass::GetCommandFromTFT() SERIAL_ECHOLNPGM("TFT Serial Debug: SD card initialized... J02"); #endif } -#endif break; #ifdef SERVO_ENDSTOPS case 27: // A27 servos angles adjust diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h index 7d8dabb..423552f 100644 --- a/Marlin/Conditionals_LCD.h +++ b/Marlin/Conditionals_LCD.h @@ -28,501 +28,451 @@ #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)) + #define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT)) -#if ENABLED(CARTESIO_UI) + #if ENABLED(CARTESIO_UI) - #define DOGLCD - #define ULTIPANEL - #define DEFAULT_LCD_CONTRAST 90 - #define LCD_CONTRAST_MIN 60 - #define LCD_CONTRAST_MAX 140 + #define DOGLCD + #define ULTIPANEL + #define DEFAULT_LCD_CONTRAST 90 + #define LCD_CONTRAST_MIN 60 + #define LCD_CONTRAST_MAX 140 -#elif ENABLED(MAKRPANEL) + #elif ENABLED(MAKRPANEL) - #define U8GLIB_ST7565_64128N - -#elif ENABLED(ZONESTAR_LCD) - - #define REPRAPWORLD_KEYPAD - #define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 - #define ADC_KEYPAD - #define ADC_KEY_NUM 8 - #define ULTIPANEL - - // this helps to implement ADC_KEYPAD menus - #define ENCODER_PULSES_PER_STEP 1 - #define ENCODER_STEPS_PER_MENU_ITEM 1 - #define ENCODER_FEEDRATE_DEADZONE 2 - #define REVERSE_MENU_DIRECTION - -#elif ENABLED(ANET_FULL_GRAPHICS_LCD) - - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -#elif ENABLED(BQ_LCD_SMART_CONTROLLER) - - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -#elif 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 #define U8GLIB_ST7565_64128N - #elif ENABLED(VIKI2) - #define LCD_CONTRAST_MIN 0 - #define LCD_CONTRAST_MAX 255 - #define DEFAULT_LCD_CONTRAST 140 - #define U8GLIB_ST7565_64128N - #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 + + #elif ENABLED(ZONESTAR_LCD) + + #define REPRAPWORLD_KEYPAD + #define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 + #define ADC_KEYPAD + #define ADC_KEY_NUM 8 + #define ULTIPANEL + + // this helps to implement ADC_KEYPAD menus + #define ENCODER_PULSES_PER_STEP 1 + #define ENCODER_STEPS_PER_MENU_ITEM 1 + #define ENCODER_FEEDRATE_DEADZONE 2 + #define REVERSE_MENU_DIRECTION + + #elif ENABLED(ANET_FULL_GRAPHICS_LCD) + + #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + + #elif ENABLED(BQ_LCD_SMART_CONTROLLER) + + #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + + #elif 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 + #define U8GLIB_ST7565_64128N + #elif ENABLED(VIKI2) + #define LCD_CONTRAST_MIN 0 + #define LCD_CONTRAST_MAX 255 + #define DEFAULT_LCD_CONTRAST 140 + #define U8GLIB_ST7565_64128N + #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 + + #elif ENABLED(OLED_PANEL_TINYBOY2) + + #define U8GLIB_SSD1306 + #define ULTIPANEL + #define REVERSE_ENCODER_DIRECTION + #define REVERSE_MENU_DIRECTION + + #elif ENABLED(RA_CONTROL_PANEL) + + #define LCD_I2C_TYPE_PCA8574 + #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander + #define ULTIPANEL + + #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + #define DOGLCD + #define U8GLIB_ST7920 + #define ULTIPANEL + + #elif ENABLED(CR10_STOCKDISPLAY) + + #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + #ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_2_NOP + #endif + #ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_2_NOP + #endif + #ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_2_NOP + #endif + + #elif ENABLED(MKS_12864OLED) + + #define REPRAP_DISCOUNT_SMART_CONTROLLER + #define U8GLIB_SH1106 + + #elif ENABLED(MKS_12864OLED_SSD1306) + + #define REPRAP_DISCOUNT_SMART_CONTROLLER + #define U8GLIB_SSD1306 + + #elif ENABLED(MKS_MINI_12864) + + #define MINIPANEL + #endif -#elif ENABLED(OLED_PANEL_TINYBOY2) - - #define U8GLIB_SSD1306 - #define ULTIPANEL - #define REVERSE_ENCODER_DIRECTION - #define REVERSE_MENU_DIRECTION - -#elif ENABLED(RA_CONTROL_PANEL) - - #define LCD_I2C_TYPE_PCA8574 - #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander - #define ULTIPANEL - -#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define DOGLCD - #define U8GLIB_ST7920 - #define ULTIPANEL - -#elif ENABLED(CR10_STOCKDISPLAY) - - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(125) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) + #if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL) + #define DOGLCD + #define ULTIPANEL + #define DEFAULT_LCD_CONTRAST 17 #endif -#elif ENABLED(MKS_12864OLED) - - #define REPRAP_DISCOUNT_SMART_CONTROLLER - #define U8GLIB_SH1106 - -#elif ENABLED(MKS_12864OLED_SSD1306) - - #define REPRAP_DISCOUNT_SMART_CONTROLLER - #define U8GLIB_SSD1306 - -#elif ENABLED(MKS_MINI_12864) - - #define MINIPANEL - -#endif - -#if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL) - #define DOGLCD - #define ULTIPANEL - #define DEFAULT_LCD_CONTRAST 17 -#endif - -#if ENABLED(ULTI_CONTROLLER) - #define U8GLIB_SSD1309 - #define REVERSE_ENCODER_DIRECTION - #define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin - #define LCD_CONTRAST_MIN 0 - #define LCD_CONTRAST_MAX 254 - #define DEFAULT_LCD_CONTRAST 127 - #define ENCODER_PULSES_PER_STEP 2 - #define ENCODER_STEPS_PER_MENU_ITEM 2 -#endif - -// Generic support for SSD1306 / SSD1309 / SH1106 OLED based LCDs. -#if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SSD1309) || ENABLED(U8GLIB_SH1106) - #define ULTRA_LCD //general LCD support, also 16x2 - #define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SSD1309 / SH1106 graphic Display Family) -#endif - -#if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106) - - #define ULTIMAKERCONTROLLER - -#elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) - - #define REPRAP_DISCOUNT_SMART_CONTROLLER - #define LCD_WIDTH 16 - #define LCD_HEIGHT 2 - -#endif - -#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(LCD_FOR_MELZI) || ENABLED(SILVER_GATE_GLCD_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(ULTI_CONTROLLER) - #define ULTIPANEL -#endif - -#if ENABLED(REPRAPWORLD_KEYPAD) - #define NEWPANEL - #if ENABLED(ULTIPANEL) && !defined(REPRAPWORLD_KEYPAD_MOVE_STEP) - #define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 - #endif -#endif - -/** - * I2C PANELS - */ - -#if ENABLED(LCD_SAINSMART_I2C_1602) || ENABLED(LCD_SAINSMART_I2C_2004) - - #define LCD_I2C_TYPE_PCF8575 - #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander - #define ULTRA_LCD - - #if ENABLED(LCD_SAINSMART_I2C_2004) - #define LCD_WIDTH 20 - #define LCD_HEIGHT 4 + // 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 -#elif ENABLED(LCD_I2C_PANELOLU2) + #if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106) - // PANELOLU2 LCD with status LEDs, separate encoder and click inputs + #define ULTIMAKERCONTROLLER - #define LCD_I2C_TYPE_MCP23017 - #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander - #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (optional) - #define ULTIPANEL + #elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) -#elif ENABLED(LCD_I2C_VIKI) + #define REPRAP_DISCOUNT_SMART_CONTROLLER + #define LCD_WIDTH 16 + #define LCD_HEIGHT 2 + + #endif + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(LCD_FOR_MELZI) || ENABLED(SILVER_GATE_GLCD_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 + #endif + + #if ENABLED(REPRAPWORLD_KEYPAD) + #define NEWPANEL + #if ENABLED(ULTIPANEL) && !defined(REPRAPWORLD_KEYPAD_MOVE_STEP) + #define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 + #endif + #endif /** - * Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs - * - * 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) + * I2C PANELS */ - #define LCD_I2C_TYPE_MCP23017 - #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander - #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later) - #define ULTIPANEL - #define ENCODER_FEEDRATE_DEADZONE 4 + #if ENABLED(LCD_I2C_SAINSMART_YWROBOT) - #define STD_ENCODER_PULSES_PER_STEP 1 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 2 + // Note: This controller requires F.Malpartida's LiquidCrystal_I2C library + // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home -#elif ENABLED(G3D_PANEL) + #define LCD_I2C_TYPE_PCF8575 + #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander + #define ULTIPANEL - #define STD_ENCODER_PULSES_PER_STEP 2 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 + #elif ENABLED(LCD_I2C_PANELOLU2) -#elif ENABLED(miniVIKI) || ENABLED(VIKI2) \ - || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - || ENABLED(OLED_PANEL_TINYBOY2) \ - || ENABLED(BQ_LCD_SMART_CONTROLLER) \ - || ENABLED(LCD_I2C_PANELOLU2) \ - || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - #define STD_ENCODER_PULSES_PER_STEP 4 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 -#endif + // PANELOLU2 LCD with status LEDs, separate encoder and click inputs -#ifndef STD_ENCODER_PULSES_PER_STEP - #define STD_ENCODER_PULSES_PER_STEP 5 -#endif -#ifndef STD_ENCODER_STEPS_PER_MENU_ITEM - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 -#endif -#ifndef ENCODER_PULSES_PER_STEP - #define ENCODER_PULSES_PER_STEP STD_ENCODER_PULSES_PER_STEP -#endif -#ifndef ENCODER_STEPS_PER_MENU_ITEM - #define ENCODER_STEPS_PER_MENU_ITEM STD_ENCODER_STEPS_PER_MENU_ITEM -#endif -#ifndef ENCODER_FEEDRATE_DEADZONE - #define ENCODER_FEEDRATE_DEADZONE 6 -#endif + #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 + #define ULTIPANEL -// Shift register panels -// --------------------- -// 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection + #elif ENABLED(LCD_I2C_VIKI) -#if ENABLED(SAV_3DLCD) - #define SR_LCD_2W_NL // Non latching 2 wire shift register - #define ULTIPANEL -#endif + /** + * Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs + * + * 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 -#if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display - #ifndef LCD_WIDTH - #ifdef LCD_WIDTH_OVERRIDE - #define LCD_WIDTH LCD_WIDTH_OVERRIDE - #else + #define ENCODER_FEEDRATE_DEADZONE 4 + + #define STD_ENCODER_PULSES_PER_STEP 1 + #define STD_ENCODER_STEPS_PER_MENU_ITEM 2 + + #elif ENABLED(G3D_PANEL) + + #define STD_ENCODER_PULSES_PER_STEP 2 + #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 + + #elif ENABLED(miniVIKI) || ENABLED(VIKI2) \ + || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ + || ENABLED(OLED_PANEL_TINYBOY2) \ + || ENABLED(BQ_LCD_SMART_CONTROLLER) \ + || ENABLED(LCD_I2C_PANELOLU2) \ + || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #define STD_ENCODER_PULSES_PER_STEP 4 + #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 + #endif + + #ifndef STD_ENCODER_PULSES_PER_STEP + #define STD_ENCODER_PULSES_PER_STEP 5 + #endif + #ifndef STD_ENCODER_STEPS_PER_MENU_ITEM + #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 + #endif + #ifndef ENCODER_PULSES_PER_STEP + #define ENCODER_PULSES_PER_STEP STD_ENCODER_PULSES_PER_STEP + #endif + #ifndef ENCODER_STEPS_PER_MENU_ITEM + #define ENCODER_STEPS_PER_MENU_ITEM STD_ENCODER_STEPS_PER_MENU_ITEM + #endif + #ifndef ENCODER_FEEDRATE_DEADZONE + #define ENCODER_FEEDRATE_DEADZONE 6 + #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 + #endif + + #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display + #ifndef LCD_WIDTH #define LCD_WIDTH 22 #endif - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 5 - #endif -#endif - -#if ENABLED(NO_LCD_MENUS) - #undef ULTIPANEL -#endif - -#if ENABLED(ULTIPANEL) - #define NEWPANEL // Disable this if you actually have no click-encoder panel - #define ULTRA_LCD - #ifndef LCD_WIDTH - #define LCD_WIDTH 20 - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 4 - #endif -#elif ENABLED(ULTRA_LCD) // no panel but just LCD - #ifndef LCD_WIDTH - #define LCD_WIDTH 16 - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 2 - #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. - - // Symbol characters - #define LCD_STR_FILAM_DIA "\xf8" - #define LCD_STR_FILAM_MUL "\xa4" -#else - // Custom characters defined in the first 8 characters of the LCD - #define LCD_BEDTEMP_CHAR 0x00 // Print only as a char. This will have 'unexpected' results when used in a string! - #define LCD_DEGREE_CHAR 0x01 - #define LCD_STR_THERMOMETER "\x02" // Still used with string concatenation - #define LCD_UPLEVEL_CHAR 0x03 - #define LCD_STR_REFRESH "\x04" - #define LCD_STR_FOLDER "\x05" - #define LCD_FEEDRATE_CHAR 0x06 - #define LCD_CLOCK_CHAR 0x07 - #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 + #ifndef LCD_HEIGHT + #define LCD_HEIGHT 5 #endif #endif -#endif -// Boot screens -#if DISABLED(ULTRA_LCD) - #undef SHOW_BOOTSCREEN -#elif !defined(BOOTSCREEN_TIMEOUT) - #define BOOTSCREEN_TIMEOUT 2500 -#endif + #if ENABLED(ULTIPANEL) + #define NEWPANEL // Disable this if you actually have no click-encoder panel + #define ULTRA_LCD + #ifndef LCD_WIDTH + #define LCD_WIDTH 20 + #endif + #ifndef LCD_HEIGHT + #define LCD_HEIGHT 4 + #endif + #elif ENABLED(ULTRA_LCD) // no panel but just LCD + #ifndef LCD_WIDTH + #define LCD_WIDTH 16 + #endif + #ifndef LCD_HEIGHT + #define LCD_HEIGHT 2 + #endif + #endif -#define HAS_DEBUG_MENU (ENABLED(ULTIPANEL) && ENABLED(LCD_PROGRESS_BAR_TEST)) + #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" -/** - * 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 - * E_MANUAL - Number of E steppers for LCD move options - * - */ -#if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS - #if EXTRUDERS > 4 - #define E_STEPPERS 3 - #elif EXTRUDERS > 2 - #define E_STEPPERS 2 + #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. + + // Symbol characters + #define LCD_STR_FILAM_DIA "\xf8" + #define LCD_STR_FILAM_MUL "\xa4" #else - #define E_STEPPERS 1 + // Custom characters defined in the first 8 characters of the LCD + #define LCD_BEDTEMP_CHAR 0x00 // Print only as a char. This will have 'unexpected' results when used in a string! + #define LCD_DEGREE_CHAR 0x01 + #define LCD_STR_THERMOMETER "\x02" // Still used with string concatenation + #define LCD_UPLEVEL_CHAR 0x03 + #define LCD_STR_REFRESH "\x04" + #define LCD_STR_FOLDER "\x05" + #define LCD_FEEDRATE_CHAR 0x06 + #define LCD_CLOCK_CHAR 0x07 + #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ #endif - #if DISABLED(SWITCHING_NOZZLE) - #define HOTENDS E_STEPPERS + + /** + * 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 - #define E_MANUAL EXTRUDERS -#elif ENABLED(MIXING_EXTRUDER) - #define E_STEPPERS MIXING_STEPPERS - #define E_MANUAL 1 -#else - #define E_STEPPERS EXTRUDERS - #define E_MANUAL EXTRUDERS -#endif -// No inactive extruders with MK2_MULTIPLEXER or SWITCHING_NOZZLE -#if ENABLED(MK2_MULTIPLEXER) || ENABLED(SWITCHING_NOZZLE) - #undef DISABLE_INACTIVE_EXTRUDER -#endif + // Boot screens + #if DISABLED(ULTRA_LCD) + #undef SHOW_BOOTSCREEN + #elif !defined(BOOTSCREEN_TIMEOUT) + #define BOOTSCREEN_TIMEOUT 2500 + #endif -// MK2 Multiplexer forces SINGLENOZZLE -#if ENABLED(MK2_MULTIPLEXER) - #define SINGLENOZZLE -#endif + #define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST) -#if ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset - #undef HOTENDS - #define HOTENDS 1 - #undef TEMP_SENSOR_1_AS_REDUNDANT - #undef HOTEND_OFFSET_X - #undef HOTEND_OFFSET_Y -#endif + // MK2 Multiplexer forces SINGLENOZZLE to be enabled + #if ENABLED(MK2_MULTIPLEXER) + #define SINGLENOZZLE + #endif -#ifndef HOTENDS - #define HOTENDS EXTRUDERS -#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 + * E_MANUAL - Number of E steppers for LCD move options + * TOOL_E_INDEX - Index to use when getting/setting the tool state + * + */ + #if ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset + #define HOTENDS 1 + #undef TEMP_SENSOR_1_AS_REDUNDANT + #undef HOTEND_OFFSET_X + #undef HOTEND_OFFSET_Y + #else // Two hotends + #define HOTENDS EXTRUDERS + #if ENABLED(SWITCHING_NOZZLE) && !defined(HOTEND_OFFSET_Z) + #define HOTEND_OFFSET_Z { 0 } + #endif + #endif -#define DO_SWITCH_EXTRUDER (ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)) - -/** - * DISTINCT_E_FACTORS affects how some E factors are accessed - */ -#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1 - #define XYZE_N (XYZ + E_STEPPERS) - #if ENABLED(HANGPRINTER) - #define NUM_AXIS_N (ABCD + E_STEPPERS) + #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(MIXING_EXTRUDER) // Unified E axis + #if ENABLED(MIXING_EXTRUDER) + #define E_STEPPERS MIXING_STEPPERS + #else + #define E_STEPPERS 1 // One E stepper + #endif + #define E_MANUAL 1 + #define TOOL_E_INDEX 0 #else - #define NUM_AXIS_N (XYZ + E_STEPPERS) + #define E_STEPPERS EXTRUDERS + #define E_MANUAL EXTRUDERS + #define TOOL_E_INDEX current_block->active_extruder #endif - #define E_AXIS_N (E_AXIS + extruder) -#else - #undef DISTINCT_E_FACTORS - #define XYZE_N XYZE - #if ENABLED(HANGPRINTER) - #define NUM_AXIS_N ABCDE + + /** + * DISTINCT_E_FACTORS affects how some E factors are accessed + */ + #if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1 + #define XYZE_N (XYZ + E_STEPPERS) + #define E_AXIS_N (E_AXIS + extruder) #else - #define NUM_AXIS_N XYZE + #undef DISTINCT_E_FACTORS + #define XYZE_N XYZE + #define E_AXIS_N E_AXIS #endif - #define E_AXIS_N E_AXIS -#endif -/** - * The BLTouch Probe emulates a servo probe - * and uses "special" angles for its state. - */ -#if ENABLED(BLTOUCH) - #ifndef Z_PROBE_SERVO_NR - #define Z_PROBE_SERVO_NR 0 + /** + * The BLTouch Probe emulates a servo probe + * and uses "special" angles for its state. + */ + #if ENABLED(BLTOUCH) + #ifndef Z_ENDSTOP_SERVO_NR + #define Z_ENDSTOP_SERVO_NR 0 + #endif + #ifndef NUM_SERVOS + #define NUM_SERVOS (Z_ENDSTOP_SERVO_NR + 1) + #endif + #undef DEACTIVATE_SERVOS_AFTER_MOVE + #if NUM_SERVOS == 1 + #undef SERVO_DELAY + #define SERVO_DELAY { 50 } + #endif + #ifndef BLTOUCH_DELAY + #define BLTOUCH_DELAY 375 + #endif + #undef Z_SERVO_ANGLES + #define Z_SERVO_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW } + + #define BLTOUCH_DEPLOY 10 + #define BLTOUCH_STOW 90 + #define BLTOUCH_SELFTEST 120 + #define BLTOUCH_RESET 160 + #define _TEST_BLTOUCH(P) (READ(P##_PIN) != P##_ENDSTOP_INVERTING) + + // Always disable probe pin inverting for BLTouch + #undef Z_MIN_PROBE_ENDSTOP_INVERTING + #define Z_MIN_PROBE_ENDSTOP_INVERTING false + + #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #undef Z_MIN_ENDSTOP_INVERTING + #define Z_MIN_ENDSTOP_INVERTING false + #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN) + #else + #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN_PROBE) + #endif #endif - #ifndef NUM_SERVOS - #define NUM_SERVOS (Z_PROBE_SERVO_NR + 1) + + /** + * Set a flag for a servo probe + */ + #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0) + + /** + * Set a flag for any enabled probe + */ + #define PROBE_SELECTED (ENABLED(PROBE_MANUALLY) || ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE)) + + /** + * Clear probe pin settings when no probe is selected + */ + #if !PROBE_SELECTED || ENABLED(PROBE_MANUALLY) + #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + #undef Z_MIN_PROBE_ENDSTOP #endif - #undef DEACTIVATE_SERVOS_AFTER_MOVE - #if NUM_SERVOS == 1 - #undef SERVO_DELAY - #define SERVO_DELAY { 50 } - #endif - #ifndef BLTOUCH_DELAY - #define BLTOUCH_DELAY 375 - #endif - #undef Z_SERVO_ANGLES - #define Z_SERVO_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW } - #define BLTOUCH_DEPLOY 10 - #define BLTOUCH_STOW 90 - #define BLTOUCH_SELFTEST 120 - #define BLTOUCH_RESET 160 - #define _TEST_BLTOUCH(P) (READ(P##_PIN) != P##_ENDSTOP_INVERTING) - - // Always disable probe pin inverting for BLTouch - #undef Z_MIN_PROBE_ENDSTOP_INVERTING - #define Z_MIN_PROBE_ENDSTOP_INVERTING false - - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #undef Z_MIN_ENDSTOP_INVERTING - #define Z_MIN_ENDSTOP_INVERTING Z_MIN_PROBE_ENDSTOP_INVERTING - #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN) - #else - #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN_PROBE) - #endif -#endif - -/** - * Set a flag for a servo probe - */ -#define HAS_Z_SERVO_PROBE (defined(Z_PROBE_SERVO_NR) && Z_PROBE_SERVO_NR >= 0) - -/** - * Set flags for enabled probes - */ -#define HAS_BED_PROBE (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_PROBE || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE)) -#define PROBE_SELECTED (HAS_BED_PROBE || ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING)) - -#if !HAS_BED_PROBE - // Clear probe pin settings when no probe is selected - #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - #undef Z_MIN_PROBE_ENDSTOP -#elif ENABLED(Z_PROBE_ALLEN_KEY) - // Extra test for Allen Key Probe - #define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST -#endif - -#define HOMING_Z_WITH_PROBE (HAS_BED_PROBE && Z_HOME_DIR < 0 && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) - -#define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS)) -#define HAS_RESUME_CONTINUE (ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER)) -#define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED)) - -#define USE_MARLINSERIAL !(defined(__AVR__) && defined(USBCON)) + #define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS)) + #define HAS_RESUME_CONTINUE (ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER)) + #define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED)) #endif // CONDITIONALS_LCD_H diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 3707d77..9b69e1f 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -28,1296 +28,1049 @@ #ifndef CONDITIONALS_POST_H #define CONDITIONALS_POST_H -#define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA)) -#define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA || ENABLED(HANGPRINTER)) -#define IS_CARTESIAN !IS_KINEMATIC + #define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA)) + #define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA) + #define IS_CARTESIAN !IS_KINEMATIC -/** - * Axis lengths and center - */ -#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)) + /** + * Axis lengths and center + */ + #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)) -// Defined only if the sanity-check is bypassed -#ifndef X_BED_SIZE - #define X_BED_SIZE X_MAX_LENGTH -#endif -#ifndef Y_BED_SIZE - #define Y_BED_SIZE Y_MAX_LENGTH -#endif - -// Require 0,0 bed center for Delta, SCARA, and HANGPRINTER -#if IS_KINEMATIC - #define BED_CENTER_AT_0_0 -#endif - -// Define center values for future use -#if ENABLED(BED_CENTER_AT_0_0) - #define X_CENTER 0 - #define Y_CENTER 0 -#else - #define X_CENTER ((X_BED_SIZE) / 2) - #define Y_CENTER ((Y_BED_SIZE) / 2) -#endif -#define Z_CENTER ((Z_MIN_POS + Z_MAX_POS) / 2) - -// Get the linear boundaries of the bed -#define X_MIN_BED (X_CENTER - (X_BED_SIZE) / 2) -#define X_MAX_BED (X_CENTER + (X_BED_SIZE) / 2) -#define Y_MIN_BED (Y_CENTER - (Y_BED_SIZE) / 2) -#define Y_MAX_BED (Y_CENTER + (Y_BED_SIZE) / 2) - -/** - * Dual X Carriage - */ -#if ENABLED(DUAL_X_CARRIAGE) - #ifndef X1_MIN_POS - #define X1_MIN_POS X_MIN_POS + // Defined only if the sanity-check is bypassed + #ifndef X_BED_SIZE + #define X_BED_SIZE X_MAX_LENGTH #endif - #ifndef X1_MAX_POS - #define X1_MAX_POS X_BED_SIZE + #ifndef Y_BED_SIZE + #define Y_BED_SIZE Y_MAX_LENGTH #endif -#endif -/** - * CoreXY, CoreXZ, and CoreYZ - and their reverse - */ -#define CORE_IS_XY (ENABLED(COREXY) || ENABLED(COREYX)) -#define CORE_IS_XZ (ENABLED(COREXZ) || ENABLED(COREZX)) -#define CORE_IS_YZ (ENABLED(COREYZ) || ENABLED(COREZY)) -#define IS_CORE (CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ) -#if IS_CORE - #if CORE_IS_XY - #define CORE_AXIS_1 A_AXIS - #define CORE_AXIS_2 B_AXIS - #define NORMAL_AXIS Z_AXIS - #elif CORE_IS_XZ - #define CORE_AXIS_1 A_AXIS - #define NORMAL_AXIS Y_AXIS - #define CORE_AXIS_2 C_AXIS - #elif CORE_IS_YZ - #define NORMAL_AXIS X_AXIS - #define CORE_AXIS_1 B_AXIS - #define CORE_AXIS_2 C_AXIS + // Require 0,0 bed center for Delta and SCARA + #if IS_KINEMATIC + #define BED_CENTER_AT_0_0 #endif - #if ENABLED(COREYX) || ENABLED(COREZX) || ENABLED(COREZY) - #define CORESIGN(n) (-(n)) + + // Define center values for future use + #if ENABLED(BED_CENTER_AT_0_0) + #define X_CENTER 0 + #define Y_CENTER 0 #else - #define CORESIGN(n) (n) + #define X_CENTER ((X_BED_SIZE) / 2) + #define Y_CENTER ((Y_BED_SIZE) / 2) #endif -#endif + #define Z_CENTER ((Z_MIN_POS + Z_MAX_POS) / 2) -/** - * No adjustable bed on non-cartesians - */ -#if IS_KINEMATIC - #undef LEVEL_BED_CORNERS -#endif + // Get the linear boundaries of the bed + #define X_MIN_BED (X_CENTER - (X_BED_SIZE) / 2) + #define X_MAX_BED (X_CENTER + (X_BED_SIZE) / 2) + #define Y_MIN_BED (Y_CENTER - (Y_BED_SIZE) / 2) + #define Y_MAX_BED (Y_CENTER + (Y_BED_SIZE) / 2) -/** - * SCARA cannot use SLOWDOWN and requires QUICKHOME - */ -#if IS_SCARA - #undef SLOWDOWN - #define QUICK_HOME -#endif + /** + * CoreXY, CoreXZ, and CoreYZ - and their reverse + */ + #define CORE_IS_XY (ENABLED(COREXY) || ENABLED(COREYX)) + #define CORE_IS_XZ (ENABLED(COREXZ) || ENABLED(COREZX)) + #define CORE_IS_YZ (ENABLED(COREYZ) || ENABLED(COREZY)) + #define IS_CORE (CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ) + #if IS_CORE + #if CORE_IS_XY + #define CORE_AXIS_1 A_AXIS + #define CORE_AXIS_2 B_AXIS + #define NORMAL_AXIS Z_AXIS + #elif CORE_IS_XZ + #define CORE_AXIS_1 A_AXIS + #define NORMAL_AXIS Y_AXIS + #define CORE_AXIS_2 C_AXIS + #elif CORE_IS_YZ + #define NORMAL_AXIS X_AXIS + #define CORE_AXIS_1 B_AXIS + #define CORE_AXIS_2 C_AXIS + #endif + #if ENABLED(COREYX) || ENABLED(COREZX) || ENABLED(COREZY) + #define CORESIGN(n) (-(n)) + #else + #define CORESIGN(n) (n) + #endif + #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) || ENABLED(HANGPRINTER) - #define X_HOME_POS 0 + /** + * No adjustable bed on non-cartesians + */ + #if IS_KINEMATIC + #undef LEVEL_BED_CORNERS + #endif + + /** + * SCARA cannot use SLOWDOWN and requires QUICKHOME + */ + #if IS_SCARA + #undef SLOWDOWN + #define QUICK_HOME + #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_BED_SIZE) * (X_HOME_DIR) * 0.5) + #endif #else - #define X_HOME_POS ((X_BED_SIZE) * (X_HOME_DIR) * 0.5) + #if ENABLED(DELTA) + #define X_HOME_POS (X_MIN_POS + (X_BED_SIZE) * 0.5) + #else + #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS) + #endif #endif -#else + + #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_BED_SIZE) * (Y_HOME_DIR) * 0.5) + #endif + #else + #if ENABLED(DELTA) + #define Y_HOME_POS (Y_MIN_POS + (Y_BED_SIZE) * 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 + + /** + * If DELTA_HEIGHT isn't defined use the old setting + */ + #if ENABLED(DELTA) && !defined(DELTA_HEIGHT) + #define DELTA_HEIGHT Z_HOME_POS + #endif + + /** + * Auto Bed Leveling and Z Probe Repeatability Test + */ + #define HOMING_Z_WITH_PROBE (HAS_BED_PROBE && Z_HOME_DIR < 0 && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) + + /** + * Z Sled Probe requires Z_SAFE_HOMING + */ + #if ENABLED(Z_PROBE_SLED) + #define Z_SAFE_HOMING + #endif + + /** + * DELTA should ignore Z_SAFE_HOMING and SLOWDOWN + */ #if ENABLED(DELTA) - #define X_HOME_POS (X_MIN_POS + (X_BED_SIZE) * 0.5) + #undef Z_SAFE_HOMING + #undef SLOWDOWN + #endif + + /** + * Safe Homing Options + */ + #if ENABLED(Z_SAFE_HOMING) + #ifndef Z_SAFE_HOMING_X_POINT + #define Z_SAFE_HOMING_X_POINT X_CENTER + #endif + #ifndef Z_SAFE_HOMING_Y_POINT + #define Z_SAFE_HOMING_Y_POINT Y_CENTER + #endif + #define X_TILT_FULCRUM Z_SAFE_HOMING_X_POINT + #define Y_TILT_FULCRUM Z_SAFE_HOMING_Y_POINT #else - #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS) + #define X_TILT_FULCRUM X_HOME_POS + #define Y_TILT_FULCRUM Y_HOME_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) || ENABLED(HANGPRINTER)) - #define Y_HOME_POS 0 + /** + * Host keep alive + */ + #ifndef DEFAULT_KEEPALIVE_INTERVAL + #define DEFAULT_KEEPALIVE_INTERVAL 2 + #endif + + /** + * Provide a MAX_AUTORETRACT for older configs + */ + #if ENABLED(FWRETRACT) && !defined(MAX_AUTORETRACT) + #define MAX_AUTORETRACT 99 + #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 Y_HOME_POS ((Y_BED_SIZE) * (Y_HOME_DIR) * 0.5) + #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step) #endif -#else - #if ENABLED(DELTA) - #define Y_HOME_POS (Y_MIN_POS + (Y_BED_SIZE) * 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 - -/** - * If DELTA_HEIGHT isn't defined use the old setting - */ -#if ENABLED(DELTA) && !defined(DELTA_HEIGHT) - #define DELTA_HEIGHT Z_HOME_POS -#endif - -/** - * Z Sled Probe requires Z_SAFE_HOMING - */ -#if ENABLED(Z_PROBE_SLED) - #define Z_SAFE_HOMING -#endif - -/** - * DELTA should ignore Z_SAFE_HOMING and SLOWDOWN - */ -#if ENABLED(DELTA) - #undef Z_SAFE_HOMING - #undef SLOWDOWN -#endif - -/** - * Safe Homing Options - */ -#if ENABLED(Z_SAFE_HOMING) - #ifndef Z_SAFE_HOMING_X_POINT - #define Z_SAFE_HOMING_X_POINT X_CENTER - #endif - #ifndef Z_SAFE_HOMING_Y_POINT - #define Z_SAFE_HOMING_Y_POINT Y_CENTER - #endif - #define X_TILT_FULCRUM Z_SAFE_HOMING_X_POINT - #define Y_TILT_FULCRUM Z_SAFE_HOMING_Y_POINT -#else - #define X_TILT_FULCRUM X_HOME_POS - #define Y_TILT_FULCRUM Y_HOME_POS -#endif - -/** - * Host keep alive - */ -#ifndef DEFAULT_KEEPALIVE_INTERVAL - #define DEFAULT_KEEPALIVE_INTERVAL 2 -#endif - -/** - * Provide a MAX_AUTORETRACT for older configs - */ -#if ENABLED(FWRETRACT) && !defined(MAX_AUTORETRACT) - #define MAX_AUTORETRACT 99 -#endif - -// MS1 MS2 Stepper Driver Microstepping mode table -#define MICROSTEP1 LOW,LOW -#if ENABLED(HEROIC_STEPPER_DRIVERS) - #define MICROSTEP128 LOW,HIGH -#else + // MS1 MS2 Stepper Driver Microstepping mode table + #define MICROSTEP1 LOW,LOW #define MICROSTEP2 HIGH,LOW #define MICROSTEP4 LOW,HIGH -#endif -#define MICROSTEP8 HIGH,HIGH -#define MICROSTEP16 HIGH,HIGH + #define MICROSTEP8 HIGH,HIGH + #define MICROSTEP16 HIGH,HIGH -/** - * Override here because this is set in Configuration_adv.h - */ -#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 == -4 - #define HEATER_0_USES_AD8495 -#elif TEMP_SENSOR_0 == -3 - #define HEATER_0_USES_MAX6675 - #define MAX6675_IS_MAX31855 - #define MAX6675_TMIN -270 - #define MAX6675_TMAX 1800 -#elif TEMP_SENSOR_0 == -2 - #define HEATER_0_USES_MAX6675 - #define MAX6675_TMIN 0 - #define MAX6675_TMAX 1024 -#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 == -4 - #define HEATER_1_USES_AD8495 -#elif TEMP_SENSOR_1 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_1." -#elif TEMP_SENSOR_1 == -2 - #error "MAX6675 Thermocouples (-2) 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 == -4 - #define HEATER_2_USES_AD8495 -#elif TEMP_SENSOR_2 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_2." -#elif TEMP_SENSOR_2 == -2 - #error "MAX6675 Thermocouples (-2) 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 == -4 - #define HEATER_3_USES_AD8495 -#elif TEMP_SENSOR_3 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3." -#elif TEMP_SENSOR_3 == -2 - #error "MAX6675 Thermocouples (-2) 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_4 == -4 - #define HEATER_4_USES_AD8495 -#elif TEMP_SENSOR_4 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4." -#elif TEMP_SENSOR_4 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4." -#elif TEMP_SENSOR_4 == -1 - #define HEATER_4_USES_AD595 -#elif TEMP_SENSOR_4 == 0 - #undef HEATER_4_MINTEMP - #undef HEATER_4_MAXTEMP -#elif TEMP_SENSOR_4 > 0 - #define THERMISTORHEATER_4 TEMP_SENSOR_4 - #define HEATER_4_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_BED == -4 - #define HEATER_BED_USES_AD8495 -#elif TEMP_SENSOR_BED == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BED." -#elif TEMP_SENSOR_BED == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED." -#elif TEMP_SENSOR_BED == -1 - #define HEATER_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 HEATER_BED_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_CHAMBER == -4 - #define HEATER_CHAMBER_USES_AD8495 -#elif TEMP_SENSOR_CHAMBER == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER." -#elif TEMP_SENSOR_CHAMBER == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER." -#elif TEMP_SENSOR_CHAMBER == -1 - #define HEATER_CHAMBER_USES_AD595 -#elif TEMP_SENSOR_CHAMBER > 0 - #define THERMISTORCHAMBER TEMP_SENSOR_CHAMBER - #define HEATER_CHAMBER_USES_THERMISTOR -#endif - -#define HOTEND_USES_THERMISTOR (ENABLED(HEATER_0_USES_THERMISTOR) || ENABLED(HEATER_1_USES_THERMISTOR) || ENABLED(HEATER_2_USES_THERMISTOR) || ENABLED(HEATER_3_USES_THERMISTOR) || ENABLED(HEATER_4_USES_THERMISTOR)) - -/** - * Default hotend offsets, if not defined - */ -#define HAS_HOTEND_OFFSET_Z (HOTENDS > 1 && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER))) -#if HOTENDS > 1 - #ifndef HOTEND_OFFSET_X - #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder + /** + * Override here because this is set in Configuration_adv.h + */ + #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) + #undef SD_DETECT_INVERTED #endif - #ifndef HOTEND_OFFSET_Y - #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder + + /** + * Set defaults for missing (newer) options + */ + #ifndef DISABLE_INACTIVE_X + #define DISABLE_INACTIVE_X DISABLE_X #endif - #if HAS_HOTEND_OFFSET_Z && !defined(HOTEND_OFFSET_Z) - #define HOTEND_OFFSET_Z { 0 } + #ifndef DISABLE_INACTIVE_Y + #define DISABLE_INACTIVE_Y DISABLE_Y #endif -#endif - -/** - * ARRAY_BY_EXTRUDERS based on EXTRUDERS - */ -#define ARRAY_BY_EXTRUDERS(...) ARRAY_N(EXTRUDERS, __VA_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(...) ARRAY_N(HOTENDS, __VA_ARGS__) -#define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1) - -/** - * Driver Timings - * NOTE: Driver timing order is longest-to-shortest duration. - * Preserve this ordering when adding new drivers. - */ -#ifndef MINIMUM_STEPPER_DIR_DELAY - #if HAS_DRIVER(TB6560) - #define MINIMUM_STEPPER_DIR_DELAY 15000 - #elif HAS_DRIVER(TB6600) - #define MINIMUM_STEPPER_DIR_DELAY 1500 - #elif HAS_DRIVER(DRV8825) - #define MINIMUM_STEPPER_DIR_DELAY 650 - #elif HAS_DRIVER(LV8729) - #define MINIMUM_STEPPER_DIR_DELAY 500 - #elif HAS_DRIVER(A4988) - #define MINIMUM_STEPPER_DIR_DELAY 200 - #elif HAS_TRINAMIC || HAS_DRIVER(TMC2660) || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) - #define MINIMUM_STEPPER_DIR_DELAY 20 - #else - #define MINIMUM_STEPPER_DIR_DELAY 200 // Expect at least 10µS since one Stepper ISR must transpire + #ifndef DISABLE_INACTIVE_Z + #define DISABLE_INACTIVE_Z DISABLE_Z #endif -#endif - -#ifndef MINIMUM_STEPPER_PULSE - #if HAS_DRIVER(TB6560) - #define MINIMUM_STEPPER_PULSE 30 - #elif HAS_DRIVER(TB6600) - #define MINIMUM_STEPPER_PULSE 3 - #elif HAS_DRIVER(DRV8825) - #define MINIMUM_STEPPER_PULSE 2 - #elif HAS_DRIVER(A4988) || HAS_DRIVER(LV8729) - #define MINIMUM_STEPPER_PULSE 1 - #elif HAS_TRINAMIC || HAS_DRIVER(TMC2660) || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) - #define MINIMUM_STEPPER_PULSE 0 - #else - #define MINIMUM_STEPPER_PULSE 1 + #ifndef DISABLE_INACTIVE_E + #define DISABLE_INACTIVE_E DISABLE_E #endif -#endif -#ifndef MAXIMUM_STEPPER_RATE - #if HAS_DRIVER(TB6560) - #define MAXIMUM_STEPPER_RATE 15000 - #elif HAS_DRIVER(LV8729) - #define MAXIMUM_STEPPER_RATE 130000 - #elif HAS_DRIVER(TB6600) - #define MAXIMUM_STEPPER_RATE 150000 - #elif HAS_DRIVER(DRV8825) - #define MAXIMUM_STEPPER_RATE 250000 - #elif HAS_TRINAMIC || HAS_DRIVER(TMC2660) || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) - #define MAXIMUM_STEPPER_RATE 400000 - #elif HAS_DRIVER(A4988) - #define MAXIMUM_STEPPER_RATE 500000 - #else - #define MAXIMUM_STEPPER_RATE 500000 + // Power Signal Control Definitions + // By default use ATX definition + #ifndef POWER_SUPPLY + #define POWER_SUPPLY 1 #endif -#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)) -/** - * X_DUAL_ENDSTOPS endstop reassignment - */ -#if ENABLED(X_DUAL_ENDSTOPS) - #if X_HOME_DIR > 0 - #if X2_USE_ENDSTOP == _XMIN_ - #define X2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define X2_MAX_PIN X_MIN_PIN - #elif X2_USE_ENDSTOP == _XMAX_ - #define X2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define X2_MAX_PIN X_MAX_PIN - #elif X2_USE_ENDSTOP == _YMIN_ - #define X2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define X2_MAX_PIN Y_MIN_PIN - #elif X2_USE_ENDSTOP == _YMAX_ - #define X2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define X2_MAX_PIN Y_MAX_PIN - #elif X2_USE_ENDSTOP == _ZMIN_ - #define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define X2_MAX_PIN Z_MIN_PIN - #elif X2_USE_ENDSTOP == _ZMAX_ - #define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define X2_MAX_PIN Z_MAX_PIN + /** + * Temp Sensor defines + */ + #if TEMP_SENSOR_0 == -3 + #define HEATER_0_USES_MAX6675 + #define MAX6675_IS_MAX31855 + #define MAX6675_TMIN -270 + #define MAX6675_TMAX 1800 + #elif TEMP_SENSOR_0 == -2 + #define HEATER_0_USES_MAX6675 + #define MAX6675_TMIN 0 + #define MAX6675_TMAX 1024 + #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_4 <= -2 + #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_4" + #elif TEMP_SENSOR_4 == -1 + #define HEATER_4_USES_AD595 + #elif TEMP_SENSOR_4 == 0 + #undef HEATER_4_MINTEMP + #undef HEATER_4_MAXTEMP + #elif TEMP_SENSOR_4 > 0 + #define THERMISTORHEATER_4 TEMP_SENSOR_4 + #define HEATER_4_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_NOZZLE)) + #define HOTEND_OFFSET_Z { 0 } + #endif + #endif + + /** + * ARRAY_BY_EXTRUDERS based on EXTRUDERS + */ + #define ARRAY_BY_EXTRUDERS(...) ARRAY_N(EXTRUDERS, __VA_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(...) ARRAY_N(HOTENDS, __VA_ARGS__) + #define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1) + + /** + * X_DUAL_ENDSTOPS endstop reassignment + */ + #if ENABLED(X_DUAL_ENDSTOPS) + #if X_HOME_DIR > 0 + #if X2_USE_ENDSTOP == _XMIN_ + #define X2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #define X2_MAX_PIN X_MIN_PIN + #elif X2_USE_ENDSTOP == _XMAX_ + #define X2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #define X2_MAX_PIN X_MAX_PIN + #elif X2_USE_ENDSTOP == _YMIN_ + #define X2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #define X2_MAX_PIN Y_MIN_PIN + #elif X2_USE_ENDSTOP == _YMAX_ + #define X2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #define X2_MAX_PIN Y_MAX_PIN + #elif X2_USE_ENDSTOP == _ZMIN_ + #define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #define X2_MAX_PIN Z_MIN_PIN + #elif X2_USE_ENDSTOP == _ZMAX_ + #define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #define X2_MAX_PIN Z_MAX_PIN + #else + #define X2_MAX_ENDSTOP_INVERTING false + #endif + #define X2_MIN_ENDSTOP_INVERTING false #else + #if X2_USE_ENDSTOP == _XMIN_ + #define X2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #define X2_MIN_PIN X_MIN_PIN + #elif X2_USE_ENDSTOP == _XMAX_ + #define X2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #define X2_MIN_PIN X_MAX_PIN + #elif X2_USE_ENDSTOP == _YMIN_ + #define X2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #define X2_MIN_PIN Y_MIN_PIN + #elif X2_USE_ENDSTOP == _YMAX_ + #define X2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #define X2_MIN_PIN Y_MAX_PIN + #elif X2_USE_ENDSTOP == _ZMIN_ + #define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #define X2_MIN_PIN Z_MIN_PIN + #elif X2_USE_ENDSTOP == _ZMAX_ + #define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #define X2_MIN_PIN Z_MAX_PIN + #else + #define X2_MIN_ENDSTOP_INVERTING false + #endif #define X2_MAX_ENDSTOP_INVERTING false #endif - #define X2_MIN_ENDSTOP_INVERTING false - #else - #if X2_USE_ENDSTOP == _XMIN_ - #define X2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define X2_MIN_PIN X_MIN_PIN - #elif X2_USE_ENDSTOP == _XMAX_ - #define X2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define X2_MIN_PIN X_MAX_PIN - #elif X2_USE_ENDSTOP == _YMIN_ - #define X2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define X2_MIN_PIN Y_MIN_PIN - #elif X2_USE_ENDSTOP == _YMAX_ - #define X2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define X2_MIN_PIN Y_MAX_PIN - #elif X2_USE_ENDSTOP == _ZMIN_ - #define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define X2_MIN_PIN Z_MIN_PIN - #elif X2_USE_ENDSTOP == _ZMAX_ - #define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define X2_MIN_PIN Z_MAX_PIN - #else - #define X2_MIN_ENDSTOP_INVERTING false - #endif - #define X2_MAX_ENDSTOP_INVERTING false #endif -#endif -// Is an endstop plug used for the X2 endstop? -#define IS_X2_ENDSTOP(A,M) (ENABLED(X_DUAL_ENDSTOPS) && X2_USE_ENDSTOP == _##A##M##_) + // Is an endstop plug used for the X2 endstop? + #define IS_X2_ENDSTOP(A,M) (ENABLED(X_DUAL_ENDSTOPS) && X2_USE_ENDSTOP == _##A##M##_) -/** - * Y_DUAL_ENDSTOPS endstop reassignment - */ -#if ENABLED(Y_DUAL_ENDSTOPS) - #if Y_HOME_DIR > 0 - #if Y2_USE_ENDSTOP == _XMIN_ - #define Y2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Y2_MAX_PIN X_MIN_PIN - #elif Y2_USE_ENDSTOP == _XMAX_ - #define Y2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Y2_MAX_PIN X_MAX_PIN - #elif Y2_USE_ENDSTOP == _YMIN_ - #define Y2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Y2_MAX_PIN Y_MIN_PIN - #elif Y2_USE_ENDSTOP == _YMAX_ - #define Y2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Y2_MAX_PIN Y_MAX_PIN - #elif Y2_USE_ENDSTOP == _ZMIN_ - #define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Y2_MAX_PIN Z_MIN_PIN - #elif Y2_USE_ENDSTOP == _ZMAX_ - #define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Y2_MAX_PIN Z_MAX_PIN + /** + * Y_DUAL_ENDSTOPS endstop reassignment + */ + #if ENABLED(Y_DUAL_ENDSTOPS) + #if Y_HOME_DIR > 0 + #if Y2_USE_ENDSTOP == _XMIN_ + #define Y2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #define Y2_MAX_PIN X_MIN_PIN + #elif Y2_USE_ENDSTOP == _XMAX_ + #define Y2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #define Y2_MAX_PIN X_MAX_PIN + #elif Y2_USE_ENDSTOP == _YMIN_ + #define Y2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #define Y2_MAX_PIN Y_MIN_PIN + #elif Y2_USE_ENDSTOP == _YMAX_ + #define Y2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #define Y2_MAX_PIN Y_MAX_PIN + #elif Y2_USE_ENDSTOP == _ZMIN_ + #define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #define Y2_MAX_PIN Z_MIN_PIN + #elif Y2_USE_ENDSTOP == _ZMAX_ + #define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #define Y2_MAX_PIN Z_MAX_PIN + #else + #define Y2_MAX_ENDSTOP_INVERTING false + #endif + #define Y2_MIN_ENDSTOP_INVERTING false #else + #if Y2_USE_ENDSTOP == _XMIN_ + #define Y2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #define Y2_MIN_PIN X_MIN_PIN + #elif Y2_USE_ENDSTOP == _XMAX_ + #define Y2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #define Y2_MIN_PIN X_MAX_PIN + #elif Y2_USE_ENDSTOP == _YMIN_ + #define Y2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #define Y2_MIN_PIN Y_MIN_PIN + #elif Y2_USE_ENDSTOP == _YMAX_ + #define Y2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #define Y2_MIN_PIN Y_MAX_PIN + #elif Y2_USE_ENDSTOP == _ZMIN_ + #define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #define Y2_MIN_PIN Z_MIN_PIN + #elif Y2_USE_ENDSTOP == _ZMAX_ + #define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #define Y2_MIN_PIN Z_MAX_PIN + #else + #define Y2_MIN_ENDSTOP_INVERTING false + #endif #define Y2_MAX_ENDSTOP_INVERTING false #endif - #define Y2_MIN_ENDSTOP_INVERTING false - #else - #if Y2_USE_ENDSTOP == _XMIN_ - #define Y2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Y2_MIN_PIN X_MIN_PIN - #elif Y2_USE_ENDSTOP == _XMAX_ - #define Y2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Y2_MIN_PIN X_MAX_PIN - #elif Y2_USE_ENDSTOP == _YMIN_ - #define Y2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Y2_MIN_PIN Y_MIN_PIN - #elif Y2_USE_ENDSTOP == _YMAX_ - #define Y2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Y2_MIN_PIN Y_MAX_PIN - #elif Y2_USE_ENDSTOP == _ZMIN_ - #define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Y2_MIN_PIN Z_MIN_PIN - #elif Y2_USE_ENDSTOP == _ZMAX_ - #define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Y2_MIN_PIN Z_MAX_PIN - #else - #define Y2_MIN_ENDSTOP_INVERTING false - #endif - #define Y2_MAX_ENDSTOP_INVERTING false #endif -#endif -// Is an endstop plug used for the Y2 endstop or the bed probe? -#define IS_Y2_ENDSTOP(A,M) (ENABLED(Y_DUAL_ENDSTOPS) && Y2_USE_ENDSTOP == _##A##M##_) + // Is an endstop plug used for the Y2 endstop or the bed probe? + #define IS_Y2_ENDSTOP(A,M) (ENABLED(Y_DUAL_ENDSTOPS) && Y2_USE_ENDSTOP == _##A##M##_) -/** - * Z_DUAL_ENDSTOPS endstop reassignment - */ -#if ENABLED(Z_DUAL_ENDSTOPS) - #if Z_HOME_DIR > 0 - #if Z2_USE_ENDSTOP == _XMIN_ - #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN X_MIN_PIN - #elif Z2_USE_ENDSTOP == _XMAX_ - #define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN X_MAX_PIN - #elif Z2_USE_ENDSTOP == _YMIN_ - #define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN Y_MIN_PIN - #elif Z2_USE_ENDSTOP == _YMAX_ - #define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN Y_MAX_PIN - #elif Z2_USE_ENDSTOP == _ZMIN_ - #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN Z_MIN_PIN - #elif Z2_USE_ENDSTOP == _ZMAX_ - #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN Z_MAX_PIN + /** + * Z_DUAL_ENDSTOPS endstop reassignment + */ + #if ENABLED(Z_DUAL_ENDSTOPS) + #if Z_HOME_DIR > 0 + #if Z2_USE_ENDSTOP == _XMIN_ + #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #define Z2_MAX_PIN X_MIN_PIN + #elif Z2_USE_ENDSTOP == _XMAX_ + #define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #define Z2_MAX_PIN X_MAX_PIN + #elif Z2_USE_ENDSTOP == _YMIN_ + #define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #define Z2_MAX_PIN Y_MIN_PIN + #elif Z2_USE_ENDSTOP == _YMAX_ + #define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #define Z2_MAX_PIN Y_MAX_PIN + #elif Z2_USE_ENDSTOP == _ZMIN_ + #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #define Z2_MAX_PIN Z_MIN_PIN + #elif Z2_USE_ENDSTOP == _ZMAX_ + #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #define Z2_MAX_PIN Z_MAX_PIN + #else + #define Z2_MAX_ENDSTOP_INVERTING false + #endif + #define Z2_MIN_ENDSTOP_INVERTING false #else + #if Z2_USE_ENDSTOP == _XMIN_ + #define Z2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #define Z2_MIN_PIN X_MIN_PIN + #elif Z2_USE_ENDSTOP == _XMAX_ + #define Z2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #define Z2_MIN_PIN X_MAX_PIN + #elif Z2_USE_ENDSTOP == _YMIN_ + #define Z2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #define Z2_MIN_PIN Y_MIN_PIN + #elif Z2_USE_ENDSTOP == _YMAX_ + #define Z2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #define Z2_MIN_PIN Y_MAX_PIN + #elif Z2_USE_ENDSTOP == _ZMIN_ + #define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #define Z2_MIN_PIN Z_MIN_PIN + #elif Z2_USE_ENDSTOP == _ZMAX_ + #define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #define Z2_MIN_PIN Z_MAX_PIN + #else + #define Z2_MIN_ENDSTOP_INVERTING false + #endif #define Z2_MAX_ENDSTOP_INVERTING false #endif - #define Z2_MIN_ENDSTOP_INVERTING false + #endif + + // Is an endstop plug used for the Z2 endstop or the bed probe? + #define IS_Z2_OR_PROBE(A,M) ( \ + (ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP == _##A##M##_) \ + || (ENABLED(Z_MIN_PROBE_ENDSTOP) && Z_MIN_PROBE_PIN == A##_##M##_PIN ) ) + + /** + * Set ENDSTOPPULLUPS for active 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 + #endif + + /** + * Shorthand for pin tests, used wherever needed + */ + + // Steppers + #define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE)) + #define HAS_X_DIR (PIN_EXISTS(X_DIR)) + #define HAS_X_STEP (PIN_EXISTS(X_STEP)) + #define HAS_X_MICROSTEPS (PIN_EXISTS(X_MS1)) + + #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE)) + #define HAS_X2_DIR (PIN_EXISTS(X2_DIR)) + #define HAS_X2_STEP (PIN_EXISTS(X2_STEP)) + #define HAS_Y_MICROSTEPS (PIN_EXISTS(Y_MS1)) + + #define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE)) + #define HAS_Y_DIR (PIN_EXISTS(Y_DIR)) + #define HAS_Y_STEP (PIN_EXISTS(Y_STEP)) + #define HAS_Z_MICROSTEPS (PIN_EXISTS(Z_MS1)) + + #define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE)) + #define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR)) + #define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP)) + + #define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE)) + #define HAS_Z_DIR (PIN_EXISTS(Z_DIR)) + #define HAS_Z_STEP (PIN_EXISTS(Z_STEP)) + + #define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE)) + #define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR)) + #define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP)) + + // Extruder steppers and solenoids + #define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE)) + #define HAS_E0_DIR (PIN_EXISTS(E0_DIR)) + #define HAS_E0_STEP (PIN_EXISTS(E0_STEP)) + #define HAS_E0_MICROSTEPS (PIN_EXISTS(E0_MS1)) + #define HAS_SOLENOID_0 (PIN_EXISTS(SOL0)) + + #define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE)) + #define HAS_E1_DIR (PIN_EXISTS(E1_DIR)) + #define HAS_E1_STEP (PIN_EXISTS(E1_STEP)) + #define HAS_E1_MICROSTEPS (PIN_EXISTS(E1_MS1)) + #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1)) + + #define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE)) + #define HAS_E2_DIR (PIN_EXISTS(E2_DIR)) + #define HAS_E2_STEP (PIN_EXISTS(E2_STEP)) + #define HAS_E2_MICROSTEPS (PIN_EXISTS(E2_MS1)) + #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2)) + + #define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE)) + #define HAS_E3_DIR (PIN_EXISTS(E3_DIR)) + #define HAS_E3_STEP (PIN_EXISTS(E3_STEP)) + #define HAS_E3_MICROSTEPS (PIN_EXISTS(E3_MS1)) + #define HAS_SOLENOID_3 (PIN_EXISTS(SOL3)) + + #define HAS_E4_ENABLE (PIN_EXISTS(E4_ENABLE)) + #define HAS_E4_DIR (PIN_EXISTS(E4_DIR)) + #define HAS_E4_STEP (PIN_EXISTS(E4_STEP)) + #define HAS_E4_MICROSTEPS (PIN_EXISTS(E4_MS1)) + #define HAS_SOLENOID_4 (PIN_EXISTS(SOL4)) + + // Endstops and bed probe + #define HAS_X_MIN (PIN_EXISTS(X_MIN) && !IS_X2_ENDSTOP(X,MIN) && !IS_Y2_ENDSTOP(X,MIN) && !IS_Z2_OR_PROBE(X,MIN)) + #define HAS_X_MAX (PIN_EXISTS(X_MAX) && !IS_X2_ENDSTOP(X,MAX) && !IS_Y2_ENDSTOP(X,MAX) && !IS_Z2_OR_PROBE(X,MAX)) + #define HAS_Y_MIN (PIN_EXISTS(Y_MIN) && !IS_X2_ENDSTOP(Y,MIN) && !IS_Y2_ENDSTOP(Y,MIN) && !IS_Z2_OR_PROBE(Y,MIN)) + #define HAS_Y_MAX (PIN_EXISTS(Y_MAX) && !IS_X2_ENDSTOP(Y,MAX) && !IS_Y2_ENDSTOP(Y,MAX) && !IS_Z2_OR_PROBE(Y,MAX)) + #define HAS_Z_MIN (PIN_EXISTS(Z_MIN) && !IS_X2_ENDSTOP(Z,MIN) && !IS_Y2_ENDSTOP(Z,MIN) && !IS_Z2_OR_PROBE(Z,MIN)) + #define HAS_Z_MAX (PIN_EXISTS(Z_MAX) && !IS_X2_ENDSTOP(Z,MAX) && !IS_Y2_ENDSTOP(Z,MAX) && !IS_Z2_OR_PROBE(Z,MAX)) + #define HAS_X2_MIN (PIN_EXISTS(X2_MIN)) + #define HAS_X2_MAX (PIN_EXISTS(X2_MAX)) + #define HAS_Y2_MIN (PIN_EXISTS(Y2_MIN)) + #define HAS_Y2_MAX (PIN_EXISTS(Y2_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)) + + // Thermistors + #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_4 (PIN_EXISTS(TEMP_4) && TEMP_SENSOR_4 != 0 && TEMP_SENSOR_4 > -2) + #define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675)) + #define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2) + + // Heaters + #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_4 (PIN_EXISTS(HEATER_4)) + #define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED)) + + // Thermal protection + #define HAS_THERMALLY_PROTECTED_BED (ENABLED(THERMAL_PROTECTION_BED) && HAS_TEMP_BED && HAS_HEATER_BED) + #define WATCH_HOTENDS (ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0) + #define WATCH_THE_BED (HAS_THERMALLY_PROTECTED_BED && WATCH_BED_TEMP_PERIOD > 0) + + // Auto fans + #define HAS_AUTO_FAN_0 (PIN_EXISTS(E0_AUTO_FAN)) + #define HAS_AUTO_FAN_1 (HOTENDS > 1 && PIN_EXISTS(E1_AUTO_FAN)) + #define HAS_AUTO_FAN_2 (HOTENDS > 2 && PIN_EXISTS(E2_AUTO_FAN)) + #define HAS_AUTO_FAN_3 (HOTENDS > 3 && PIN_EXISTS(E3_AUTO_FAN)) + #define HAS_AUTO_FAN_4 (HOTENDS > 4 && PIN_EXISTS(E4_AUTO_FAN)) + #define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3) + #define AUTO_1_IS_0 (E1_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) + #define AUTO_2_IS_0 (E2_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) + #define AUTO_2_IS_1 (E2_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) + #define AUTO_3_IS_0 (E3_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) + #define AUTO_3_IS_1 (E3_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) + #define AUTO_3_IS_2 (E3_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) + #define AUTO_4_IS_0 (E4_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) + #define AUTO_4_IS_1 (E4_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) + #define AUTO_4_IS_2 (E4_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) + #define AUTO_4_IS_3 (E4_AUTO_FAN_PIN == E3_AUTO_FAN_PIN) + + // Other fans + #define HAS_FAN0 (PIN_EXISTS(FAN)) + #define HAS_FAN1 (PIN_EXISTS(FAN1) && CONTROLLER_FAN_PIN != FAN1_PIN && E0_AUTO_FAN_PIN != FAN1_PIN && E1_AUTO_FAN_PIN != FAN1_PIN && E2_AUTO_FAN_PIN != FAN1_PIN && E3_AUTO_FAN_PIN != FAN1_PIN) + #define HAS_FAN2 (PIN_EXISTS(FAN2) && CONTROLLER_FAN_PIN != FAN2_PIN && E0_AUTO_FAN_PIN != FAN2_PIN && E1_AUTO_FAN_PIN != FAN2_PIN && E2_AUTO_FAN_PIN != FAN2_PIN && E3_AUTO_FAN_PIN != FAN2_PIN) + #define HAS_CONTROLLER_FAN (PIN_EXISTS(CONTROLLER_FAN)) + + // Servos + #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)) + + // Sensors + #define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH)) + #define HAS_FIL_RUNOUT (PIN_EXISTS(FIL_RUNOUT)) + + // User Interface + #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_BUZZER (PIN_EXISTS(BEEPER) || ENABLED(LCD_USE_I2C_BUZZER)) + #define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT) && ENABLED(CASE_LIGHT_ENABLE)) + + // Digital control + #define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS) + #define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET)) + #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) + #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E)) + + /** + * This setting is also 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) + #if HOTENDS > 4 + #define WRITE_HEATER_4(v) WRITE(HEATER_4_PIN, v) + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 + #if ENABLED(HEATERS_PARALLEL) + #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); } #else - #if Z2_USE_ENDSTOP == _XMIN_ - #define Z2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Z2_MIN_PIN X_MIN_PIN - #elif Z2_USE_ENDSTOP == _XMAX_ - #define Z2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Z2_MIN_PIN X_MAX_PIN - #elif Z2_USE_ENDSTOP == _YMIN_ - #define Z2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Z2_MIN_PIN Y_MIN_PIN - #elif Z2_USE_ENDSTOP == _YMAX_ - #define Z2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Z2_MIN_PIN Y_MAX_PIN - #elif Z2_USE_ENDSTOP == _ZMIN_ - #define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Z2_MIN_PIN Z_MIN_PIN - #elif Z2_USE_ENDSTOP == _ZMAX_ - #define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Z2_MIN_PIN Z_MAX_PIN + #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v) + #endif + + /** + * Heated bed requires settings + */ + #if HAS_HEATER_BED + #ifndef MAX_BED_POWER + #define MAX_BED_POWER 255 + #endif + #ifndef HEATER_BED_INVERTING + #define HEATER_BED_INVERTING false + #endif + #define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, (v) ^ HEATER_BED_INVERTING) + #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) + + /** + * Part Cooling fan multipliexer + */ + #define HAS_FANMUX PIN_EXISTS(FANMUX0) + + /** + * Servos and probes + */ + + #if HAS_SERVOS + #ifndef Z_ENDSTOP_SERVO_NR + #define Z_ENDSTOP_SERVO_NR -1 + #endif + #endif + + #define HAS_BED_PROBE (PROBE_SELECTED && DISABLED(PROBE_MANUALLY)) + + #if ENABLED(Z_PROBE_ALLEN_KEY) + #define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST + #endif + + /** + * Bed Probe dependencies + */ + #if HAS_BED_PROBE + #if ENABLED(ENDSTOPPULLUPS) && HAS_Z_MIN_PROBE_PIN + #define ENDSTOPPULLUP_ZMIN_PROBE + #endif + #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_CLEARANCE_BETWEEN_PROBES > Z_CLEARANCE_DEPLOY_PROBE + #define _Z_CLEARANCE_DEPLOY_PROBE Z_CLEARANCE_BETWEEN_PROBES #else - #define Z2_MIN_ENDSTOP_INVERTING false + #define _Z_CLEARANCE_DEPLOY_PROBE Z_CLEARANCE_DEPLOY_PROBE #endif - #define Z2_MAX_ENDSTOP_INVERTING false + #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 -#endif -// Is an endstop plug used for the Z2 endstop or the bed probe? -#define IS_Z2_OR_PROBE(A,M) ( \ - (ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP == _##A##M##_) \ - || (ENABLED(Z_MIN_PROBE_ENDSTOP) && Z_MIN_PROBE_PIN == A##_##M##_PIN ) ) + /** + * XYZ Bed Skew Correction + */ + #if ENABLED(SKEW_CORRECTION) + #define SKEW_FACTOR_MIN -1 + #define SKEW_FACTOR_MAX 1 -/** - * Set ENDSTOPPULLUPS for active 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 -#endif + #define _GET_SIDE(a,b,c) (SQRT(2*sq(a)+2*sq(b)-4*sq(c))*0.5) + #define _SKEW_SIDE(a,b,c) tan(M_PI*0.5-acos((sq(a)-sq(b)-sq(c))/(2*c*b))) + #define _SKEW_FACTOR(a,b,c) _SKEW_SIDE(a,_GET_SIDE(a,b,c),c) -/** - * Shorthand for pin tests, used wherever needed - */ - -// Steppers -#define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE)) -#define HAS_X_DIR (PIN_EXISTS(X_DIR)) -#define HAS_X_STEP (PIN_EXISTS(X_STEP)) -#define HAS_X_MICROSTEPS (PIN_EXISTS(X_MS1)) - -#define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE)) -#define HAS_X2_DIR (PIN_EXISTS(X2_DIR)) -#define HAS_X2_STEP (PIN_EXISTS(X2_STEP)) -#define HAS_X2_MICROSTEPS (PIN_EXISTS(X2_MS1)) - -#define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE)) -#define HAS_Y_DIR (PIN_EXISTS(Y_DIR)) -#define HAS_Y_STEP (PIN_EXISTS(Y_STEP)) -#define HAS_Y_MICROSTEPS (PIN_EXISTS(Y_MS1)) - -#define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE)) -#define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR)) -#define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP)) -#define HAS_Y2_MICROSTEPS (PIN_EXISTS(Y2_MS1)) - -#define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE)) -#define HAS_Z_DIR (PIN_EXISTS(Z_DIR)) -#define HAS_Z_STEP (PIN_EXISTS(Z_STEP)) -#define HAS_Z_MICROSTEPS (PIN_EXISTS(Z_MS1)) - -#define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE)) -#define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR)) -#define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP)) -#define HAS_Z2_MICROSTEPS (PIN_EXISTS(Z2_MS1)) - -// Extruder steppers and solenoids -#define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE)) -#define HAS_E0_DIR (PIN_EXISTS(E0_DIR)) -#define HAS_E0_STEP (PIN_EXISTS(E0_STEP)) -#define HAS_E0_MICROSTEPS (PIN_EXISTS(E0_MS1)) -#define HAS_SOLENOID_0 (PIN_EXISTS(SOL0)) - -#define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE)) -#define HAS_E1_DIR (PIN_EXISTS(E1_DIR)) -#define HAS_E1_STEP (PIN_EXISTS(E1_STEP)) -#define HAS_E1_MICROSTEPS (PIN_EXISTS(E1_MS1)) -#define HAS_SOLENOID_1 (PIN_EXISTS(SOL1)) - -#define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE)) -#define HAS_E2_DIR (PIN_EXISTS(E2_DIR)) -#define HAS_E2_STEP (PIN_EXISTS(E2_STEP)) -#define HAS_E2_MICROSTEPS (PIN_EXISTS(E2_MS1)) -#define HAS_SOLENOID_2 (PIN_EXISTS(SOL2)) - -#define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE)) -#define HAS_E3_DIR (PIN_EXISTS(E3_DIR)) -#define HAS_E3_STEP (PIN_EXISTS(E3_STEP)) -#define HAS_E3_MICROSTEPS (PIN_EXISTS(E3_MS1)) -#define HAS_SOLENOID_3 (PIN_EXISTS(SOL3)) - -#define HAS_E4_ENABLE (PIN_EXISTS(E4_ENABLE)) -#define HAS_E4_DIR (PIN_EXISTS(E4_DIR)) -#define HAS_E4_STEP (PIN_EXISTS(E4_STEP)) -#define HAS_E4_MICROSTEPS (PIN_EXISTS(E4_MS1)) -#define HAS_SOLENOID_4 (PIN_EXISTS(SOL4)) - -#if ENABLED(HANGPRINTER) - #define HAS_A_ENABLE (PIN_EXISTS(A_ENABLE)) - #define HAS_A_DIR (PIN_EXISTS(A_DIR)) - #define HAS_A_STEP (PIN_EXISTS(A_STEP)) - #define HAS_A_MICROSTEPS (PIN_EXISTS(A_MS1)) - - #define HAS_B_ENABLE (PIN_EXISTS(B_ENABLE)) - #define HAS_B_DIR (PIN_EXISTS(B_DIR)) - #define HAS_B_STEP (PIN_EXISTS(B_STEP)) - #define HAS_B_MICROSTEPS (PIN_EXISTS(B_MS1)) - - #define HAS_C_ENABLE (PIN_EXISTS(C_ENABLE)) - #define HAS_C_DIR (PIN_EXISTS(C_DIR)) - #define HAS_C_STEP (PIN_EXISTS(C_STEP)) - #define HAS_C_MICROSTEPS (PIN_EXISTS(C_MS1)) - - #define HAS_D_ENABLE (PIN_EXISTS(D_ENABLE)) - #define HAS_D_DIR (PIN_EXISTS(D_DIR)) - #define HAS_D_STEP (PIN_EXISTS(D_STEP)) - #define HAS_D_MICROSTEPS (PIN_EXISTS(D_MS1)) -#endif - -// Trinamic Stepper Drivers -#define HAS_STEALTHCHOP (HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2208)) -#define HAS_STALLGUARD HAS_DRIVER(TMC2130) -#define AXIS_HAS_STEALTHCHOP(ST) ( AXIS_DRIVER_TYPE(ST, TMC2130) || AXIS_DRIVER_TYPE(ST, TMC2208) ) -#define AXIS_HAS_STALLGUARD(ST) AXIS_DRIVER_TYPE(ST, TMC2130) - -#if ENABLED(SENSORLESS_HOMING) - // Disable Z axis sensorless homing if a probe is used to home the Z axis - #if HOMING_Z_WITH_PROBE - #undef Z_HOMING_SENSITIVITY - #endif - #define X_SENSORLESS (AXIS_HAS_STALLGUARD(X) && defined(X_HOMING_SENSITIVITY)) - #define Y_SENSORLESS (AXIS_HAS_STALLGUARD(Y) && defined(Y_HOMING_SENSITIVITY)) - #define Z_SENSORLESS (AXIS_HAS_STALLGUARD(Z) && defined(Z_HOMING_SENSITIVITY)) -#endif - -// Endstops and bed probe -#define HAS_STOP_TEST(A,M) (PIN_EXISTS(A##_##M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_OR_PROBE(A,M)) -#define HAS_X_MIN HAS_STOP_TEST(X,MIN) -#define HAS_X_MAX HAS_STOP_TEST(X,MAX) -#define HAS_Y_MIN HAS_STOP_TEST(Y,MIN) -#define HAS_Y_MAX HAS_STOP_TEST(Y,MAX) -#define HAS_Z_MIN HAS_STOP_TEST(Z,MIN) -#define HAS_Z_MAX HAS_STOP_TEST(Z,MAX) -#define HAS_X2_MIN (PIN_EXISTS(X2_MIN)) -#define HAS_X2_MAX (PIN_EXISTS(X2_MAX)) -#define HAS_Y2_MIN (PIN_EXISTS(Y2_MIN)) -#define HAS_Y2_MAX (PIN_EXISTS(Y2_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)) - -// ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface) -#define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && DISABLED(HEATER_##P##_USES_MAX6675)) -#define HAS_TEMP_ADC_0 HAS_ADC_TEST(0) -#define HAS_TEMP_ADC_1 HAS_ADC_TEST(1) -#define HAS_TEMP_ADC_2 HAS_ADC_TEST(2) -#define HAS_TEMP_ADC_3 HAS_ADC_TEST(3) -#define HAS_TEMP_ADC_4 HAS_ADC_TEST(4) -#define HAS_TEMP_ADC_BED HAS_ADC_TEST(BED) -#define HAS_TEMP_ADC_CHAMBER HAS_ADC_TEST(CHAMBER) - -#define HAS_TEMP_HOTEND (HAS_TEMP_ADC_0 || ENABLED(HEATER_0_USES_MAX6675)) -#define HAS_TEMP_BED HAS_TEMP_ADC_BED -#define HAS_TEMP_CHAMBER HAS_TEMP_ADC_CHAMBER - -// Heaters -#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_4 (PIN_EXISTS(HEATER_4)) -#define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED)) - -// Shorthand for common combinations -#define HAS_HEATED_BED (HAS_TEMP_BED && HAS_HEATER_BED) -#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_TEMP_CHAMBER) - -// PID heating -#if !HAS_HEATED_BED - #undef PIDTEMPBED -#endif -#define HAS_PID_HEATING (ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED)) -#define HAS_PID_FOR_BOTH (ENABLED(PIDTEMP) && ENABLED(PIDTEMPBED)) - -// Thermal protection -#define HAS_THERMALLY_PROTECTED_BED (HAS_HEATED_BED && ENABLED(THERMAL_PROTECTION_BED)) -#define WATCH_HOTENDS (ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0) -#define WATCH_THE_BED (HAS_THERMALLY_PROTECTED_BED && WATCH_BED_TEMP_PERIOD > 0) - -// Auto fans -#define HAS_AUTO_FAN_0 (PIN_EXISTS(E0_AUTO_FAN)) -#define HAS_AUTO_FAN_1 (HOTENDS > 1 && PIN_EXISTS(E1_AUTO_FAN)) -#define HAS_AUTO_FAN_2 (HOTENDS > 2 && PIN_EXISTS(E2_AUTO_FAN)) -#define HAS_AUTO_FAN_3 (HOTENDS > 3 && PIN_EXISTS(E3_AUTO_FAN)) -#define HAS_AUTO_FAN_4 (HOTENDS > 4 && PIN_EXISTS(E4_AUTO_FAN)) -#define HAS_AUTO_CHAMBER_FAN (PIN_EXISTS(CHAMBER_AUTO_FAN)) -#define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3 || HAS_AUTO_CHAMBER_FAN) -#define AUTO_1_IS_0 (E1_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_2_IS_0 (E2_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_2_IS_1 (E2_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) -#define AUTO_3_IS_0 (E3_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_3_IS_1 (E3_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) -#define AUTO_3_IS_2 (E3_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) -#define AUTO_4_IS_0 (E4_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_4_IS_1 (E4_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) -#define AUTO_4_IS_2 (E4_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) -#define AUTO_4_IS_3 (E4_AUTO_FAN_PIN == E3_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_0 (CHAMBER_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_1 (CHAMBER_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_2 (CHAMBER_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_3 (CHAMBER_AUTO_FAN_PIN == E3_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_4 (CHAMBER_AUTO_FAN_PIN == E4_AUTO_FAN_PIN) - -// Other fans -#define HAS_FAN0 (PIN_EXISTS(FAN)) -#define HAS_FAN1 (PIN_EXISTS(FAN1) && CONTROLLER_FAN_PIN != FAN1_PIN && E0_AUTO_FAN_PIN != FAN1_PIN && E1_AUTO_FAN_PIN != FAN1_PIN && E2_AUTO_FAN_PIN != FAN1_PIN && E3_AUTO_FAN_PIN != FAN1_PIN) -#define HAS_FAN2 (PIN_EXISTS(FAN2) && CONTROLLER_FAN_PIN != FAN2_PIN && E0_AUTO_FAN_PIN != FAN2_PIN && E1_AUTO_FAN_PIN != FAN2_PIN && E2_AUTO_FAN_PIN != FAN2_PIN && E3_AUTO_FAN_PIN != FAN2_PIN) -#define HAS_CONTROLLER_FAN (PIN_EXISTS(CONTROLLER_FAN)) - -// Servos -#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_SERVOS (defined(NUM_SERVOS) && NUM_SERVOS > 0 && (HAS_SERVO_0 || HAS_SERVO_1 || HAS_SERVO_2 || HAS_SERVO_3)) - -#if HAS_SERVOS && !defined(Z_PROBE_SERVO_NR) - #define Z_PROBE_SERVO_NR -1 -#endif - -// Sensors -#define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH)) - -// User Interface -#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_BUZZER (PIN_EXISTS(BEEPER) || ENABLED(LCD_USE_I2C_BUZZER)) -#define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT) && ENABLED(CASE_LIGHT_ENABLE)) - -// Digital control -#define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS) -#define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET)) -#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) -#define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E)) - -#if !HAS_TEMP_SENSOR - #undef AUTO_REPORT_TEMPERATURES -#endif - -#define HAS_AUTO_REPORTING (ENABLED(AUTO_REPORT_TEMPERATURES) || ENABLED(AUTO_REPORT_SD_STATUS)) - -/** - * This setting is also 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) - #if HOTENDS > 4 - #define WRITE_HEATER_4(v) WRITE(HEATER_4_PIN, v) - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 -#endif // HOTENDS > 1 -#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 - -/** - * Heated bed requires settings - */ -#if HAS_HEATED_BED - #ifndef MAX_BED_POWER - #define MAX_BED_POWER 255 - #endif - #ifndef HEATER_BED_INVERTING - #define HEATER_BED_INVERTING false - #endif - #define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, (v) ^ HEATER_BED_INVERTING) -#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) - -/** - * Part Cooling fan multipliexer - */ -#define HAS_FANMUX PIN_EXISTS(FANMUX0) - -/** - * MIN/MAX fan PWM scaling - */ -#ifndef FAN_MIN_PWM - #define FAN_MIN_PWM 0 -#endif -#ifndef FAN_MAX_PWM - #define FAN_MAX_PWM 255 -#endif -#if FAN_MIN_PWM < 0 || FAN_MIN_PWM > 255 - #error "FAN_MIN_PWM must be a value from 0 to 255." -#elif FAN_MAX_PWM < 0 || FAN_MAX_PWM > 255 - #error "FAN_MAX_PWM must be a value from 0 to 255." -#elif FAN_MIN_PWM > FAN_MAX_PWM - #error "FAN_MIN_PWM must be less than or equal to FAN_MAX_PWM." -#endif - -/** - * Bed Probe dependencies - */ -#if HAS_BED_PROBE - #if ENABLED(ENDSTOPPULLUPS) && HAS_Z_MIN_PROBE_PIN - #define ENDSTOPPULLUP_ZMIN_PROBE - #endif - #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 + #ifndef XY_SKEW_FACTOR + constexpr float XY_SKEW_FACTOR = ( + #if defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD) + _SKEW_FACTOR(XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD) + #else + 0.0 + #endif + ); #endif - #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 - -/** - * XYZ Bed Skew Correction - */ -#if ENABLED(SKEW_CORRECTION) - #define SKEW_FACTOR_MIN -1 - #define SKEW_FACTOR_MAX 1 - - #define _GET_SIDE(a,b,c) (SQRT(2*sq(a)+2*sq(b)-4*sq(c))*0.5) - #define _SKEW_SIDE(a,b,c) tan(M_PI*0.5-acos((sq(a)-sq(b)-sq(c))/(2*c*b))) - #define _SKEW_FACTOR(a,b,c) _SKEW_SIDE(float(a),_GET_SIDE(float(a),float(b),float(c)),float(c)) - - #ifndef XY_SKEW_FACTOR - constexpr float XY_SKEW_FACTOR = ( - #if defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD) - _SKEW_FACTOR(XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD) - #else - 0.0 + #ifndef XZ_SKEW_FACTOR + #if defined(XY_SIDE_AD) && !defined(XZ_SIDE_AD) + #define XZ_SIDE_AD XY_SIDE_AD #endif - ); - #endif - #ifndef XZ_SKEW_FACTOR - #if defined(XY_SIDE_AD) && !defined(XZ_SIDE_AD) - #define XZ_SIDE_AD XY_SIDE_AD + constexpr float XZ_SKEW_FACTOR = ( + #if defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD) + _SKEW_FACTOR(XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD) + #else + 0.0 + #endif + ); #endif - constexpr float XZ_SKEW_FACTOR = ( - #if defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD) - _SKEW_FACTOR(XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD) - #else - 0.0 - #endif - ); + #ifndef YZ_SKEW_FACTOR + constexpr float YZ_SKEW_FACTOR = ( + #if defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD) + _SKEW_FACTOR(YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD) + #else + 0.0 + #endif + ); + #endif + #endif // SKEW_CORRECTION + + /** + * Heater & Fan Pausing + */ + #if FAN_COUNT == 0 + #undef PROBING_FANS_OFF #endif - #ifndef YZ_SKEW_FACTOR - constexpr float YZ_SKEW_FACTOR = ( - #if defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD) - _SKEW_FACTOR(YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD) - #else - 0.0 - #endif - ); + #define QUIET_PROBING (HAS_BED_PROBE && (ENABLED(PROBING_HEATERS_OFF) || ENABLED(PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0)) + #define HEATER_IDLE_HANDLER (ENABLED(ADVANCED_PAUSE_FEATURE) || ENABLED(PROBING_HEATERS_OFF)) + + /** + * Only constrain Z on DELTA / SCARA machines + */ + #if IS_KINEMATIC + #undef MIN_SOFTWARE_ENDSTOP_X + #undef MIN_SOFTWARE_ENDSTOP_Y + #undef MAX_SOFTWARE_ENDSTOP_X + #undef MAX_SOFTWARE_ENDSTOP_Y #endif -#endif // SKEW_CORRECTION -/** - * Set granular options based on the specific type of leveling - */ -#define UBL_SEGMENTED (ENABLED(AUTO_BED_LEVELING_UBL) && (ENABLED(DELTA))) -#define ABL_PLANAR (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT)) -#define ABL_GRID (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)) -#define OLDSCHOOL_ABL (ABL_PLANAR || ABL_GRID) -#define HAS_ABL (OLDSCHOOL_ABL || ENABLED(AUTO_BED_LEVELING_UBL)) -#define HAS_LEVELING (HAS_ABL || ENABLED(MESH_BED_LEVELING)) -#define HAS_AUTOLEVEL (HAS_ABL && DISABLED(PROBE_MANUALLY)) -#define HAS_MESH (ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(MESH_BED_LEVELING)) -#define PLANNER_LEVELING (OLDSCHOOL_ABL || ENABLED(MESH_BED_LEVELING) || UBL_SEGMENTED || ENABLED(SKEW_CORRECTION)) -#define HAS_PROBING_PROCEDURE (HAS_ABL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)) -#define HAS_UBL_AND_CURVES (ENABLED(AUTO_BED_LEVELING_UBL) && !PLANNER_LEVELING && (ENABLED(ARC_SUPPORT) || ENABLED(BEZIER_CURVE_SUPPORT))) -#define HAS_FEEDRATE_SCALING (ENABLED(SCARA_FEEDRATE_SCALING) || ENABLED(DELTA_FEEDRATE_SCALING)) - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #undef LCD_BED_LEVELING -#endif - -/** - * Heater & Fan Pausing - */ -#if FAN_COUNT == 0 - #undef PROBING_FANS_OFF -#endif -#define QUIET_PROBING (HAS_BED_PROBE && (ENABLED(PROBING_HEATERS_OFF) || ENABLED(PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0)) -#define HEATER_IDLE_HANDLER (ENABLED(ADVANCED_PAUSE_FEATURE) || ENABLED(PROBING_HEATERS_OFF)) - -#if ENABLED(ADVANCED_PAUSE_FEATURE) && !defined(FILAMENT_CHANGE_SLOW_LOAD_LENGTH) - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 -#endif - -/** - * Only constrain Z on DELTA / SCARA machines - */ -#if IS_KINEMATIC - #undef MIN_SOFTWARE_ENDSTOP_X - #undef MIN_SOFTWARE_ENDSTOP_Y - #undef MAX_SOFTWARE_ENDSTOP_X - #undef MAX_SOFTWARE_ENDSTOP_Y -#endif - -/** - * Bed Probing rectangular bounds - * These can be further constrained in code for Delta and SCARA - */ - -#ifndef MIN_PROBE_EDGE - #define MIN_PROBE_EDGE 0 -#endif - -#if ENABLED(DELTA) /** * Delta radius/rod trimmers/angle trimmers */ - #define _PROBE_RADIUS (DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - #ifndef DELTA_CALIBRATION_RADIUS - #ifdef X_PROBE_OFFSET_FROM_EXTRUDER - #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - MAX3(abs(X_PROBE_OFFSET_FROM_EXTRUDER), abs(Y_PROBE_OFFSET_FROM_EXTRUDER), abs(MIN_PROBE_EDGE))) - #else - #define DELTA_CALIBRATION_RADIUS _PROBE_RADIUS + #if ENABLED(DELTA) + #ifndef DELTA_PROBEABLE_RADIUS + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS + #endif + #ifndef DELTA_CALIBRATION_RADIUS + #define DELTA_CALIBRATION_RADIUS DELTA_PRINTABLE_RADIUS - 10 + #endif + #ifndef DELTA_ENDSTOP_ADJ + #define DELTA_ENDSTOP_ADJ { 0, 0, 0 } + #endif + #ifndef DELTA_TOWER_ANGLE_TRIM + #define DELTA_TOWER_ANGLE_TRIM {0, 0, 0} + #endif + #ifndef DELTA_RADIUS_TRIM_TOWER + #define DELTA_RADIUS_TRIM_TOWER {0, 0, 0} + #endif + #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER + #define DELTA_DIAGONAL_ROD_TRIM_TOWER {0, 0, 0} #endif #endif - #ifndef DELTA_ENDSTOP_ADJ - #define DELTA_ENDSTOP_ADJ { 0, 0, 0 } - #endif - #ifndef DELTA_TOWER_ANGLE_TRIM - #define DELTA_TOWER_ANGLE_TRIM {0, 0, 0} - #endif - #ifndef DELTA_RADIUS_TRIM_TOWER - #define DELTA_RADIUS_TRIM_TOWER {0, 0, 0} - #endif - #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER - #define DELTA_DIAGONAL_ROD_TRIM_TOWER {0, 0, 0} + + /** + * Set granular options based on the specific type of leveling + */ + #define UBL_SEGMENTED (ENABLED(AUTO_BED_LEVELING_UBL) && (ENABLED(DELTA) || ENABLED(SEGMENT_LEVELED_MOVES))) + #define ABL_PLANAR (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT)) + #define ABL_GRID (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)) + #define OLDSCHOOL_ABL (ABL_PLANAR || ABL_GRID) + #define HAS_ABL (OLDSCHOOL_ABL || ENABLED(AUTO_BED_LEVELING_UBL)) + #define HAS_LEVELING (HAS_ABL || ENABLED(MESH_BED_LEVELING)) + #define HAS_AUTOLEVEL (HAS_ABL && DISABLED(PROBE_MANUALLY)) + #define HAS_MESH (ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(MESH_BED_LEVELING)) + #define PLANNER_LEVELING (OLDSCHOOL_ABL || ENABLED(MESH_BED_LEVELING) || UBL_SEGMENTED || ENABLED(SKEW_CORRECTION)) + #define HAS_PROBING_PROCEDURE (HAS_ABL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)) + #if HAS_PROBING_PROCEDURE + #define PROBE_BED_WIDTH abs(RIGHT_PROBE_BED_POSITION - (LEFT_PROBE_BED_POSITION)) + #define PROBE_BED_HEIGHT abs(BACK_PROBE_BED_POSITION - (FRONT_PROBE_BED_POSITION)) #endif - // Probing points may be verified at compile time within the radius - // using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(DELTA_PRINTABLE_RADIUS),"bad probe point!") - // so that may be added to SanityCheck.h in the future. - #define _MIN_PROBE_X (X_CENTER - (_PROBE_RADIUS)) - #define _MIN_PROBE_Y (Y_CENTER - (_PROBE_RADIUS)) - #define _MAX_PROBE_X (X_CENTER + _PROBE_RADIUS) - #define _MAX_PROBE_Y (Y_CENTER + _PROBE_RADIUS) + #if ENABLED(SEGMENT_LEVELED_MOVES) && !defined(LEVELED_SEGMENT_LENGTH) + #define LEVELED_SEGMENT_LENGTH 5 + #endif -#elif IS_SCARA - - #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) - #define _PROBE_RADIUS (SCARA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - #define _MIN_PROBE_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MIN_PROBE_EDGE) - #define _MIN_PROBE_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MIN_PROBE_EDGE) - #define _MAX_PROBE_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - #define _MAX_PROBE_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - -#else - - // Boundaries for Cartesian probing based on bed limits - #define _MIN_PROBE_X (max(X_MIN_BED + MIN_PROBE_EDGE, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) - #define _MIN_PROBE_Y (max(Y_MIN_BED + MIN_PROBE_EDGE, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) - #define _MAX_PROBE_X (min(X_MAX_BED - (MIN_PROBE_EDGE), X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) - #define _MAX_PROBE_Y (min(Y_MAX_BED - (MIN_PROBE_EDGE), Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) - -#endif - -#if ENABLED(SEGMENT_LEVELED_MOVES) && !defined(LEVELED_SEGMENT_LENGTH) - #define LEVELED_SEGMENT_LENGTH 5 -#endif - -// These may be overridden in Configuration.h if a smaller area is desired -#ifndef MIN_PROBE_X - #define MIN_PROBE_X _MIN_PROBE_X -#endif -#ifndef MIN_PROBE_Y - #define MIN_PROBE_Y _MIN_PROBE_Y -#endif -#ifndef MAX_PROBE_X - #define MAX_PROBE_X _MAX_PROBE_X -#endif -#ifndef MAX_PROBE_Y - #define MAX_PROBE_Y _MAX_PROBE_Y -#endif - -/** - * Default mesh area is an area with an inset margin on the print area. - */ -#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) - #if IS_KINEMATIC + /** + * Bed Probing rectangular bounds + * These can be further constrained in code for Delta and SCARA + */ + #if ENABLED(DELTA) // Probing points may be verified at compile time within the radius // using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(DELTA_PRINTABLE_RADIUS),"bad probe point!") // so that may be added to SanityCheck.h in the future. - #define _MESH_MIN_X (X_MIN_BED + MESH_INSET) - #define _MESH_MIN_Y (Y_MIN_BED + MESH_INSET) - #define _MESH_MAX_X (X_MAX_BED - (MESH_INSET)) - #define _MESH_MAX_Y (Y_MAX_BED - (MESH_INSET)) + #define _MIN_PROBE_X (X_CENTER - DELTA_PRINTABLE_RADIUS) + #define _MIN_PROBE_Y (Y_CENTER - DELTA_PRINTABLE_RADIUS) + #define _MAX_PROBE_X (X_CENTER + DELTA_PRINTABLE_RADIUS) + #define _MAX_PROBE_Y (Y_CENTER + DELTA_PRINTABLE_RADIUS) + #elif IS_SCARA + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) + #define _MIN_PROBE_X (X_CENTER - (SCARA_PRINTABLE_RADIUS)) + #define _MIN_PROBE_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS)) + #define _MAX_PROBE_X (X_CENTER + SCARA_PRINTABLE_RADIUS) + #define _MAX_PROBE_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS) #else - // Boundaries for Cartesian probing based on set limits - #if ENABLED(AUTO_BED_LEVELING_UBL) - #define _MESH_MIN_X (max(X_MIN_BED + MESH_INSET, X_MIN_POS)) // UBL is careful not to probe off the bed. It does not - #define _MESH_MIN_Y (max(Y_MIN_BED + MESH_INSET, Y_MIN_POS)) // need *_PROBE_OFFSET_FROM_EXTRUDER in the mesh dimensions - #define _MESH_MAX_X (min(X_MAX_BED - (MESH_INSET), X_MAX_POS)) - #define _MESH_MAX_Y (min(Y_MAX_BED - (MESH_INSET), Y_MAX_POS)) + // Boundaries for Cartesian probing based on bed limits + #define _MIN_PROBE_X (max(X_MIN_BED, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) + #define _MIN_PROBE_Y (max(Y_MIN_BED, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) + #define _MAX_PROBE_X (min(X_MAX_BED, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) + #define _MAX_PROBE_Y (min(Y_MAX_BED, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) + #endif + + // Allow configuration to override these for special purposes + #ifndef MIN_PROBE_X + #define MIN_PROBE_X _MIN_PROBE_X + #endif + #ifndef MIN_PROBE_Y + #define MIN_PROBE_Y _MIN_PROBE_Y + #endif + #ifndef MAX_PROBE_X + #define MAX_PROBE_X _MAX_PROBE_X + #endif + #ifndef MAX_PROBE_Y + #define MAX_PROBE_Y _MAX_PROBE_Y + #endif + + /** + * Default mesh area is an area with an inset margin on the print area. + */ + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) + #if IS_KINEMATIC + // Probing points may be verified at compile time within the radius + // using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(DELTA_PRINTABLE_RADIUS),"bad probe point!") + // so that may be added to SanityCheck.h in the future. + #define _MESH_MIN_X (MIN_PROBE_X + MESH_INSET) + #define _MESH_MIN_Y (MIN_PROBE_Y + MESH_INSET) + #define _MESH_MAX_X (MAX_PROBE_X - (MESH_INSET)) + #define _MESH_MAX_Y (MAX_PROBE_Y - (MESH_INSET)) #else + // Boundaries for Cartesian probing based on set limits #define _MESH_MIN_X (max(X_MIN_BED + MESH_INSET, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) #define _MESH_MIN_Y (max(Y_MIN_BED + MESH_INSET, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) #define _MESH_MAX_X (min(X_MAX_BED - (MESH_INSET), X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) #define _MESH_MAX_Y (min(Y_MAX_BED - (MESH_INSET), Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) #endif - #endif + /** + * These may be overridden in Configuration if a smaller area is wanted + */ + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) + #ifndef MESH_MIN_X + #define MESH_MIN_X _MESH_MIN_X + #endif + #ifndef MESH_MIN_Y + #define MESH_MIN_Y _MESH_MIN_Y + #endif + #ifndef MESH_MAX_X + #define MESH_MAX_X _MESH_MAX_X + #endif + #ifndef MESH_MAX_Y + #define MESH_MAX_Y _MESH_MAX_Y + #endif + #endif + #endif // MESH_BED_LEVELING || AUTO_BED_LEVELING_UBL - // These may be overridden in Configuration.h if a smaller area is desired - #ifndef MESH_MIN_X - #define MESH_MIN_X _MESH_MIN_X - #endif - #ifndef MESH_MIN_Y - #define MESH_MIN_Y _MESH_MIN_Y - #endif - #ifndef MESH_MAX_X - #define MESH_MAX_X _MESH_MAX_X - #endif - #ifndef MESH_MAX_Y - #define MESH_MAX_Y _MESH_MAX_Y - #endif - -#endif // MESH_BED_LEVELING || AUTO_BED_LEVELING_UBL - -#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_3POINT) - #if IS_KINEMATIC - #define SIN0 0.0 - #define SIN120 0.866025 - #define SIN240 -0.866025 - #define COS0 1.0 - #define COS120 -0.5 - #define COS240 -0.5 - #ifndef PROBE_PT_1_X - #define PROBE_PT_1_X (X_CENTER + (_PROBE_RADIUS) * COS0) + /** + * Buzzer/Speaker + */ + #if ENABLED(LCD_USE_I2C_BUZZER) + #ifndef LCD_FEEDBACK_FREQUENCY_HZ + #define LCD_FEEDBACK_FREQUENCY_HZ 1000 #endif - #ifndef PROBE_PT_1_Y - #define PROBE_PT_1_Y (Y_CENTER + (_PROBE_RADIUS) * SIN0) - #endif - #ifndef PROBE_PT_2_X - #define PROBE_PT_2_X (X_CENTER + (_PROBE_RADIUS) * COS120) - #endif - #ifndef PROBE_PT_2_Y - #define PROBE_PT_2_Y (Y_CENTER + (_PROBE_RADIUS) * SIN120) - #endif - #ifndef PROBE_PT_3_X - #define PROBE_PT_3_X (X_CENTER + (_PROBE_RADIUS) * COS240) - #endif - #ifndef PROBE_PT_3_Y - #define PROBE_PT_3_Y (Y_CENTER + (_PROBE_RADIUS) * SIN240) + #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS + #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 #endif #else - #ifndef PROBE_PT_1_X - #define PROBE_PT_1_X MIN_PROBE_X + #ifndef LCD_FEEDBACK_FREQUENCY_HZ + #define LCD_FEEDBACK_FREQUENCY_HZ 5000 #endif - #ifndef PROBE_PT_1_Y - #define PROBE_PT_1_Y MIN_PROBE_Y - #endif - #ifndef PROBE_PT_2_X - #define PROBE_PT_2_X MAX_PROBE_X - #endif - #ifndef PROBE_PT_2_Y - #define PROBE_PT_2_Y MIN_PROBE_Y - #endif - #ifndef PROBE_PT_3_X - #define PROBE_PT_3_X X_CENTER - #endif - #ifndef PROBE_PT_3_Y - #define PROBE_PT_3_Y MAX_PROBE_Y + #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS + #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 #endif #endif -#endif -#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) - #ifndef LEFT_PROBE_BED_POSITION - #define LEFT_PROBE_BED_POSITION MIN_PROBE_X + /** + * VIKI2, miniVIKI, and AZSMZ_12864 require DOGLCD_SCK and DOGLCD_MOSI to be defined. + */ + #if ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(AZSMZ_12864) + #ifndef DOGLCD_SCK + #define DOGLCD_SCK SCK_PIN + #endif + #ifndef DOGLCD_MOSI + #define DOGLCD_MOSI MOSI_PIN + #endif #endif - #ifndef RIGHT_PROBE_BED_POSITION - #define RIGHT_PROBE_BED_POSITION MAX_PROBE_X - #endif - #ifndef FRONT_PROBE_BED_POSITION - #define FRONT_PROBE_BED_POSITION MIN_PROBE_Y - #endif - #ifndef BACK_PROBE_BED_POSITION - #define BACK_PROBE_BED_POSITION MAX_PROBE_Y - #endif -#endif -/** - * Buzzer/Speaker - */ -#if ENABLED(LCD_USE_I2C_BUZZER) - #ifndef LCD_FEEDBACK_FREQUENCY_HZ - #define LCD_FEEDBACK_FREQUENCY_HZ 1000 + /** + * Z_HOMING_HEIGHT / Z_CLEARANCE_BETWEEN_PROBES + */ + #ifndef Z_HOMING_HEIGHT + #ifndef Z_CLEARANCE_BETWEEN_PROBES + #define Z_HOMING_HEIGHT 0 + #else + #define Z_HOMING_HEIGHT Z_CLEARANCE_BETWEEN_PROBES + #endif #endif - #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS - #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 - #endif -#else - #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 -#endif - -/** - * VIKI2, miniVIKI, AZSMZ_12864, and MKS_12864OLED_SSD1306 require DOGLCD_SCK and DOGLCD_MOSI to be defined. - */ -#if ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(AZSMZ_12864) || ENABLED(MKS_12864OLED_SSD1306) - #ifndef DOGLCD_SCK - #define DOGLCD_SCK SCK_PIN - #endif - #ifndef DOGLCD_MOSI - #define DOGLCD_MOSI MOSI_PIN - #endif -#endif - -/** - * Z_HOMING_HEIGHT / Z_CLEARANCE_BETWEEN_PROBES - */ -#ifndef Z_HOMING_HEIGHT - #ifndef Z_CLEARANCE_BETWEEN_PROBES - #define Z_HOMING_HEIGHT 0 - #else - #define Z_HOMING_HEIGHT Z_CLEARANCE_BETWEEN_PROBES - #endif -#endif - -#if PROBE_SELECTED #ifndef Z_CLEARANCE_BETWEEN_PROBES #define Z_CLEARANCE_BETWEEN_PROBES Z_HOMING_HEIGHT #endif @@ -1326,92 +1079,72 @@ #else #define MANUAL_PROBE_HEIGHT Z_HOMING_HEIGHT #endif - #ifndef Z_CLEARANCE_MULTI_PROBE - #define Z_CLEARANCE_MULTI_PROBE Z_CLEARANCE_BETWEEN_PROBES - #endif -#endif -// Updated G92 behavior shifts the workspace -#define HAS_POSITION_SHIFT DISABLED(NO_WORKSPACE_OFFSETS) -// The home offset also shifts the coordinate space -#define HAS_HOME_OFFSET (DISABLED(NO_WORKSPACE_OFFSETS) && DISABLED(DELTA)) -// Either offset yields extra calculations on all moves -#define HAS_WORKSPACE_OFFSET (HAS_POSITION_SHIFT || HAS_HOME_OFFSET) -// M206 doesn't apply to DELTA -#define HAS_M206_COMMAND (HAS_HOME_OFFSET && DISABLED(DELTA)) + // Stepper pulse duration, in cycles + #define STEP_PULSE_CYCLES ((MINIMUM_STEPPER_PULSE) * CYCLES_PER_MICROSECOND) -// LCD timeout to status screen default is 15s -#ifndef LCD_TIMEOUT_TO_STATUS - #define LCD_TIMEOUT_TO_STATUS 15000 -#endif + #if ENABLED(SDCARD_SORT_ALPHA) + #define HAS_FOLDER_SORTING (FOLDER_SORTING || ENABLED(SDSORT_GCODE)) + #endif -// Shorthand -#define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)) + // Updated G92 behavior shifts the workspace + #define HAS_POSITION_SHIFT DISABLED(NO_WORKSPACE_OFFSETS) + // The home offset also shifts the coordinate space + #define HAS_HOME_OFFSET (DISABLED(NO_WORKSPACE_OFFSETS) && DISABLED(DELTA)) + // Either offset yields extra calculations on all moves + #define HAS_WORKSPACE_OFFSET (HAS_POSITION_SHIFT || HAS_HOME_OFFSET) + // M206 doesn't apply to DELTA + #define HAS_M206_COMMAND (HAS_HOME_OFFSET && DISABLED(DELTA)) -// Add commands that need sub-codes to this list -#define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET) || ENABLED(CNC_COORDINATE_SYSTEMS) || ENABLED(POWER_LOSS_RECOVERY) + // LCD timeout to status screen default is 15s + #ifndef LCD_TIMEOUT_TO_STATUS + #define LCD_TIMEOUT_TO_STATUS 15000 + #endif -// Parking Extruder -#if ENABLED(PARKING_EXTRUDER) - #ifndef PARKING_EXTRUDER_GRAB_DISTANCE - #define PARKING_EXTRUDER_GRAB_DISTANCE 0 - #endif - #ifndef PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE - #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE HIGH - #endif -#endif + // Shorthand + #define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)) -// Number of VFAT entries used. Each entry has 13 UTF-16 characters -#if ENABLED(SCROLL_LONG_FILENAMES) - #define MAX_VFAT_ENTRIES (5) -#else - #define MAX_VFAT_ENTRIES (2) -#endif + // Add commands that need sub-codes to this list + #define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET) || ENABLED(CNC_COORDINATE_SYSTEMS) -// Set defaults for unspecified LED user colors -#if ENABLED(LED_CONTROL_MENU) - #ifndef LED_USER_PRESET_RED - #define LED_USER_PRESET_RED 255 - #endif - #ifndef LED_USER_PRESET_GREEN - #define LED_USER_PRESET_GREEN 255 - #endif - #ifndef LED_USER_PRESET_BLUE - #define LED_USER_PRESET_BLUE 255 - #endif - #ifndef LED_USER_PRESET_WHITE - #define LED_USER_PRESET_WHITE 0 - #endif - #ifndef LED_USER_PRESET_BRIGHTNESS - #ifdef NEOPIXEL_BRIGHTNESS - #define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS - #else - #define LED_USER_PRESET_BRIGHTNESS 255 + // Parking Extruder + #if ENABLED(PARKING_EXTRUDER) + #ifndef PARKING_EXTRUDER_GRAB_DISTANCE + #define PARKING_EXTRUDER_GRAB_DISTANCE 0 + #endif + #ifndef PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE HIGH #endif #endif -#endif -// Nozzle park -#if ENABLED(NOZZLE_PARK_FEATURE) && ENABLED(DELTA) - #undef NOZZLE_PARK_Z_FEEDRATE - #define NOZZLE_PARK_Z_FEEDRATE NOZZLE_PARK_XY_FEEDRATE -#endif + // Number of VFAT entries used. Each entry has 13 UTF-16 characters + #if ENABLED(SCROLL_LONG_FILENAMES) + #define MAX_VFAT_ENTRIES (5) + #else + #define MAX_VFAT_ENTRIES (2) + #endif -#if ENABLED(SDCARD_SORT_ALPHA) - #define HAS_FOLDER_SORTING (FOLDER_SORTING || ENABLED(SDSORT_GCODE)) -#endif - -/** - * MOV_AXIS: number of independent axes driving the tool head's translational movement - * NUM_AXIS: number of movement axes + 1 - * NUM_AXIS_N: number of movement axes + number of extruders (defined elsewhere) - */ -#if ENABLED(HANGPRINTER) - #define MOV_AXIS ABCD - #define NUM_AXIS ABCDE -#else - #define MOV_AXIS XYZ - #define NUM_AXIS XYZE -#endif + // Set defaults for unspecified LED user colors + #if ENABLED(LED_CONTROL_MENU) + #ifndef LED_USER_PRESET_RED + #define LED_USER_PRESET_RED 255 + #endif + #ifndef LED_USER_PRESET_GREEN + #define LED_USER_PRESET_GREEN 255 + #endif + #ifndef LED_USER_PRESET_BLUE + #define LED_USER_PRESET_BLUE 255 + #endif + #ifndef LED_USER_PRESET_WHITE + #define LED_USER_PRESET_WHITE 0 + #endif + #ifndef LED_USER_PRESET_BRIGHTNESS + #ifdef NEOPIXEL_BRIGHTNESS + #define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS + #else + #define LED_USER_PRESET_BRIGHTNESS 255 + #endif + #endif + #endif #endif // CONDITIONALS_POST_H diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 6c50cc4..134c50e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -69,44 +69,32 @@ // example_configurations/SCARA and customize for your machine. // -//=========================================================================== -//============================= HANGPRINTER ================================= -//=========================================================================== -// For a Hangprinter start with the configuration file in the -// example_configurations/hangprinter directory and customize for your machine. -// - // @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 "(davidramiro, for Anycubic i3 Mega)" // Who made the changes. +#define STRING_CONFIG_H_AUTHOR "(davidramiro)" // 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 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -131,7 +119,7 @@ // 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_TRIGORILLA_14 + #define MOTHERBOARD BOARD_TRIGORILLA #endif // Optional custom name for your RepStrap or other custom machine @@ -208,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -238,21 +226,12 @@ * * :{ 0:'No power switch', 1:'ATX', 2:'X-Box 360' } */ -//#define POWER_SUPPLY 1 +#define POWER_SUPPLY 0 #if POWER_SUPPLY > 0 // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -266,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -275,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -286,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -308,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -316,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -355,7 +330,7 @@ #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 #define HEATER_4_MAXTEMP 275 -#define BED_MAXTEMP 120 +#define BED_MAXTEMP 125 //=========================================================================== //============================= PID Settings ================================ @@ -366,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -380,7 +355,7 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // i3 Mega - #define DEFAULT_Kp 15.94 + #define DEFAULT_Kp 16.94 #define DEFAULT_Ki 1.17 #define DEFAULT_Kd 54.19 @@ -390,46 +365,39 @@ //#define DEFAULT_Kd 114 // MakerGear - //#define DEFAULT_Kp 7.0 - //#define DEFAULT_Ki 0.1 - //#define DEFAULT_Kd 12 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 MAX_CYCLE_TIME_PID_AUTOTUNE 40L //#define BED_LIMIT_SWITCHING -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -443,29 +411,24 @@ //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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -520,10 +483,11 @@ //#define USE_YMAX_PLUG #define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -542,53 +506,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -#define X_DRIVER_TYPE TMC2208_STANDALONE -#define Y_DRIVER_TYPE TMC2208_STANDALONE -#define Z_DRIVER_TYPE TMC2208_STANDALONE -#define X2_DRIVER_TYPE TMC2208_STANDALONE -#define Y2_DRIVER_TYPE TMC2208_STANDALONE -#define Z2_DRIVER_TYPE TMC2208_STANDALONE -#define E0_DRIVER_TYPE TMC2208_STANDALONE -#define E1_DRIVER_TYPE TMC2208_STANDALONE -#define E2_DRIVER_TYPE TMC2208_STANDALONE -#define E3_DRIVER_TYPE TMC2208_STANDALONE -#define E4_DRIVER_TYPE TMC2208_STANDALONE - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -639,7 +560,7 @@ * M204 R Retract Acceleration * M204 T Travel Acceleration */ -#define DEFAULT_ACCELERATION 1200 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_ACCELERATION 1500 // X, Y, Z and E acceleration for printing moves #define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves @@ -651,21 +572,11 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XJERK 8.0 -#define DEFAULT_YJERK 8.0 +#define DEFAULT_XJERK 10.0 +#define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -716,7 +627,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ #define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -727,7 +637,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -746,9 +656,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -786,16 +693,13 @@ #define Y_PROBE_OFFSET_FROM_EXTRUDER -22 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -819,10 +723,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -858,6 +758,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -871,8 +774,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -905,7 +806,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -913,7 +814,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -921,23 +822,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -985,12 +881,6 @@ //#define AUTO_BED_LEVELING_UBL #define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1013,12 +903,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ -#define G26_MESH_VALIDATION + #define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 200.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 200.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1059,6 +949,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1067,23 +968,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 5 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1092,21 +997,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1118,11 +1010,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1396,11 +1283,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ //#define LCD_LANGUAGE en @@ -1428,6 +1315,19 @@ */ //#define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1454,28 +1354,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1524,21 +1415,15 @@ // Note: Test audio output with the G-Code: // M300 S P // -//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 -//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 - -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 +//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1556,6 +1441,40 @@ // //#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 @@ -1564,6 +1483,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1571,28 +1512,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1608,13 +1554,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1639,83 +1584,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1731,16 +1599,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1757,55 +1633,20 @@ //#define CR10_STOCKDISPLAY // -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - -// -// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// MKS OLED 1.3" 128x64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED // // Tiny, but very sharp OLED display +// If there is a pixel shift, try the other controller. // //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1865,7 +1706,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1930,12 +1771,14 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE // Enable Anycubic TFT #define ANYCUBIC_TFT_MODEL #define ANYCUBIC_FILAMENT_RUNOUT_SENSOR -//#define ANYCUBIC_TFT_DEBUG +#define ANYCUBIC_TFT_DEBUG #endif // CONFIGURATION_H diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index e454fdc..715198e 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1,4 +1,4 @@ -/** +/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ #define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ #define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 0 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -804,7 +739,7 @@ #endif // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. -#define BEZIER_CURVE_SUPPORT +//#define BEZIER_CURVE_SUPPORT // G38.2 and G38.3 Probe Target // Set MULTIPLE_PROBING if you want G38 to double touch @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -895,7 +793,7 @@ // Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough. // To use flow control, set this buffer size to at least 1024 bytes. // :[0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048] -//#define RX_BUFFER_SIZE 32 +//#define RX_BUFFER_SIZE 1024 #if RX_BUFFER_SIZE >= 1024 // Enable to have the controller send XON/XOFF control characters to @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1074,32 +970,67 @@ #define E4_SENSE_RESISTOR 91 #define E4_MICROSTEPS 16 -#endif // TMC26X +#endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 - #define HOLD_MULTIPLIER 0.2 // Scales down the holding current from run current + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current. @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,65 +1148,89 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 -#endif // L6470 +#endif /** * TWI/I2C BUS @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/G26_Mesh_Validation_Tool.cpp b/Marlin/G26_Mesh_Validation_Tool.cpp index ea8b601..074e6a2 100644 --- a/Marlin/G26_Mesh_Validation_Tool.cpp +++ b/Marlin/G26_Mesh_Validation_Tool.cpp @@ -33,8 +33,7 @@ #include "stepper.h" #include "temperature.h" #include "ultralcd.h" - #include "parser.h" - #include "serial.h" + #include "gcode.h" #include "bitmap_flags.h" #if ENABLED(MESH_BED_LEVELING) @@ -44,15 +43,15 @@ #endif #define EXTRUSION_MULTIPLIER 1.0 - #define RETRACTION_MULTIPLIER 6 + #define RETRACTION_MULTIPLIER 3.0 #define PRIME_LENGTH 25.0 #define OOZE_AMOUNT 2.25 - #define INTERSECTION_CIRCLE_RADIUS 5 - #define CROSSHAIRS_SIZE 3 + #define SIZE_OF_INTERSECTION_CIRCLES 5 + #define SIZE_OF_CROSSHAIRS 3 - #if CROSSHAIRS_SIZE >= INTERSECTION_CIRCLE_RADIUS - #error "CROSSHAIRS_SIZE must be less than INTERSECTION_CIRCLE_RADIUS." + #if SIZE_OF_CROSSHAIRS >= SIZE_OF_INTERSECTION_CIRCLES + #error "SIZE_OF_CROSSHAIRS must be less than SIZE_OF_INTERSECTION_CIRCLES." #endif #define G26_OK false @@ -134,11 +133,15 @@ // External references extern Planner planner; + #if ENABLED(ULTRA_LCD) + extern char lcd_status_message[]; + #endif + inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_AXIS]); } // Private functions static uint16_t circle_flags[16], horizontal_mesh_line_flags[16], vertical_mesh_line_flags[16]; - float g26_e_axis_feedrate = 0.025, + float g26_e_axis_feedrate = 0.020, random_deviation = 0.0; static bool g26_retracted = false; // Track the retracted state of the nozzle so mismatched @@ -155,7 +158,7 @@ static int8_t g26_prime_flag; - #if ENABLED(ULTIPANEL) + #if ENABLED(NEWPANEL) /** * If the LCD is clicked, cancel, wait for release, return true @@ -164,7 +167,7 @@ if (!is_lcd_clicked()) return false; // Return if the button isn't pressed lcd_setstatusPGM(PSTR("Mesh Validation Stopped."), 99); #if ENABLED(ULTIPANEL) - lcd_quick_feedback(true); + lcd_quick_feedback(); #endif wait_for_release(); return true; @@ -180,9 +183,9 @@ void G26_line_to_destination(const float &feed_rate) { const float save_feedrate = feedrate_mm_s; - feedrate_mm_s = feed_rate; + feedrate_mm_s = feed_rate; // use specified feed rate prepare_move_to_destination(); // will ultimately call ubl.line_to_destination_cartesian or ubl.prepare_linear_move_to for UBL_SEGMENTED - feedrate_mm_s = save_feedrate; + feedrate_mm_s = save_feedrate; // restore global feed rate } void move_to(const float &rx, const float &ry, const float &z, const float &e_delta) { @@ -198,9 +201,11 @@ destination[X_AXIS] = current_position[X_AXIS]; destination[Y_AXIS] = current_position[Y_AXIS]; destination[Z_AXIS] = z; // We know the last_z==z or we wouldn't be in this block of code. - destination[E_CART] = current_position[E_CART]; + destination[E_AXIS] = current_position[E_AXIS]; G26_line_to_destination(feed_value); + + stepper.synchronize(); set_destination_from_current(); } @@ -212,9 +217,11 @@ destination[X_AXIS] = rx; destination[Y_AXIS] = ry; - destination[E_CART] += e_delta; + destination[E_AXIS] += e_delta; G26_line_to_destination(feed_value); + + stepper.synchronize(); set_destination_from_current(); } @@ -239,7 +246,7 @@ */ inline bool prime_nozzle() { - #if ENABLED(ULTIPANEL) + #if ENABLED(NEWPANEL) float Total_Prime = 0.0; if (g26_prime_flag == -1) { // The user wants to control how much filament gets purged @@ -254,25 +261,27 @@ while (!is_lcd_clicked()) { lcd_chirp(); - destination[E_CART] += 0.25; + destination[E_AXIS] += 0.25; #ifdef PREVENT_LENGTHY_EXTRUDE Total_Prime += 0.25; if (Total_Prime >= EXTRUDE_MAXLENGTH) return G26_ERR; #endif G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0); - set_destination_from_current(); - planner.synchronize(); // Without this synchronize, the purge is more consistent, + + stepper.synchronize(); // Without this synchronize, the purge is more consistent, // but because the planner has a buffer, we won't be able // to stop as quickly. So we put up with the less smooth // action to give the user a more responsive 'Stop'. - - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. + set_destination_from_current(); + idle(); } wait_for_release(); + strcpy_P(lcd_status_message, PSTR("Done Priming")); // We can't do lcd_setstatusPGM() without having it continue; + // So... We cheat to get a message up. lcd_setstatusPGM(PSTR("Done Priming"), 99); - lcd_quick_feedback(true); + lcd_quick_feedback(); lcd_external_control = false; } else @@ -280,11 +289,12 @@ { #if ENABLED(ULTRA_LCD) lcd_setstatusPGM(PSTR("Fixed Length Prime."), 99); - lcd_quick_feedback(true); + lcd_quick_feedback(); #endif set_destination_from_current(); - destination[E_CART] += g26_prime_length; + destination[E_AXIS] += g26_prime_length; G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0); + stepper.synchronize(); set_destination_from_current(); retract_filament(destination); } @@ -358,7 +368,7 @@ // If the end point of the line is closer to the nozzle, flip the direction, // moving from the end to the start. On very small lines the optimization isn't worth it. - if (dist_end < dist_start && (INTERSECTION_CIRCLE_RADIUS) < ABS(line_length)) + if (dist_end < dist_start && (SIZE_OF_INTERSECTION_CIRCLES) < FABS(line_length)) return print_line_from_here_to_there(ex, ey, ez, sx, sy, sz); // Decide whether to retract & bump @@ -384,7 +394,7 @@ for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - #if ENABLED(ULTIPANEL) + #if ENABLED(NEWPANEL) if (user_canceled()) return true; // Check if the user wants to stop the Mesh Validation #endif @@ -398,8 +408,8 @@ // We found two circles that need a horizontal line to connect them // Print it! // - sx = _GET_MESH_X( i ) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // right edge - ex = _GET_MESH_X(i + 1) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // left edge + sx = _GET_MESH_X( i ) + (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // right edge + ex = _GET_MESH_X(i + 1) - (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // left edge sx = constrain(sx, X_MIN_POS + 1, X_MAX_POS - 1); sy = ey = constrain(_GET_MESH_Y(j), Y_MIN_POS + 1, Y_MAX_POS - 1); @@ -431,8 +441,8 @@ // We found two circles that need a vertical line to connect them // Print it! // - sy = _GET_MESH_Y( j ) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // top edge - ey = _GET_MESH_Y(j + 1) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // bottom edge + sy = _GET_MESH_Y( j ) + (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // top edge + ey = _GET_MESH_Y(j + 1) - (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // bottom edge sx = ex = constrain(_GET_MESH_X(i), X_MIN_POS + 1, X_MAX_POS - 1); sy = constrain(sy, Y_MIN_POS + 1, Y_MAX_POS - 1); @@ -470,19 +480,17 @@ */ inline bool turn_on_heaters() { millis_t next = millis() + 5000UL; - #if HAS_HEATED_BED + #if HAS_TEMP_BED #if ENABLED(ULTRA_LCD) if (g26_bed_temp > 25) { lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99); - lcd_quick_feedback(true); - #if ENABLED(ULTIPANEL) - lcd_external_control = true; - #endif + lcd_quick_feedback(); + lcd_external_control = true; #endif thermalManager.setTargetBed(g26_bed_temp); - while (ABS(thermalManager.degBed() - g26_bed_temp) > 3) { + while (abs(thermalManager.degBed() - g26_bed_temp) > 3) { - #if ENABLED(ULTIPANEL) + #if ENABLED(NEWPANEL) if (is_lcd_clicked()) return exit_from_g26(); #endif @@ -492,20 +500,19 @@ SERIAL_EOL(); } idle(); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. } #if ENABLED(ULTRA_LCD) } lcd_setstatusPGM(PSTR("G26 Heating Nozzle."), 99); - lcd_quick_feedback(true); + lcd_quick_feedback(); #endif #endif // Start heating the nozzle and wait for it to reach temperature. thermalManager.setTargetHotend(g26_hotend_temp, 0); - while (ABS(thermalManager.degHotend(0) - g26_hotend_temp) > 3) { + while (abs(thermalManager.degHotend(0) - g26_hotend_temp) > 3) { - #if ENABLED(ULTIPANEL) + #if ENABLED(NEWPANEL) if (is_lcd_clicked()) return exit_from_g26(); #endif @@ -515,12 +522,11 @@ SERIAL_EOL(); } idle(); - - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. } + #if ENABLED(ULTRA_LCD) lcd_reset_status(); - lcd_quick_feedback(true); + lcd_quick_feedback(); #endif return G26_OK; @@ -537,27 +543,12 @@ * * Used to interactively edit the mesh by placing the * nozzle in a problem area and doing a G29 P4 R command. - * - * Parameters: - * - * B Bed Temperature - * C Continue from the Closest mesh point - * D Disable leveling before starting - * F Filament diameter - * H Hotend Temperature - * K Keep heaters on when completed - * L Layer Height - * O Ooze extrusion length - * P Prime length - * Q Retraction multiplier - * R Repetitions (number of grid points) - * S Nozzle Size (diameter) in mm - * U Random deviation (50 if no value given) - * X X position - * Y Y position */ void gcode_G26() { SERIAL_ECHOLNPGM("G26 command started. Waiting for heater(s)."); + float tmp, start_angle, end_angle; + int i, xi, yi; + mesh_index_pair location; // Don't allow Mesh Validation without homing first, // or if the parameter parsing did not go OK, abort @@ -580,8 +571,8 @@ if (parser.seenval('B')) { g26_bed_temp = parser.value_celsius(); - if (g26_bed_temp && !WITHIN(g26_bed_temp, 40, 140)) { - SERIAL_PROTOCOLLNPGM("?Specified bed temperature not plausible (40-140C)."); + if (!WITHIN(g26_bed_temp, 15, 140)) { + SERIAL_PROTOCOLLNPGM("?Specified bed temperature not plausible."); return; } } @@ -618,7 +609,7 @@ if (parser.seen('P')) { if (!parser.has_value()) { - #if ENABLED(ULTIPANEL) + #if ENABLED(NEWPANEL) g26_prime_flag = -1; #else SERIAL_PROTOCOLLNPGM("?Prime length must be specified when not using an LCD."); @@ -663,7 +654,7 @@ } int16_t g26_repeats; - #if ENABLED(ULTIPANEL) + #if ENABLED(NEWPANEL) g26_repeats = parser.intval('R', GRID_MAX_POINTS + 1); #else if (!parser.seen('R')) { @@ -692,12 +683,13 @@ if (current_position[Z_AXIS] < Z_CLEARANCE_BETWEEN_PROBES) { do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); + stepper.synchronize(); set_current_from_destination(); } if (turn_on_heaters() != G26_OK) goto LEAVE; - current_position[E_CART] = 0.0; + current_position[E_AXIS] = 0.0; sync_plan_position_e(); if (g26_prime_flag && prime_nozzle() != G26_OK) goto LEAVE; @@ -722,35 +714,24 @@ move_to(destination, 0.0); move_to(destination, g26_ooze_amount); - #if ENABLED(ULTIPANEL) + #if ENABLED(ULTRA_LCD) lcd_external_control = true; #endif //debug_current_and_destination(PSTR("Starting G26 Mesh Validation Pattern.")); - #if DISABLED(ARC_SUPPORT) + /** + * Declare and generate a sin() & cos() table to be used during the circle drawing. This will lighten + * the CPU load and make the arc drawing faster and more smooth + */ + float sin_table[360 / 30 + 1], cos_table[360 / 30 + 1]; + for (i = 0; i <= 360 / 30; i++) { + cos_table[i] = SIZE_OF_INTERSECTION_CIRCLES * cos(RADIANS(valid_trig_angle(i * 30.0))); + sin_table[i] = SIZE_OF_INTERSECTION_CIRCLES * sin(RADIANS(valid_trig_angle(i * 30.0))); + } - /** - * Pre-generate radius offset values at 30 degree intervals to reduce CPU load. - */ - #define A_INT 30 - #define _ANGS (360 / A_INT) - #define A_CNT (_ANGS / 2) - #define _IND(A) ((A + _ANGS * 8) % _ANGS) - #define _COS(A) (trig_table[_IND(A) % A_CNT] * (_IND(A) >= A_CNT ? -1 : 1)) - #define _SIN(A) (-_COS((A + A_CNT / 2) % _ANGS)) - #if A_CNT & 1 - #error "A_CNT must be a positive value. Please change A_INT." - #endif - float trig_table[A_CNT]; - for (uint8_t i = 0; i < A_CNT; i++) - trig_table[i] = INTERSECTION_CIRCLE_RADIUS * cos(RADIANS(i * A_INT)); - - #endif // !ARC_SUPPORT - - mesh_index_pair location; do { - location = g26_continue_with_closest + location = g26_continue_with_closest ? find_closest_circle_to_print(current_position[X_AXIS], current_position[Y_AXIS]) : find_closest_circle_to_print(g26_x_pos, g26_y_pos); // Find the closest Mesh Intersection to where we are now. @@ -759,133 +740,87 @@ circle_y = _GET_MESH_Y(location.y_index); // If this mesh location is outside the printable_radius, skip it. + if (!position_is_reachable(circle_x, circle_y)) continue; - // Determine where to start and end the circle, - // which is always drawn counter-clockwise. - const uint8_t xi = location.x_index, yi = location.y_index; - const bool f = yi == 0, r = xi >= GRID_MAX_POINTS_X - 1, b = yi >= GRID_MAX_POINTS_Y - 1; + xi = location.x_index; // Just to shrink the next few lines and make them easier to understand + yi = location.y_index; - #if ENABLED(ARC_SUPPORT) + if (g26_debug_flag) { + SERIAL_ECHOPAIR(" Doing circle at: (xi=", xi); + SERIAL_ECHOPAIR(", yi=", yi); + SERIAL_CHAR(')'); + SERIAL_EOL(); + } - #define ARC_LENGTH(quarters) (INTERSECTION_CIRCLE_RADIUS * M_PI * (quarters) / 2) - float sx = circle_x + INTERSECTION_CIRCLE_RADIUS, // default to full circle - ex = circle_x + INTERSECTION_CIRCLE_RADIUS, - sy = circle_y, ey = circle_y, - arc_length = ARC_LENGTH(4); + start_angle = 0.0; // assume it is going to be a full circle + end_angle = 360.0; + if (xi == 0) { // Check for bottom edge + start_angle = -90.0; + end_angle = 90.0; + if (yi == 0) // it is an edge, check for the two left corners + start_angle = 0.0; + else if (yi == GRID_MAX_POINTS_Y - 1) + end_angle = 0.0; + } + else if (xi == GRID_MAX_POINTS_X - 1) { // Check for top edge + start_angle = 90.0; + end_angle = 270.0; + if (yi == 0) // it is an edge, check for the two right corners + end_angle = 180.0; + else if (yi == GRID_MAX_POINTS_Y - 1) + start_angle = 180.0; + } + else if (yi == 0) { + start_angle = 0.0; // only do the top side of the cirlce + end_angle = 180.0; + } + else if (yi == GRID_MAX_POINTS_Y - 1) { + start_angle = 180.0; // only do the bottom side of the cirlce + end_angle = 360.0; + } - // Figure out where to start and end the arc - we always print counterclockwise - if (xi == 0) { // left edge - sx = f ? circle_x + INTERSECTION_CIRCLE_RADIUS : circle_x; - ex = b ? circle_x + INTERSECTION_CIRCLE_RADIUS : circle_x; - sy = f ? circle_y : circle_y - INTERSECTION_CIRCLE_RADIUS; - ey = b ? circle_y : circle_y + INTERSECTION_CIRCLE_RADIUS; - arc_length = (f || b) ? ARC_LENGTH(1) : ARC_LENGTH(2); - } - else if (r) { // right edge - sx = b ? circle_x - INTERSECTION_CIRCLE_RADIUS : circle_x; - ex = f ? circle_x - INTERSECTION_CIRCLE_RADIUS : circle_x; - sy = b ? circle_y : circle_y + INTERSECTION_CIRCLE_RADIUS; - ey = f ? circle_y : circle_y - INTERSECTION_CIRCLE_RADIUS; - arc_length = (f || b) ? ARC_LENGTH(1) : ARC_LENGTH(2); - } - else if (f) { - sx = circle_x + INTERSECTION_CIRCLE_RADIUS; - ex = circle_x - INTERSECTION_CIRCLE_RADIUS; - sy = ey = circle_y; - arc_length = ARC_LENGTH(2); - } - else if (b) { - sx = circle_x - INTERSECTION_CIRCLE_RADIUS; - ex = circle_x + INTERSECTION_CIRCLE_RADIUS; - sy = ey = circle_y; - arc_length = ARC_LENGTH(2); - } - const float arc_offset[2] = { - circle_x - sx, - circle_y - sy - }; + for (tmp = start_angle; tmp < end_angle - 0.1; tmp += 30.0) { - const float dx_s = current_position[X_AXIS] - sx, // find our distance from the start of the actual circle - dy_s = current_position[Y_AXIS] - sy, - dist_start = HYPOT2(dx_s, dy_s); - const float endpoint[XYZE] = { - ex, ey, - g26_layer_height, - current_position[E_CART] + (arc_length * g26_e_axis_feedrate * g26_extrusion_multiplier) - }; - - if (dist_start > 2.0) { - retract_filament(destination); - //todo: parameterize the bump height with a define - move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + 0.500, 0.0); // Z bump to minimize scraping - move_to(sx, sy, g26_layer_height + 0.500, 0.0); // Get to the starting point with no extrusion while bumped - } - - move_to(sx, sy, g26_layer_height, 0.0); // Get to the starting point with no extrusion / un-Z bump - - recover_filament(destination); - const float save_feedrate = feedrate_mm_s; - feedrate_mm_s = PLANNER_XY_FEEDRATE() / 10.0; - plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc - feedrate_mm_s = save_feedrate; - set_destination_from_current(); - #if ENABLED(ULTIPANEL) - if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation + #if ENABLED(NEWPANEL) + if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation #endif - #else // !ARC_SUPPORT + int tmp_div_30 = tmp / 30.0; + if (tmp_div_30 < 0) tmp_div_30 += 360 / 30; + if (tmp_div_30 > 11) tmp_div_30 -= 360 / 30; - int8_t start_ind = -2, end_ind = 9; // Assume a full circle (from 5:00 to 5:00) - if (xi == 0) { // Left edge? Just right half. - start_ind = f ? 0 : -3; // 03:00 to 12:00 for front-left - end_ind = b ? 0 : 2; // 06:00 to 03:00 for back-left - } - else if (r) { // Right edge? Just left half. - start_ind = b ? 6 : 3; // 12:00 to 09:00 for front-right - end_ind = f ? 5 : 8; // 09:00 to 06:00 for back-right - } - else if (f) { // Front edge? Just back half. - start_ind = 0; // 03:00 - end_ind = 5; // 09:00 - } - else if (b) { // Back edge? Just front half. - start_ind = 6; // 09:00 - end_ind = 11; // 03:00 - } + float rx = circle_x + cos_table[tmp_div_30], // for speed, these are now a lookup table entry + ry = circle_y + sin_table[tmp_div_30], + xe = circle_x + cos_table[tmp_div_30 + 1], + ye = circle_y + sin_table[tmp_div_30 + 1]; + #if IS_KINEMATIC + // Check to make sure this segment is entirely on the bed, skip if not. + if (!position_is_reachable(rx, ry) || !position_is_reachable(xe, ye)) continue; + #else // not, we need to skip + rx = constrain(rx, X_MIN_POS + 1, X_MAX_POS - 1); // This keeps us from bumping the endstops + ry = constrain(ry, Y_MIN_POS + 1, Y_MAX_POS - 1); + xe = constrain(xe, X_MIN_POS + 1, X_MAX_POS - 1); + ye = constrain(ye, Y_MIN_POS + 1, Y_MAX_POS - 1); + #endif - for (int8_t ind = start_ind; ind <= end_ind; ind++) { + //if (g26_debug_flag) { + // char ccc, *cptr, seg_msg[50], seg_num[10]; + // strcpy(seg_msg, " segment: "); + // strcpy(seg_num, " \n"); + // cptr = (char*) "01234567890ABCDEF????????"; + // ccc = cptr[tmp_div_30]; + // seg_num[1] = ccc; + // strcat(seg_msg, seg_num); + // debug_current_and_destination(seg_msg); + //} - #if ENABLED(ULTIPANEL) - if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation - #endif + print_line_from_here_to_there(rx, ry, g26_layer_height, xe, ye, g26_layer_height); - float rx = circle_x + _COS(ind), // For speed, these are now a lookup table entry - ry = circle_y + _SIN(ind), - xe = circle_x + _COS(ind + 1), - ye = circle_y + _SIN(ind + 1); - - #if IS_KINEMATIC - // Check to make sure this segment is entirely on the bed, skip if not. - if (!position_is_reachable(rx, ry) || !position_is_reachable(xe, ye)) continue; - #else // not, we need to skip - rx = constrain(rx, X_MIN_POS + 1, X_MAX_POS - 1); // This keeps us from bumping the endstops - ry = constrain(ry, Y_MIN_POS + 1, Y_MAX_POS - 1); - xe = constrain(xe, X_MIN_POS + 1, X_MAX_POS - 1); - ye = constrain(ye, Y_MIN_POS + 1, Y_MAX_POS - 1); - #endif - - print_line_from_here_to_there(rx, ry, g26_layer_height, xe, ye, g26_layer_height); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } - - #endif // !ARC_SUPPORT - - if (look_for_lines_to_connect()) goto LEAVE; + } + if (look_for_lines_to_connect()) + goto LEAVE; } - - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (--g26_repeats && location.x_index >= 0 && location.y_index >= 0); LEAVE: @@ -905,12 +840,12 @@ move_to(destination, 0); // Move back to the starting position //debug_current_and_destination(PSTR("done doing X/Y move.")); - #if ENABLED(ULTIPANEL) + #if ENABLED(ULTRA_LCD) lcd_external_control = false; // Give back control of the LCD Panel! #endif if (!g26_keep_heaters_on) { - #if HAS_HEATED_BED + #if HAS_TEMP_BED thermalManager.setTargetBed(0); #endif thermalManager.setTargetHotend(0, 0); diff --git a/Marlin/I2CPositionEncoder.cpp b/Marlin/I2CPositionEncoder.cpp index 285ba0d..8433481 100644 --- a/Marlin/I2CPositionEncoder.cpp +++ b/Marlin/I2CPositionEncoder.cpp @@ -36,7 +36,7 @@ #include "temperature.h" #include "stepper.h" #include "I2CPositionEncoder.h" - #include "parser.h" + #include "gcode.h" #include @@ -99,7 +99,7 @@ //the encoder likely lost its place when the error occured, so we'll reset and use the printer's //idea of where it the axis is to re-initialise - float position = planner.get_axis_position_mm(encoderAxis); + float position = stepper.get_axis_position_mm(encoderAxis); int32_t positionInTicks = position * get_ticks_unit(); //shift position from previous to current position @@ -117,7 +117,7 @@ SERIAL_ECHOPGM("New position reads as "); SERIAL_ECHO(get_position()); - SERIAL_CHAR('('); + SERIAL_ECHOPGM("("); SERIAL_ECHO(mm_from_count(get_position())); SERIAL_ECHOLNPGM(")"); #endif @@ -134,7 +134,7 @@ #ifdef I2CPE_EC_THRESH_PROPORTIONAL const millis_t deltaTime = positionTime - lastPositionTime; - const uint32_t distance = ABS(position - lastPosition), + const uint32_t distance = abs(position - lastPosition), speed = distance / deltaTime; const float threshold = constrain((speed / 50), 1, 50) * ecThreshold; #else @@ -150,7 +150,7 @@ LOOP_L_N(i, I2CPE_ERR_ARRAY_SIZE) { sum += err[i]; - if (i) diffSum += ABS(err[i-1] - err[i]); + if (i) diffSum += abs(err[i-1] - err[i]); } const int32_t error = int32_t(sum / (I2CPE_ERR_ARRAY_SIZE + 1)); //calculate average for error @@ -163,7 +163,7 @@ //SERIAL_ECHOLN(error); #ifdef I2CPE_ERR_THRESH_ABORT - if (ABS(error) > I2CPE_ERR_THRESH_ABORT * planner.axis_steps_per_mm[encoderAxis]) { + if (labs(error) > I2CPE_ERR_THRESH_ABORT * planner.axis_steps_per_mm[encoderAxis]) { //kill("Significant Error"); SERIAL_ECHOPGM("Axis error greater than set threshold, aborting!"); SERIAL_ECHOLN(error); @@ -173,34 +173,26 @@ #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) if (errIdx == 0) { - // In order to correct for "error" but avoid correcting for noise and non-skips + // in order to correct for "error" but avoid correcting for noise and non skips // it must be > threshold and have a difference average of < 10 and be < 2000 steps - if (ABS(error) > threshold * planner.axis_steps_per_mm[encoderAxis] && - diffSum < 10 * (I2CPE_ERR_ARRAY_SIZE - 1) && ABS(error) < 2000) { // Check for persistent error (skip) - errPrst[errPrstIdx++] = error; // Error must persist for I2CPE_ERR_PRST_ARRAY_SIZE error cycles. This also serves to improve the average accuracy - if (errPrstIdx >= I2CPE_ERR_PRST_ARRAY_SIZE) { - float sumP = 0; - LOOP_L_N(i, I2CPE_ERR_PRST_ARRAY_SIZE) sumP += errPrst[i]; - const int32_t errorP = int32_t(sumP * (1.0f / (I2CPE_ERR_PRST_ARRAY_SIZE))); - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOPAIR(" - err detected: ", errorP * planner.steps_to_mm[encoderAxis]); - SERIAL_ECHOLNPGM("mm; correcting!"); - thermalManager.babystepsTodo[encoderAxis] = -LROUND(errorP); - errPrstIdx = 0; - } + if (labs(error) > threshold * planner.axis_steps_per_mm[encoderAxis] && + diffSum < 10 * (I2CPE_ERR_ARRAY_SIZE - 1) && labs(error) < 2000) { //Check for persistent error (skip) + SERIAL_ECHO(axis_codes[encoderAxis]); + SERIAL_ECHOPAIR(" diffSum: ", diffSum / (I2CPE_ERR_ARRAY_SIZE - 1)); + SERIAL_ECHOPAIR(" - err detected: ", error / planner.axis_steps_per_mm[encoderAxis]); + SERIAL_ECHOLNPGM("mm; correcting!"); + thermalManager.babystepsTodo[encoderAxis] = -LROUND(error); } - else - errPrstIdx = 0; } #else - if (ABS(error) > threshold * planner.axis_steps_per_mm[encoderAxis]) { + if (labs(error) > threshold * planner.axis_steps_per_mm[encoderAxis]) { //SERIAL_ECHOLN(error); //SERIAL_ECHOLN(position); - thermalManager.babystepsTodo[encoderAxis] = -LROUND(error / 2); + thermalManager.babystepsTodo[encoderAxis] = -LROUND(error/2); } #endif - if (ABS(error) > I2CPE_ERR_CNT_THRESH * planner.axis_steps_per_mm[encoderAxis]) { + if (labs(error) > I2CPE_ERR_CNT_THRESH * planner.axis_steps_per_mm[encoderAxis]) { const millis_t ms = millis(); if (ELAPSED(ms, nextErrorCountTime)) { SERIAL_ECHOPAIR("Large error on ", axis_codes[encoderAxis]); @@ -254,11 +246,11 @@ float I2CPositionEncoder::get_axis_error_mm(const bool report) { float target, actual, error; - target = planner.get_axis_position_mm(encoderAxis); + target = stepper.get_axis_position_mm(encoderAxis); actual = mm_from_count(position); error = actual - target; - if (ABS(error) > 10000) error = 0; // ? + if (labs(error) > 10000) error = 0; // ? if (report) { SERIAL_ECHO(axis_codes[encoderAxis]); @@ -293,7 +285,7 @@ error = (encoderCountInStepperTicksScaled - target); //suppress discontinuities (might be caused by bad I2C readings...?) - const bool suppressOutput = (ABS(error - errorPrev) > 100); + bool suppressOutput = (labs(error - errorPrev) > 100); if (report) { SERIAL_ECHO(axis_codes[encoderAxis]); @@ -349,18 +341,18 @@ ec = false; LOOP_NA(i) { - startCoord[i] = planner.get_axis_position_mm((AxisEnum)i); - endCoord[i] = planner.get_axis_position_mm((AxisEnum)i); + startCoord[i] = stepper.get_axis_position_mm((AxisEnum)i); + endCoord[i] = stepper.get_axis_position_mm((AxisEnum)i); } startCoord[encoderAxis] = startPosition; endCoord[encoderAxis] = endPosition; - planner.synchronize(); + stepper.synchronize(); - planner.buffer_line(startCoord[X_AXIS], startCoord[Y_AXIS], startCoord[Z_AXIS], - planner.get_axis_position_mm(E_AXIS), feedrate, 0); - planner.synchronize(); + planner.buffer_line(startCoord[X_AXIS],startCoord[Y_AXIS],startCoord[Z_AXIS], + stepper.get_axis_position_mm(E_AXIS), feedrate, 0); + stepper.synchronize(); // if the module isn't currently trusted, wait until it is (or until it should be if things are working) if (!trusted) { @@ -371,8 +363,8 @@ if (trusted) { // if trusted, commence test planner.buffer_line(endCoord[X_AXIS], endCoord[Y_AXIS], endCoord[Z_AXIS], - planner.get_axis_position_mm(E_AXIS), feedrate, 0); - planner.synchronize(); + stepper.get_axis_position_mm(E_AXIS), feedrate, 0); + stepper.synchronize(); } return trusted; @@ -408,34 +400,34 @@ travelDistance = endDistance - startDistance; LOOP_NA(i) { - startCoord[i] = planner.get_axis_position_mm((AxisEnum)i); - endCoord[i] = planner.get_axis_position_mm((AxisEnum)i); + startCoord[i] = stepper.get_axis_position_mm((AxisEnum)i); + endCoord[i] = stepper.get_axis_position_mm((AxisEnum)i); } startCoord[encoderAxis] = startDistance; endCoord[encoderAxis] = endDistance; - planner.synchronize(); - LOOP_L_N(i, iter) { - planner.buffer_line(startCoord[X_AXIS], startCoord[Y_AXIS], startCoord[Z_AXIS], - planner.get_axis_position_mm(E_AXIS), feedrate, 0); - planner.synchronize(); + stepper.synchronize(); + + planner.buffer_line(startCoord[X_AXIS],startCoord[Y_AXIS],startCoord[Z_AXIS], + stepper.get_axis_position_mm(E_AXIS), feedrate, 0); + stepper.synchronize(); delay(250); startCount = get_position(); //do_blocking_move_to(endCoord[X_AXIS],endCoord[Y_AXIS],endCoord[Z_AXIS]); - planner.buffer_line(endCoord[X_AXIS], endCoord[Y_AXIS], endCoord[Z_AXIS], - planner.get_axis_position_mm(E_AXIS), feedrate, 0); - planner.synchronize(); + planner.buffer_line(endCoord[X_AXIS],endCoord[Y_AXIS],endCoord[Z_AXIS], + stepper.get_axis_position_mm(E_AXIS), feedrate, 0); + stepper.synchronize(); //Read encoder distance delay(250); stopCount = get_position(); - travelledDistance = mm_from_count(ABS(stopCount - startCount)); + travelledDistance = mm_from_count(abs(stopCount - startCount)); SERIAL_ECHOPAIR("Attempted to travel: ", travelDistance); SERIAL_ECHOLNPGM("mm."); diff --git a/Marlin/I2CPositionEncoder.h b/Marlin/I2CPositionEncoder.h index a0e8a61..8380241 100644 --- a/Marlin/I2CPositionEncoder.h +++ b/Marlin/I2CPositionEncoder.h @@ -78,7 +78,6 @@ #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) #define I2CPE_ERR_ARRAY_SIZE 32 - #define I2CPE_ERR_PRST_ARRAY_SIZE 10 #endif // Error Correction Methods @@ -98,6 +97,8 @@ #define LOOP_PE(VAR) LOOP_L_N(VAR, I2CPE_ENCODER_CNT) #define CHECK_IDX() do{ if (!WITHIN(idx, 0, I2CPE_ENCODER_CNT - 1)) return; }while(0) + extern const char axis_codes[XYZE]; + typedef union { volatile int32_t val = 0; uint8_t bval[4]; @@ -134,12 +135,15 @@ nextErrorCountTime = 0, lastErrorTime; + //double positionMm; //calculate + #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - uint8_t errIdx = 0, errPrstIdx = 0; - int err[I2CPE_ERR_ARRAY_SIZE] = { 0 }, - errPrst[I2CPE_ERR_PRST_ARRAY_SIZE] = { 0 }; + uint8_t errIdx = 0; + int err[I2CPE_ERR_ARRAY_SIZE] = { 0 }; #endif + //float positionMm; //calculate + public: void init(const uint8_t address, const AxisEnum axis); void reset(); diff --git a/Marlin/M100_Free_Mem_Chk.cpp b/Marlin/M100_Free_Mem_Chk.cpp index 9680908..6620b0a 100644 --- a/Marlin/M100_Free_Mem_Chk.cpp +++ b/Marlin/M100_Free_Mem_Chk.cpp @@ -45,24 +45,25 @@ * * Initial version by Roxy-3D */ +#define M100_FREE_MEMORY_DUMPER // Enable for the `M110 D` Dump sub-command +#define M100_FREE_MEMORY_CORRUPTOR // Enable for the `M100 C` Corrupt sub-command #include "MarlinConfig.h" #if ENABLED(M100_FREE_MEMORY_WATCHER) -#define M100_FREE_MEMORY_DUMPER // Enable for the `M100 D` Dump sub-command -#define M100_FREE_MEMORY_CORRUPTOR // Enable for the `M100 C` Corrupt sub-command - -#include "Marlin.h" -#include "parser.h" -#include "hex_print_routines.h" - #define TEST_BYTE ((char) 0xE5) +extern char command_queue[BUFSIZE][MAX_CMD_SIZE]; + extern char* __brkval; extern size_t __heap_start, __heap_end, __flp; extern char __bss_end; +#include "Marlin.h" +#include "gcode.h" +#include "hex_print_routines.h" + // // Utility functions // diff --git a/Marlin/Makefile b/Marlin/Makefile index 68fd055..a2cea06 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -1,4 +1,4 @@ -# Marlin Firmware Arduino Project Makefile +# Sprinter Arduino Project Makefile # # Makefile Based on: # Arduino 0011 Makefile @@ -96,297 +96,153 @@ RELOC_WORKAROUND ?= 1 # HARDWARE_VARIANT = "arduino", "Sanguino", "Gen7", ... # MCU = "atmega1280", "Mega2560", "atmega2560", "atmega644p", ... -ifeq ($(HARDWARE_MOTHERBOARD),0) - - # No motherboard selected - -# -# RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560 -# - -# MEGA/RAMPS up to 1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),3) - -# RAMPS 1.3 (Power outputs: Hotend, Fan, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),33) -# RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),34) -# RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1) -else ifeq ($(HARDWARE_MOTHERBOARD),35) -# RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),36) -# RAMPS 1.3 (Power outputs: Spindle, Controller Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),38) - -# RAMPS 1.4 (Power outputs: Hotend, Fan, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),43) -# RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),44) -# RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1) -else ifeq ($(HARDWARE_MOTHERBOARD),45) -# RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),46) -# RAMPS 1.4 (Power outputs: Spindle, Controller Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),48) - -# RAMPS Plus 3DYMY (Power outputs: Hotend, Fan, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),143) -# RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),144) -# RAMPS Plus 3DYMY (Power outputs: Hotend, Fan0, Fan1) -else ifeq ($(HARDWARE_MOTHERBOARD),145) -# RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),146) -# RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),148) - -# -# RAMPS Derivatives - ATmega1280, ATmega2560 -# - -# 3Drag Controller -else ifeq ($(HARDWARE_MOTHERBOARD),77) -# Velleman K8200 Controller (derived from 3Drag Controller) -else ifeq ($(HARDWARE_MOTHERBOARD),78) -# Velleman K8400 Controller (derived from 3Drag Controller) -else ifeq ($(HARDWARE_MOTHERBOARD),79) -# 2PrintBeta BAM&DICE with STK drivers -else ifeq ($(HARDWARE_MOTHERBOARD),401) -# 2PrintBeta BAM&DICE Due with STK drivers -else ifeq ($(HARDWARE_MOTHERBOARD),402) -# MKS BASE v1.0 -else ifeq ($(HARDWARE_MOTHERBOARD),40) -# MKS v1.5 with Allegro A4982 stepper drivers -else ifeq ($(HARDWARE_MOTHERBOARD),405) -# MKS BASE 1.0 with Heroic HR4982 stepper drivers -else ifeq ($(HARDWARE_MOTHERBOARD),41) -# MKS GEN v1.3 or 1.4 -else ifeq ($(HARDWARE_MOTHERBOARD),47) -# MKS GEN L -else ifeq ($(HARDWARE_MOTHERBOARD),53) -# zrib V2.0 control board (Chinese knock off RAMPS replica) -else ifeq ($(HARDWARE_MOTHERBOARD),504) -# Felix 2.0+ Electronics Board (RAMPS like) -else ifeq ($(HARDWARE_MOTHERBOARD),37) -# Invent-A-Part RigidBoard -else ifeq ($(HARDWARE_MOTHERBOARD),42) -# Invent-A-Part RigidBoard V2 -else ifeq ($(HARDWARE_MOTHERBOARD),52) -# Sainsmart 2-in-1 board -else ifeq ($(HARDWARE_MOTHERBOARD),49) -# Ultimaker -else ifeq ($(HARDWARE_MOTHERBOARD),7) -# Ultimaker (Older electronics. Pre 1.5.4. This is rare) -else ifeq ($(HARDWARE_MOTHERBOARD),71) -MCU ?= atmega1280 -# Azteeg X3 -else ifeq ($(HARDWARE_MOTHERBOARD),67) -# Azteeg X3 Pro -else ifeq ($(HARDWARE_MOTHERBOARD),68) -# Ultimainboard 2.x (Uses TEMP_SENSOR 20) -else ifeq ($(HARDWARE_MOTHERBOARD),72) -# Rumba -else ifeq ($(HARDWARE_MOTHERBOARD),80) -# bq ZUM Mega 3D -else ifeq ($(HARDWARE_MOTHERBOARD),503) -# MakeBoard Mini v2.1.2 is a control board sold by MicroMake -else ifeq ($(HARDWARE_MOTHERBOARD),431) -# TriGorilla Anycubic version 1.3 based on RAMPS EFB -else ifeq ($(HARDWARE_MOTHERBOARD),343) -# TriGorilla Anycubic version 1.4 based on RAMPS EFB -else ifeq ($(HARDWARE_MOTHERBOARD),443) -# Creality: Ender-4, CR-8 -else ifeq ($(HARDWARE_MOTHERBOARD),243) - -# -# Other ATmega1280, ATmega2560 -# - -# Cartesio CN Controls V11 -else ifeq ($(HARDWARE_MOTHERBOARD),111) -# Cartesio CN Controls V12 -else ifeq ($(HARDWARE_MOTHERBOARD),112) -# Cheaptronic v1.0 -else ifeq ($(HARDWARE_MOTHERBOARD),2) -# Cheaptronic v2.0 -else ifeq ($(HARDWARE_MOTHERBOARD),21) -# Makerbot Mightyboard Revision E -else ifeq ($(HARDWARE_MOTHERBOARD),200) -# Megatronics -else ifeq ($(HARDWARE_MOTHERBOARD),70) -# Megatronics v2.0 -else ifeq ($(HARDWARE_MOTHERBOARD),701) -# Megatronics v3.0 -else ifeq ($(HARDWARE_MOTHERBOARD),703) -# Megatronics v3.1 -else ifeq ($(HARDWARE_MOTHERBOARD),704) -# Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),301) -# Mini-Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),302) -# Mini-Rambo 1.0a -else ifeq ($(HARDWARE_MOTHERBOARD),303) -# Einsy Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),304) -# Einsy Retro -else ifeq ($(HARDWARE_MOTHERBOARD),305) -# Elefu Ra Board (v3) -else ifeq ($(HARDWARE_MOTHERBOARD),21) -# Leapfrog -else ifeq ($(HARDWARE_MOTHERBOARD),999) -# Mega controller -else ifeq ($(HARDWARE_MOTHERBOARD),310) -# abee Scoovo X9H -else ifeq ($(HARDWARE_MOTHERBOARD),321) -# Geeetech GT2560 Rev. A -else ifeq ($(HARDWARE_MOTHERBOARD),74) -# Geeetech GT2560 Rev. A+ (with auto level probe) -else ifeq ($(HARDWARE_MOTHERBOARD),75) - -# -# ATmega1281, ATmega2561 -# - -else ifeq ($(HARDWARE_MOTHERBOARD),702) -MCU ?= atmega1281 -else ifeq ($(HARDWARE_MOTHERBOARD),25) -MCU ?= atmega1281 - -# -# Sanguinololu and Derivatives - ATmega644P, ATmega1284P -# - -# Sanguinololu < 1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),6) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Sanguinololu 1.2 and above -else ifeq ($(HARDWARE_MOTHERBOARD),62) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Melzi -else ifeq ($(HARDWARE_MOTHERBOARD),63) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Melzi with ATmega1284 (MaKr3d version) -else ifeq ($(HARDWARE_MOTHERBOARD),66) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Melzi Creality3D board (for CR-10 etc) -else ifeq ($(HARDWARE_MOTHERBOARD),89) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Melzi Malyan M150 board -else ifeq ($(HARDWARE_MOTHERBOARD),92) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Tronxy X5S -else ifeq ($(HARDWARE_MOTHERBOARD),505) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# STB V1.1 -else ifeq ($(HARDWARE_MOTHERBOARD),64) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Azteeg X1 -else ifeq ($(HARDWARE_MOTHERBOARD),65) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Anet 1.0 (Melzi clone) -else ifeq ($(HARDWARE_MOTHERBOARD),69) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p - -# -# Other ATmega644P, ATmega644, ATmega1284P -# - -# Gen3 Monolithic Electronics -else ifeq ($(HARDWARE_MOTHERBOARD),22) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Gen3+ -else ifeq ($(HARDWARE_MOTHERBOARD),9) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Gen6 -else ifeq ($(HARDWARE_MOTHERBOARD),5) -HARDWARE_VARIANT ?= Gen6 -MCU ?= atmega644p -# Gen6 deluxe -else ifeq ($(HARDWARE_MOTHERBOARD),51) -HARDWARE_VARIANT ?= Gen6 -MCU ?= atmega644p -# Gen7 custom (Alfons3 Version) -else ifeq ($(HARDWARE_MOTHERBOARD),10) +#Gen7 +ifeq ($(HARDWARE_MOTHERBOARD),10) HARDWARE_VARIANT ?= Gen7 MCU ?= atmega644 F_CPU ?= 20000000 -# Gen7 v1.1, v1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),11) +else ifeq ($(HARDWARE_MOTHERBOARD),11) HARDWARE_VARIANT ?= Gen7 MCU ?= atmega644p F_CPU ?= 20000000 -# Gen7 v1.3 -else ifeq ($(HARDWARE_MOTHERBOARD),12) +else ifeq ($(HARDWARE_MOTHERBOARD),12) HARDWARE_VARIANT ?= Gen7 MCU ?= atmega644p F_CPU ?= 20000000 -# Gen7 v1.4 -else ifeq ($(HARDWARE_MOTHERBOARD),13) +else ifeq ($(HARDWARE_MOTHERBOARD),13) HARDWARE_VARIANT ?= Gen7 MCU ?= atmega1284p F_CPU ?= 20000000 -# Alpha OMCA board -else ifeq ($(HARDWARE_MOTHERBOARD),90) -HARDWARE_VARIANT ?= SanguinoA -MCU ?= atmega644 -# Final OMCA board -else ifeq ($(HARDWARE_MOTHERBOARD),91) -HARDWARE_VARIANT ?= Sanguino + +#RAMPS +else ifeq ($(HARDWARE_MOTHERBOARD),3) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 +else ifeq ($(HARDWARE_MOTHERBOARD),33) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 +else ifeq ($(HARDWARE_MOTHERBOARD),34) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 +else ifeq ($(HARDWARE_MOTHERBOARD),35) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 +else ifeq ($(HARDWARE_MOTHERBOARD),36) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 +else ifeq ($(HARDWARE_MOTHERBOARD),38) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 +else ifeq ($(HARDWARE_MOTHERBOARD),43) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 +else ifeq ($(HARDWARE_MOTHERBOARD),44) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 +else ifeq ($(HARDWARE_MOTHERBOARD),45) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 +else ifeq ($(HARDWARE_MOTHERBOARD),46) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 +else ifeq ($(HARDWARE_MOTHERBOARD),48) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 + +#Gen6 +else ifeq ($(HARDWARE_MOTHERBOARD),5) +HARDWARE_VARIANT ?= Gen6 MCU ?= atmega644p -# Sethi 3D_1 -else ifeq ($(HARDWARE_MOTHERBOARD),20) -HARDWARE_VARIANT ?= Sanguino +else ifeq ($(HARDWARE_MOTHERBOARD),51) +HARDWARE_VARIANT ?= Gen6 MCU ?= atmega644p -# -# Teensyduino - AT90USB1286, AT90USB1286P -# +#Sanguinololu +else ifeq ($(HARDWARE_MOTHERBOARD),6) +HARDWARE_VARIANT ?= Sanguino +MCU ?= atmega644p +else ifeq ($(HARDWARE_MOTHERBOARD),62) +HARDWARE_VARIANT ?= Sanguino +MCU ?= atmega644p +else ifeq ($(HARDWARE_MOTHERBOARD),63) +HARDWARE_VARIANT ?= Sanguino +MCU ?= atmega644p +else ifeq ($(HARDWARE_MOTHERBOARD),65) +HARDWARE_VARIANT ?= Sanguino +MCU ?= atmega1284p +else ifeq ($(HARDWARE_MOTHERBOARD),66) +HARDWARE_VARIANT ?= Sanguino +MCU ?= atmega1284p +else ifeq ($(HARDWARE_MOTHERBOARD),69) +HARDWARE_VARIANT ?= Sanguino +MCU ?= atmega1284p -# Teensylu -else ifeq ($(HARDWARE_MOTHERBOARD),8) +#Ultimaker +else ifeq ($(HARDWARE_MOTHERBOARD),7) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 +else ifeq ($(HARDWARE_MOTHERBOARD),71) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega1280 + +#Teensylu +else ifeq ($(HARDWARE_MOTHERBOARD),8) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb1286 -# Printrboard (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),81) +else ifeq ($(HARDWARE_MOTHERBOARD),81) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb1286 -# Printrboard Revision F (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),811) +else ifeq ($(HARDWARE_MOTHERBOARD),811) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb1286 -# Brainwave (AT90USB646) -else ifeq ($(HARDWARE_MOTHERBOARD),82) +else ifeq ($(HARDWARE_MOTHERBOARD),82) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb646 -# Brainwave Pro (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),83) +else ifeq ($(HARDWARE_MOTHERBOARD),83) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb1286 -# SAV Mk-I (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),84) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# Teensy++2.0 (AT90USB1286) - CLI compile: HARDWARE_MOTHERBOARD=84 make -else ifeq ($(HARDWARE_MOTHERBOARD),85) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# 5DPrint D8 Driver Board -else ifeq ($(HARDWARE_MOTHERBOARD),88) +else ifeq ($(HARDWARE_MOTHERBOARD),84) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb1286 +#Gen3+ +else ifeq ($(HARDWARE_MOTHERBOARD),9) +HARDWARE_VARIANT ?= Sanguino +MCU ?= atmega644p + +#Gen3 Monolithic Electronics +else ifeq ($(HARDWARE_MOTHERBOARD),22) +HARDWARE_VARIANT ?= Sanguino +MCU ?= atmega644p + +#Megatronics +else ifeq ($(HARDWARE_MOTHERBOARD),70) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 + +#Alpha OMCA board +else ifeq ($(HARDWARE_MOTHERBOARD),90) +HARDWARE_VARIANT ?= SanguinoA +MCU ?= atmega644 + +#Final OMCA board +else ifeq ($(HARDWARE_MOTHERBOARD),91) +HARDWARE_VARIANT ?= Sanguino +MCU ?= atmega644p + +#Rambo +else ifeq ($(HARDWARE_MOTHERBOARD),301) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 + +# Azteeg +else ifeq ($(HARDWARE_MOTHERBOARD),67) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 +else ifeq ($(HARDWARE_MOTHERBOARD),68) +HARDWARE_VARIANT ?= arduino +MCU ?= atmega2560 + endif # Be sure to regenerate speed_lookuptable.h with create_speed_lookuptable.py @@ -394,10 +250,6 @@ endif # Set to 16Mhz if not yet set. F_CPU ?= 16000000 -# Set to arduino, ATmega2560 if not yet set. -HARDWARE_VARIANT ?= arduino -MCU ?= atmega2560 - # Arduino contained the main source code for the Arduino # Libraries, the "hardware variant" are for boards # that derives from that, and their source are present in @@ -530,8 +382,9 @@ CSTANDARD = -std=gnu99 CXXSTANDARD = -std=gnu++11 CDEBUG = -g$(DEBUG) CWARN = -Wall -Wstrict-prototypes -CTUNING = -w -fsigned-char -funsigned-bitfields -fpack-struct \ - -fshort-enums -ffunction-sections -fdata-sections -flto \ +CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct \ + -fshort-enums -w -ffunction-sections -fdata-sections \ + -flto \ -DARDUINO=$(ARDUINO_VERSION) ifneq ($(HARDWARE_MOTHERBOARD),) CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD} diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 46037b8..2c68b8c 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -29,13 +29,14 @@ #include #include +#include #include #include #include "MarlinConfig.h" #ifdef DEBUG_GCODE_PARSER - #include "parser.h" + #include "gcode.h" #endif #include "enum.h" @@ -44,15 +45,19 @@ #include "utility.h" #include "serial.h" +#if ENABLED(PRINTCOUNTER) + #include "printcounter.h" +#else + #include "stopwatch.h" +#endif + void idle( #if ENABLED(ADVANCED_PAUSE_FEATURE) bool no_stepper_sleep = false // pass true to keep steppers from disabling on timeout #endif ); -void manage_inactivity(const bool ignore_stepper_queue=false); - -extern const char axis_codes[XYZE]; +void manage_inactivity(bool ignore_stepper_queue = false); #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) extern bool extruder_duplication_enabled; @@ -60,10 +65,10 @@ extern const char axis_codes[XYZE]; #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); CBI(axis_known_position, X_AXIS); }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() do{ X_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0) + #define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }while(0) #else #define enable_X() NOOP #define disable_X() NOOP @@ -71,10 +76,10 @@ extern const char axis_codes[XYZE]; #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); CBI(axis_known_position, Y_AXIS); }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); CBI(axis_known_position, Y_AXIS); }while(0) + #define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }while(0) #else #define enable_Y() NOOP #define disable_Y() NOOP @@ -82,10 +87,10 @@ extern const char axis_codes[XYZE]; #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); CBI(axis_known_position, Z_AXIS); }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); CBI(axis_known_position, Z_AXIS); }while(0) + #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }while(0) #else #define enable_Z() NOOP #define disable_Z() NOOP @@ -96,10 +101,7 @@ extern const char axis_codes[XYZE]; /** * Mixing steppers synchronize their enable (and direction) together */ - #if MIXING_STEPPERS > 4 - #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); E4_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); E4_ENABLE_WRITE(!E_ENABLE_ON); } - #elif MIXING_STEPPERS > 3 + #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 @@ -162,69 +164,31 @@ extern const char axis_codes[XYZE]; #endif // !MIXING_EXTRUDER -#if ENABLED(HANGPRINTER) - - #define enable_A() enable_X() - #define enable_B() enable_Y() - #define enable_C() enable_Z() - #define __D_ENABLE(p) E##p##_ENABLE_WRITE(E_ENABLE_ON) - #define _D_ENABLE(p) __D_ENABLE(p) - #define enable_D() _D_ENABLE(EXTRUDERS) - - // Don't allow any axes to be disabled - #undef disable_X - #undef disable_Y - #undef disable_Z - #define disable_X() NOOP - #define disable_Y() NOOP - #define disable_Z() NOOP - - #if EXTRUDERS >= 1 - #undef disable_E1 - #define disable_E1() NOOP - #if EXTRUDERS >= 2 - #undef disable_E2 - #define disable_E2() NOOP - #if EXTRUDERS >= 3 - #undef disable_E3 - #define disable_E3() NOOP - #if EXTRUDERS >= 4 - #undef disable_E4 - #define disable_E4() NOOP - #endif // EXTRUDERS >= 4 - #endif // EXTRUDERS >= 3 - #endif // EXTRUDERS >= 2 - #endif // EXTRUDERS >= 1 - -#endif // HANGPRINTER - #if ENABLED(G38_PROBE_TARGET) extern bool G38_move, // flag to tell the interrupt handler that a G38 command is being run G38_endstop_hit; // flag from the interrupt handler to indicate if the endstop went active #endif +/** + * The axis order in all axis related arrays is X, Y, Z, E + */ +#define _AXIS(AXIS) AXIS ##_AXIS + void enable_all_steppers(); -void disable_e_stepper(const uint8_t e); void disable_e_steppers(); void disable_all_steppers(); -void sync_plan_position(); -void sync_plan_position_e(); - -#if IS_KINEMATIC - void sync_plan_position_kinematic(); - #define SYNC_PLAN_POSITION_KINEMATIC() sync_plan_position_kinematic() -#else - #define SYNC_PLAN_POSITION_KINEMATIC() sync_plan_position() -#endif - -void flush_and_request_resend(); +void FlushSerialRequestResend(); void ok_to_send(); void kill(const char*); void quickstop_stepper(); +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + void handle_filament_runout(); +#endif + extern uint8_t marlin_debug_flags; #define DEBUGGING(F) (marlin_debug_flags & (DEBUG_## F)) @@ -232,58 +196,37 @@ extern bool Running; inline bool IsRunning() { return Running; } inline bool IsStopped() { return !Running; } -bool enqueue_and_echo_command(const char* cmd); // Add a single command to the end of the buffer. Return false on failure. -void enqueue_and_echo_commands_P(const char * const cmd); // Set one or more commands to be prioritized over the next Serial/SD command. +bool enqueue_and_echo_command(const char* cmd, bool say_ok=false); // Add a single command to the end of the buffer. Return false on failure. +void enqueue_and_echo_commands_P(const char * const cmd); // Set one or more commands to be prioritized over the next Serial/SD command. void clear_command_queue(); -#if ENABLED(M100_FREE_MEMORY_WATCHER) || ENABLED(POWER_LOSS_RECOVERY) - extern char command_queue[BUFSIZE][MAX_CMD_SIZE]; -#endif +extern millis_t previous_cmd_ms; +inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); } -#define HAS_LCD_QUEUE_NOW (ENABLED(MALYAN_LCD) || (ENABLED(ULTIPANEL) && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE)))) -#define HAS_QUEUE_NOW (ENABLED(SDSUPPORT) || HAS_LCD_QUEUE_NOW) -#if HAS_QUEUE_NOW - // Return only when commands are actually enqueued - void enqueue_and_echo_command_now(const char* cmd); - #if HAS_LCD_QUEUE_NOW - void enqueue_and_echo_commands_now_P(const char * const cmd); - #endif +#if ENABLED(FAST_PWM_FAN) + void setPwmFrequency(uint8_t pin, int val); #endif -extern millis_t previous_move_ms; -inline void reset_stepper_timeout() { previous_move_ms = millis(); } - /** * Feedrate scaling and conversion */ extern float feedrate_mm_s; extern int16_t feedrate_percentage; -#define MMS_SCALED(MM_S) ((MM_S)*feedrate_percentage*0.01f) - -extern bool axis_relative_modes[XYZE]; - -extern uint8_t axis_homed, axis_known_position; - -constexpr uint8_t xyz_bits = _BV(X_AXIS) | _BV(Y_AXIS) | _BV(Z_AXIS); -FORCE_INLINE bool all_axes_homed() { return (axis_homed & xyz_bits) == xyz_bits; } -FORCE_INLINE bool all_axes_known() { return (axis_known_position & xyz_bits) == xyz_bits; } +#define MMS_SCALED(MM_S) ((MM_S)*feedrate_percentage*0.01) +extern bool axis_relative_modes[]; +extern bool axis_known_position[XYZ]; +extern bool axis_homed[XYZ]; extern volatile bool wait_for_heatup; #if HAS_RESUME_CONTINUE extern volatile bool wait_for_user; #endif -#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - extern bool suspend_auto_report; -#endif - extern float current_position[XYZE], destination[XYZE]; -/** - * Workspace offsets - */ +// Workspace offsets #if HAS_WORKSPACE_OFFSET #if HAS_HOME_OFFSET extern float home_offset[XYZ]; @@ -291,26 +234,36 @@ extern float current_position[XYZE], destination[XYZE]; #if HAS_POSITION_SHIFT extern float position_shift[XYZ]; #endif - #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT - extern float workspace_offset[XYZ]; - #define WORKSPACE_OFFSET(AXIS) workspace_offset[AXIS] - #elif HAS_HOME_OFFSET - #define WORKSPACE_OFFSET(AXIS) home_offset[AXIS] - #elif HAS_POSITION_SHIFT - #define WORKSPACE_OFFSET(AXIS) position_shift[AXIS] - #endif - #define NATIVE_TO_LOGICAL(POS, AXIS) ((POS) + WORKSPACE_OFFSET(AXIS)) - #define LOGICAL_TO_NATIVE(POS, AXIS) ((POS) - WORKSPACE_OFFSET(AXIS)) -#else - #define NATIVE_TO_LOGICAL(POS, AXIS) (POS) - #define LOGICAL_TO_NATIVE(POS, AXIS) (POS) #endif -#define LOGICAL_X_POSITION(POS) NATIVE_TO_LOGICAL(POS, X_AXIS) -#define LOGICAL_Y_POSITION(POS) NATIVE_TO_LOGICAL(POS, Y_AXIS) -#define LOGICAL_Z_POSITION(POS) NATIVE_TO_LOGICAL(POS, Z_AXIS) -#define RAW_X_POSITION(POS) LOGICAL_TO_NATIVE(POS, X_AXIS) -#define RAW_Y_POSITION(POS) LOGICAL_TO_NATIVE(POS, Y_AXIS) -#define RAW_Z_POSITION(POS) LOGICAL_TO_NATIVE(POS, Z_AXIS) + +#if HAS_HOME_OFFSET && HAS_POSITION_SHIFT + extern float workspace_offset[XYZ]; + #define WORKSPACE_OFFSET(AXIS) workspace_offset[AXIS] +#elif HAS_HOME_OFFSET + #define WORKSPACE_OFFSET(AXIS) home_offset[AXIS] +#elif HAS_POSITION_SHIFT + #define WORKSPACE_OFFSET(AXIS) position_shift[AXIS] +#else + #define WORKSPACE_OFFSET(AXIS) 0 +#endif + +#define NATIVE_TO_LOGICAL(POS, AXIS) ((POS) + WORKSPACE_OFFSET(AXIS)) +#define LOGICAL_TO_NATIVE(POS, AXIS) ((POS) - WORKSPACE_OFFSET(AXIS)) + +#if HAS_POSITION_SHIFT || DISABLED(DELTA) + #define LOGICAL_X_POSITION(POS) NATIVE_TO_LOGICAL(POS, X_AXIS) + #define LOGICAL_Y_POSITION(POS) NATIVE_TO_LOGICAL(POS, Y_AXIS) + #define RAW_X_POSITION(POS) LOGICAL_TO_NATIVE(POS, X_AXIS) + #define RAW_Y_POSITION(POS) LOGICAL_TO_NATIVE(POS, Y_AXIS) +#else + #define LOGICAL_X_POSITION(POS) (POS) + #define LOGICAL_Y_POSITION(POS) (POS) + #define RAW_X_POSITION(POS) (POS) + #define RAW_Y_POSITION(POS) (POS) +#endif + +#define LOGICAL_Z_POSITION(POS) NATIVE_TO_LOGICAL(POS, Z_AXIS) +#define RAW_Z_POSITION(POS) LOGICAL_TO_NATIVE(POS, Z_AXIS) // Hotend Offsets #if HOTENDS > 1 @@ -332,24 +285,16 @@ extern float soft_endstop_min[XYZ], soft_endstop_max[XYZ]; void update_software_endstops(const AxisEnum axis); #endif -#define MAX_COORDINATE_SYSTEMS 9 #if ENABLED(CNC_COORDINATE_SYSTEMS) + #define MAX_COORDINATE_SYSTEMS 9 extern float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; bool select_coordinate_system(const int8_t _new); #endif -void tool_change(const uint8_t tmp_extruder, const float fr_mm_s=0.0, bool no_move=false); - -void home_all_axes(); - void report_current_position(); #if IS_KINEMATIC - #if ENABLED(HANGPRINTER) - extern float line_lengths[ABCD]; - #else - extern float delta[ABC]; - #endif + extern float delta[ABC]; void inverse_kinematics(const float raw[XYZ]); #endif @@ -368,65 +313,27 @@ void report_current_position(); void recalc_delta_settings(); float delta_safe_distance_from_top(); + #if ENABLED(DELTA_FAST_SQRT) + float Q_rsqrt(const float number); + #define _SQRT(n) (1.0f / Q_rsqrt(n)) + #else + #define _SQRT(n) SQRT(n) + #endif + // Macro to obtain the Z position of an individual tower - #define DELTA_Z(V,T) V[Z_AXIS] + SQRT( \ + #define DELTA_Z(V,T) V[Z_AXIS] + _SQRT( \ delta_diagonal_rod_2_tower[T] - HYPOT2( \ delta_tower[T][X_AXIS] - V[X_AXIS], \ delta_tower[T][Y_AXIS] - V[Y_AXIS] \ ) \ ) - #define DELTA_IK(V) do { \ + #define DELTA_IK(V) do { \ delta[A_AXIS] = DELTA_Z(V, A_AXIS); \ delta[B_AXIS] = DELTA_Z(V, B_AXIS); \ delta[C_AXIS] = DELTA_Z(V, C_AXIS); \ }while(0) -#elif ENABLED(HANGPRINTER) - - // Don't collect anchor positions in array because there are no A_x, D_x or D_y - extern float anchor_A_y, - anchor_A_z, - anchor_B_x, - anchor_B_y, - anchor_B_z, - anchor_C_x, - anchor_C_y, - anchor_C_z, - anchor_D_z, - delta_segments_per_second, - line_lengths_origin[ABCD]; - - void recalc_hangprinter_settings(); - - #define HANGPRINTER_IK(V) do { \ - line_lengths[A_AXIS] = SQRT(sq(anchor_A_z - V[Z_AXIS]) \ - + sq(anchor_A_y - V[Y_AXIS]) \ - + sq( V[X_AXIS])); \ - line_lengths[B_AXIS] = SQRT(sq(anchor_B_z - V[Z_AXIS]) \ - + sq(anchor_B_y - V[Y_AXIS]) \ - + sq(anchor_B_x - V[X_AXIS])); \ - line_lengths[C_AXIS] = SQRT(sq(anchor_C_z - V[Z_AXIS]) \ - + sq(anchor_C_y - V[Y_AXIS]) \ - + sq(anchor_C_x - V[X_AXIS])); \ - line_lengths[D_AXIS] = SQRT(sq( V[X_AXIS]) \ - + sq( V[Y_AXIS]) \ - + sq(anchor_D_z - V[Z_AXIS])); \ - }while(0) - - // Inverse kinematics at origin - #define HANGPRINTER_IK_ORIGIN(LL) do { \ - LL[A_AXIS] = SQRT(sq(anchor_A_z) \ - + sq(anchor_A_y)); \ - LL[B_AXIS] = SQRT(sq(anchor_B_z) \ - + sq(anchor_B_y) \ - + sq(anchor_B_x)); \ - LL[C_AXIS] = SQRT(sq(anchor_C_z) \ - + sq(anchor_C_y) \ - + sq(anchor_C_x)); \ - LL[D_AXIS] = anchor_D_z; \ - }while(0) - #elif IS_SCARA void forward_kinematics_SCARA(const float &a, const float &b); #endif @@ -455,9 +362,9 @@ void report_current_position(); float bilinear_z_offset(const float raw[XYZ]); #endif -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(MESH_BED_LEVELING) - typedef float (*element_2d_fn)(const uint8_t, const uint8_t); - void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, const element_2d_fn fn); +#if ENABLED(AUTO_BED_LEVELING_UBL) + typedef struct { double A, B, D; } linear_fit; + linear_fit* lsf_linear_fit(double x[], double y[], double z[], const int); #endif #if HAS_LEVELING @@ -470,19 +377,18 @@ void report_current_position(); void set_z_fade_height(const float zfh, const bool do_report=true); #endif +#if ENABLED(X_DUAL_ENDSTOPS) + extern float x_endstop_adj; +#endif +#if ENABLED(Y_DUAL_ENDSTOPS) + extern float y_endstop_adj; +#endif +#if ENABLED(Z_DUAL_ENDSTOPS) + extern float z_endstop_adj; +#endif + #if HAS_BED_PROBE extern float zprobe_zoffset; - bool set_probe_deployed(const bool deploy); - #ifdef Z_AFTER_PROBING - void move_z_after_probing(); - #endif - enum ProbePtRaise : unsigned char { - PROBE_PT_NONE, // No raise or stow after run_z_probe - PROBE_PT_STOW, // Do a complete stow after run_z_probe - PROBE_PT_RAISE, // Raise to "between" clearance after run_z_probe - PROBE_PT_BIG_RAISE // Raise to big clearance after run_z_probe - }; - float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true); #define DEPLOY_PROBE() set_probe_deployed(true) #define STOW_PROBE() set_probe_deployed(false) #else @@ -509,10 +415,6 @@ void report_current_position(); #endif #endif -#if ENABLED(USE_CONTROLLER_FAN) - extern int controllerFanSpeed; -#endif - #if ENABLED(BARICUDA) extern uint8_t baricuda_valve_pressure, baricuda_e_to_p_pressure; #endif @@ -527,16 +429,30 @@ void report_current_position(); #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) - extern int8_t did_pause_print; extern AdvancedPauseMenuResponse advanced_pause_menu_response; - extern float filament_change_unload_length[EXTRUDERS], - filament_change_load_length[EXTRUDERS]; #endif -#if HAS_POWER_SWITCH - extern bool powersupply_on; - #define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PS_ON_AWAKE); powersupply_on = true; }while(0) - #define PSU_PIN_OFF() do{ OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); powersupply_on = false; }while(0) +#if ENABLED(PID_EXTRUSION_SCALING) + extern int lpq_len; +#endif + +#if ENABLED(FWRETRACT) + extern bool autoretract_enabled; // M209 S - Autoretract switch + extern float retract_length, // M207 S - G10 Retract length + retract_feedrate_mm_s, // M207 F - G10 Retract feedrate + retract_zlift, // M207 Z - G10 Retract hop size + retract_recover_length, // M208 S - G11 Recover length + retract_recover_feedrate_mm_s, // M208 F - G11 Recover feedrate + swap_retract_length, // M207 W - G10 Swap Retract length + swap_retract_recover_length, // M208 W - G11 Swap Recover length + swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate +#endif + +// Print job timer +#if ENABLED(PRINTCOUNTER) + extern PrintCounter print_job_timer; +#else + extern Stopwatch print_job_timer; #endif // Handling multiple extruders pins @@ -553,14 +469,10 @@ void prepare_move_to_destination(); /** * Blocking movement and shorthand functions */ -void do_blocking_move_to(const float rx, const float ry, const float rz, const float &fr_mm_s=0); -void do_blocking_move_to_x(const float &rx, const float &fr_mm_s=0); -void do_blocking_move_to_z(const float &rz, const float &fr_mm_s=0); -void do_blocking_move_to_xy(const float &rx, const float &ry, const float &fr_mm_s=0); - -#if ENABLED(ARC_SUPPORT) - void plan_arc(const float(&cart)[XYZE], const float(&offset)[2], const bool clockwise); -#endif +void do_blocking_move_to(const float &x, const float &y, const float &z, const float &fr_mm_s=0.0); +void do_blocking_move_to_x(const float &x, const float &fr_mm_s=0.0); +void do_blocking_move_to_z(const float &z, const float &fr_mm_s=0.0); +void do_blocking_move_to_xy(const float &x, const float &y, const float &fr_mm_s=0.0); #define HAS_AXIS_UNHOMED_ERR ( \ ENABLED(Z_PROBE_ALLEN_KEY) \ @@ -587,61 +499,44 @@ void do_blocking_move_to_xy(const float &rx, const float &ry, const float &fr_mm extern const float L1, L2; #endif - // Return true if the given point is within the printable area - inline bool position_is_reachable(const float &rx, const float &ry, const float inset=0) { + inline bool position_is_reachable(const float &rx, const float &ry) { #if ENABLED(DELTA) - return HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS - inset); - #elif ENABLED(HANGPRINTER) - // TODO: This is over simplified. Hangprinter's build volume is _not_ cylindrical. - return HYPOT2(rx, ry) <= sq(HANGPRINTER_PRINTABLE_RADIUS - inset); + return HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS); #elif IS_SCARA - const float R2 = HYPOT2(rx - SCARA_OFFSET_X, ry - SCARA_OFFSET_Y); - return ( - R2 <= sq(L1 + L2) - inset - #if MIDDLE_DEAD_ZONE_R > 0 - && R2 >= sq(float(MIDDLE_DEAD_ZONE_R)) - #endif - ); + #if MIDDLE_DEAD_ZONE_R > 0 + const float R2 = HYPOT2(rx - SCARA_OFFSET_X, ry - SCARA_OFFSET_Y); + return R2 >= sq(float(MIDDLE_DEAD_ZONE_R)) && R2 <= sq(L1 + L2); + #else + return HYPOT2(rx - SCARA_OFFSET_X, ry - SCARA_OFFSET_Y) <= sq(L1 + L2); + #endif + #else // CARTESIAN + // To be migrated from MakerArm branch in future #endif } - #if HAS_BED_PROBE - // Return true if the both nozzle and the probe can reach the given point. - // Note: This won't work on SCARA since the probe offset rotates with the arm. - inline bool position_is_reachable_by_probe(const float &rx, const float &ry) { - return position_is_reachable(rx - (X_PROBE_OFFSET_FROM_EXTRUDER), ry - (Y_PROBE_OFFSET_FROM_EXTRUDER)) - && position_is_reachable(rx, ry, ABS(MIN_PROBE_EDGE)); - } - #endif + inline bool position_is_reachable_by_probe(const float &rx, const float &ry) { + + // Both the nozzle and the probe must be able to reach the point. + // This won't work on SCARA since the probe offset rotates with the arm. + + return position_is_reachable(rx, ry) + && position_is_reachable(rx - (X_PROBE_OFFSET_FROM_EXTRUDER), ry - (Y_PROBE_OFFSET_FROM_EXTRUDER)); + } #else // CARTESIAN - // Return true if the given position is within the machine bounds. inline bool position_is_reachable(const float &rx, const float &ry) { - // Add 0.001 margin to deal with float imprecision - return WITHIN(rx, X_MIN_POS - 0.001f, X_MAX_POS + 0.001f) - && WITHIN(ry, Y_MIN_POS - 0.001f, Y_MAX_POS + 0.001f); + // Add 0.001 margin to deal with float imprecision + return WITHIN(rx, X_MIN_POS - 0.001, X_MAX_POS + 0.001) + && WITHIN(ry, Y_MIN_POS - 0.001, Y_MAX_POS + 0.001); } - #if HAS_BED_PROBE - /** - * Return whether the given position is within the bed, and whether the nozzle - * can reach the position required to put the probe at the given position. - * - * Example: For a probe offset of -10,+10, then for the probe to reach 0,0 the - * nozzle must be be able to reach +10,-10. - */ - inline bool position_is_reachable_by_probe(const float &rx, const float &ry) { - return position_is_reachable(rx - (X_PROBE_OFFSET_FROM_EXTRUDER), ry - (Y_PROBE_OFFSET_FROM_EXTRUDER)) - && WITHIN(rx, MIN_PROBE_X - 0.001f, MAX_PROBE_X + 0.001f) - && WITHIN(ry, MIN_PROBE_Y - 0.001f, MAX_PROBE_Y + 0.001f); - } - #endif + inline bool position_is_reachable_by_probe(const float &rx, const float &ry) { + // Add 0.001 margin to deal with float imprecision + return WITHIN(rx, MIN_PROBE_X - 0.001, MAX_PROBE_X + 0.001) + && WITHIN(ry, MIN_PROBE_Y - 0.001, MAX_PROBE_Y + 0.001); + } #endif // CARTESIAN -#if !HAS_BED_PROBE - FORCE_INLINE bool position_is_reachable_by_probe(const float &rx, const float &ry) { return position_is_reachable(rx, ry); } -#endif - #endif // MARLIN_H diff --git a/Marlin/Marlin.ino b/Marlin/Marlin.ino index e18a07b..49b6fd1 100644 --- a/Marlin/Marlin.ino +++ b/Marlin/Marlin.ino @@ -1,53 +1,72 @@ -/* -================================================================================ +/** + * 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 . + * + */ - Marlin Firmware +/** + * About Marlin + * + * This firmware is a mashup between Sprinter and grbl. + * - https://github.com/kliment/Sprinter + * - https://github.com/simen/grbl/tree + */ - (c) 2011-2018 MarlinFirmware - Portions of Marlin are (c) by their respective authors. - All code complies with GPLv2 and/or GPLv3 +#include "MarlinConfig.h" -================================================================================ +#if ENABLED(ULTRA_LCD) + #if ENABLED(LCD_I2C_TYPE_PCF8575) + #include + #include + #elif ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008) + #include + #include + #elif ENABLED(LCM1602) + #include + #include + #include + #elif ENABLED(DOGLCD) + #include // library for graphics LCD by Oli Kraus (https://github.com/olikraus/U8glib_Arduino) + #else + #include // library for character LCD + #endif +#endif -Greetings! Thank you for choosing Marlin as your 3D printer firmware. +#if HAS_DIGIPOTSS + #include +#endif -To configure Marlin you must edit Configuration.h and Configuration_adv.h -located in the root 'Marlin' folder. Check the example_configurations folder to -see if there's a more suitable starting-point for your specific hardware. +#if ENABLED(DIGIPOT_I2C) + #include +#endif -Before diving in, we recommend the following essential links: +#if ENABLED(HAVE_TMCDRIVER) + #include + #include +#endif -Marlin Firmware Official Website +#if ENABLED(HAVE_TMC2130) + #include + #include +#endif - - http://marlinfw.org/ - The official Marlin Firmware website contains the most up-to-date - documentation. Contributions are always welcome! - -Configuration - - - https://www.youtube.com/watch?v=3gwWVFtdg-4 - A good 20-minute overview of Marlin configuration by Tom Sanladerer. - (Applies to Marlin 1.0.x, so Jerk and Acceleration should be halved.) - Also... https://www.google.com/search?tbs=vid%3A1&q=configure+marlin - - - http://marlinfw.org/docs/configuration/configuration.html - Marlin's configuration options are explained in more detail here. - -Getting Help - - - http://forums.reprap.org/list.php?415 - The Marlin Discussion Forum is a great place to get help from other Marlin - users who may have experienced similar issues to your own. - - - https://github.com/MarlinFirmware/Marlin/issues - With a free GitHub account you can provide us with feedback, bug reports, - and feature requests via the Marlin Issue Queue. - -Contributing - - - http://marlinfw.org/docs/development/contributing.html - If you'd like to contribute to Marlin, read this first! - - - http://marlinfw.org/docs/development/coding_standards.html - Before submitting code get to know the Coding Standards. -*/ +#if ENABLED(HAVE_L6470DRIVER) + #include + #include +#endif diff --git a/Marlin/MarlinConfig.h b/Marlin/MarlinConfig.h index e1988fe..fdab3d4 100644 --- a/Marlin/MarlinConfig.h +++ b/Marlin/MarlinConfig.h @@ -23,26 +23,20 @@ #ifndef MARLIN_CONFIG_H #define MARLIN_CONFIG_H -#include "boards.h" +#include "fastio.h" #include "macros.h" +#include "boards.h" #include "Version.h" #include "Configuration.h" #include "Conditionals_LCD.h" -#include "drivers.h" +#include "tmc_macros.h" #include "Configuration_adv.h" - -#if USE_MARLINSERIAL +#include "pins.h" +#ifndef USBCON #define HardwareSerial_h // trick to disable the standard HWserial #endif - -#include "types.h" -#include "HAL.h" -#include "pins.h" +#include "Arduino.h" #include "Conditionals_post.h" #include "SanityCheck.h" -#include "enum.h" -#include "language.h" -#include "utility.h" -#include "serial.h" #endif // MARLIN_CONFIG_H diff --git a/Marlin/MarlinSPI.h b/Marlin/MarlinSPI.h index 61e85fc..93f9fb2 100644 --- a/Marlin/MarlinSPI.h +++ b/Marlin/MarlinSPI.h @@ -48,7 +48,7 @@ class SPI { } FORCE_INLINE static uint8_t receive() { SPDR = 0; - while (!TEST(SPSR, SPIF)) { /* nada */ } + for (;!TEST(SPSR, SPIF);); return SPDR; } diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index 86d4c44..896db69 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -28,14 +28,13 @@ * Modified 28 September 2010 by Mark Sproul * Modified 14 February 2016 by Andreas Hardtung (added tx buffer) * Modified 01 October 2017 by Eduardo José Tagle (added XON/XOFF) - * Modified 10 June 2018 by Eduardo José Tagle (See #10991) */ // Disable HardwareSerial.cpp to support chips without a UART (Attiny, etc.) #include "MarlinConfig.h" -#if USE_MARLINSERIAL && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)) +#if !defined(USBCON) && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)) #include "MarlinSerial.h" #include "Marlin.h" @@ -56,15 +55,16 @@ 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 - static bool _written; #endif #if ENABLED(SERIAL_XON_XOFF) - constexpr uint8_t XON_XOFF_CHAR_SENT = 0x80, // XON / XOFF Character was sent - XON_XOFF_CHAR_MASK = 0x1F; // XON / XOFF character to send + constexpr uint8_t XON_XOFF_CHAR_SENT = 0x80; // XON / XOFF Character was sent + constexpr uint8_t XON_XOFF_CHAR_MASK = 0x1F; // XON / XOFF character to send // XON / XOFF character definitions - constexpr uint8_t XON_CHAR = 17, XOFF_CHAR = 19; + constexpr uint8_t XON_CHAR = 17; + constexpr uint8_t XOFF_CHAR = 19; uint8_t xon_xoff_state = XON_XOFF_CHAR_SENT | XON_CHAR; #endif @@ -72,296 +72,209 @@ uint8_t rx_dropped_bytes = 0; #endif - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - uint8_t rx_buffer_overruns = 0; - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - uint8_t rx_framing_errors = 0; - #endif - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) ring_buffer_pos_t rx_max_enqueued = 0; #endif - // A SW memory barrier, to ensure GCC does not overoptimize loops - #define sw_barrier() asm volatile("": : :"memory"); - #if ENABLED(EMERGENCY_PARSER) - #include "emergency_parser.h" - #endif - // "Atomically" read the RX head index value without disabling interrupts: - // This MUST be called with RX interrupts enabled, and CAN'T be called - // from the RX ISR itself! - FORCE_INLINE ring_buffer_pos_t atomic_read_rx_head() { - #if RX_BUFFER_SIZE > 256 - // Keep reading until 2 consecutive reads return the same value, - // meaning there was no update in-between caused by an interrupt. - // This works because serial RX interrupts happen at a slower rate - // than successive reads of a variable, so 2 consecutive reads with - // the same value means no interrupt updated it. - ring_buffer_pos_t vold, vnew = rx_buffer.head; - sw_barrier(); - do { - vold = vnew; - vnew = rx_buffer.head; - sw_barrier(); - } while (vold != vnew); - return vnew; - #else - // With an 8bit index, reads are always atomic. No need for special handling - return rx_buffer.head; - #endif - } + #include "stepper.h" + #include "language.h" - #if RX_BUFFER_SIZE > 256 - static volatile bool rx_tail_value_not_stable = false; - static volatile uint16_t rx_tail_value_backup = 0; - #endif + // Currently looking for: M108, M112, M410 + // If you alter the parser please don't forget to update the capabilities in Conditionals_post.h - // Set RX tail index, taking into account the RX ISR could interrupt - // the write to this variable in the middle - So a backup strategy - // is used to ensure reads of the correct values. - // -Must NOT be called from the RX ISR - - FORCE_INLINE void atomic_set_rx_tail(ring_buffer_pos_t value) { - #if RX_BUFFER_SIZE > 256 - // Store the new value in the backup - rx_tail_value_backup = value; - sw_barrier(); - // Flag we are about to change the true value - rx_tail_value_not_stable = true; - sw_barrier(); - // Store the new value - rx_buffer.tail = value; - sw_barrier(); - // Signal the new value is completely stored into the value - rx_tail_value_not_stable = false; - sw_barrier(); - #else - rx_buffer.tail = value; - #endif - } + FORCE_INLINE void emergency_parser(const unsigned char c) { - // Get the RX tail index, taking into account the read could be - // interrupting in the middle of the update of that index value - // -Called from the RX ISR - - FORCE_INLINE ring_buffer_pos_t atomic_read_rx_tail() { - #if RX_BUFFER_SIZE > 256 - // If the true index is being modified, return the backup value - if (rx_tail_value_not_stable) return rx_tail_value_backup; - #endif - // The true index is stable, return it - return rx_buffer.tail; - } + 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_user = 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 // EMERGENCY_PARSER - // (called with RX interrupts disabled) FORCE_INLINE void store_rxd_char() { - // Get the tail - Nothing can alter its value while this ISR is executing, but there's - // a chance that this ISR interrupted the main process while it was updating the index. - // The backup mechanism ensures the correct value is always returned. - const ring_buffer_pos_t t = atomic_read_rx_tail(); - - // Get the head pointer - This ISR is the only one that modifies its value, so it's safe to read here - ring_buffer_pos_t h = rx_buffer.head; - - // Get the next element - ring_buffer_pos_t i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - - // This must read the M_UCSRxA register before reading the received byte to detect error causes - #if ENABLED(SERIAL_STATS_DROPPED_RX) - if (TEST(M_UCSRxA, M_DORx) && !++rx_dropped_bytes) --rx_dropped_bytes; - #endif - - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - if (TEST(M_UCSRxA, M_DORx) && !++rx_buffer_overruns) --rx_buffer_overruns; - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - if (TEST(M_UCSRxA, M_FEx) && !++rx_framing_errors) --rx_framing_errors; - #endif - - // Read the character from the USART - uint8_t c = M_UDRx; - - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(c); - #endif + const ring_buffer_pos_t h = rx_buffer.head, + i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the RX FIFO is - // full, so don't write the character or advance the head. - if (i != t) { + // (such that the head would advance to the current tail), the buffer is + // critical, so don't write the character or advance the head. + const char c = M_UDRx; + if (i != rx_buffer.tail) { rx_buffer.buffer[h] = c; - h = i; + rx_buffer.head = i; + } + else { + #if ENABLED(SERIAL_STATS_DROPPED_RX) + if (!++rx_dropped_bytes) ++rx_dropped_bytes; + #endif } - #if ENABLED(SERIAL_STATS_DROPPED_RX) - else if (!++rx_dropped_bytes) --rx_dropped_bytes; - #endif #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - // Calculate count of bytes stored into the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - + // calculate count of bytes stored into the RX buffer + ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(rx_buffer.head - rx_buffer.tail) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); // Keep track of the maximum count of enqueued bytes NOLESS(rx_max_enqueued, rx_count); #endif #if ENABLED(SERIAL_XON_XOFF) - // If the last char that was sent was an XON + + // for high speed transfers, we can use XON/XOFF protocol to do + // software handshake and avoid overruns. if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XON_CHAR) { - // Bytes stored into the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); + // calculate count of bytes stored into the RX buffer + ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(rx_buffer.head - rx_buffer.tail) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - // If over 12.5% of RX buffer capacity, send XOFF before running out of - // RX buffer space .. 325 bytes @ 250kbits/s needed to let the host react - // and stop sending bytes. This translates to 13mS propagation time. + // if we are above 12.5% of RX buffer capacity, send XOFF before + // we run out of RX buffer space .. We need 325 bytes @ 250kbits/s to + // let the host react and stop sending bytes. This translates to 13mS + // propagation time. if (rx_count >= (RX_BUFFER_SIZE) / 8) { - - // At this point, definitely no TX interrupt was executing, since the TX ISR can't be preempted. - // Don't enable the TX interrupt here as a means to trigger the XOFF char, because if it happens - // to be in the middle of trying to disable the RX interrupt in the main program, eventually the - // enabling of the TX interrupt could be undone. The ONLY reliable thing this can do to ensure - // the sending of the XOFF char is to send it HERE AND NOW. - - // About to send the XOFF char - xon_xoff_state = XOFF_CHAR | XON_XOFF_CHAR_SENT; - - // Wait until the TX register becomes empty and send it - Here there could be a problem - // - While waiting for the TX register to empty, the RX register could receive a new - // character. This must also handle that situation! - while (!TEST(M_UCSRxA, M_UDREx)) { - - if (TEST(M_UCSRxA,M_RXCx)) { - // A char arrived while waiting for the TX buffer to be empty - Receive and process it! - - i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - - // Read the character from the USART - c = M_UDRx; - - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(c); - #endif - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - #if ENABLED(SERIAL_STATS_DROPPED_RX) - else if (!++rx_dropped_bytes) --rx_dropped_bytes; - #endif - } - sw_barrier(); + // If TX interrupts are disabled and 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 (!TEST(M_UCSRxB, M_UDRIEx) && TEST(M_UCSRxA, M_UDREx)) { + // Send an XOFF character + M_UDRx = XOFF_CHAR; + // 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); + // And remember it was sent + xon_xoff_state = XOFF_CHAR | XON_XOFF_CHAR_SENT; } - - M_UDRx = XOFF_CHAR; - - // 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); - - // At this point there could be a race condition between the write() function - // and this sending of the XOFF char. This interrupt could happen between the - // wait to be empty TX buffer loop and the actual write of the character. Since - // the TX buffer is full because it's sending the XOFF char, the only way to be - // sure the write() function will succeed is to wait for the XOFF char to be - // completely sent. Since an extra character could be received during the wait - // it must also be handled! - while (!TEST(M_UCSRxA, M_UDREx)) { - - if (TEST(M_UCSRxA,M_RXCx)) { - // A char arrived while waiting for the TX buffer to be empty - Receive and process it! - - i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - - // Read the character from the USART - c = M_UDRx; - - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(c); - #endif - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - #if ENABLED(SERIAL_STATS_DROPPED_RX) - else if (!++rx_dropped_bytes) --rx_dropped_bytes; - #endif - } - sw_barrier(); + else { + // TX interrupts disabled, but buffer still not empty ... or + // TX interrupts enabled. Reenable TX ints and schedule XOFF + // character to be sent + #if TX_BUFFER_SIZE > 0 + SBI(M_UCSRxB, M_UDRIEx); + xon_xoff_state = XOFF_CHAR; + #else + // We are not using TX interrupts, we will have to send this manually + while (!TEST(M_UCSRxA, M_UDREx)) {/* nada */} + M_UDRx = XOFF_CHAR; + // And remember we already sent it + xon_xoff_state = XOFF_CHAR | XON_XOFF_CHAR_SENT; + #endif } - - // At this point everything is ready. The write() function won't - // have any issues writing to the UART TX register if it needs to! } } #endif // SERIAL_XON_XOFF - // Store the new head value - The main loop will retry until the value is stable - rx_buffer.head = h; + #if ENABLED(EMERGENCY_PARSER) + emergency_parser(c); + #endif } #if TX_BUFFER_SIZE > 0 - // (called with TX irqs disabled) FORCE_INLINE void _tx_udr_empty_irq(void) { - - // Read positions - uint8_t t = tx_buffer.tail; - const uint8_t h = tx_buffer.head; + // If interrupts are enabled, there must be more data in the output + // buffer. #if ENABLED(SERIAL_XON_XOFF) - // If an XON char is pending to be sent, do it now - if (xon_xoff_state == XON_CHAR) { - - // Send the character - M_UDRx = XON_CHAR; - - // 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); - - // Remember we sent it. - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - - // If nothing else to transmit, just disable TX interrupts. - if (h == t) CBI(M_UCSRxB, M_UDRIEx); // (Non-atomic, could be reenabled by the main program, but eventually this will succeed) - - return; + // Do a priority insertion of an XON/XOFF char, if needed. + const uint8_t state = xon_xoff_state; + if (!(state & XON_XOFF_CHAR_SENT)) { + M_UDRx = state & XON_XOFF_CHAR_MASK; + xon_xoff_state = state | XON_XOFF_CHAR_SENT; } + else #endif - - // If nothing to transmit, just disable TX interrupts. This could - // happen as the result of the non atomicity of the disabling of RX - // interrupts that could end reenabling TX interrupts as a side effect. - if (h == t) { - CBI(M_UCSRxB, M_UDRIEx); // (Non-atomic, could be reenabled by the main program, but eventually this will succeed) - return; + { // Send the next byte + const uint8_t t = tx_buffer.tail, c = tx_buffer.buffer[t]; + tx_buffer.tail = (t + 1) & (TX_BUFFER_SIZE - 1); + M_UDRx = c; } - // There is something to TX, Send the next byte - const uint8_t c = tx_buffer.buffer[t]; - t = (t + 1) & (TX_BUFFER_SIZE - 1); - M_UDRx = c; - tx_buffer.tail = t; - - // Clear the TXC bit (by writing a one to its bit location). - // Ensures flush() won't return until the bytes are actually written/ + // 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); - // Disable interrupts if there is nothing to transmit following this byte - if (h == t) CBI(M_UCSRxB, M_UDRIEx); // (Non-atomic, could be reenabled by the main program, but eventually this will succeed) + // Disable interrupts if the buffer is empty + if (tx_buffer.head == tx_buffer.tail) + CBI(M_UCSRxB, M_UDRIEx); } #ifdef M_USARTx_UDRE_vect @@ -405,8 +318,8 @@ SBI(M_UCSRxB, M_RXCIEx); #if TX_BUFFER_SIZE > 0 CBI(M_UCSRxB, M_UDRIEx); + _written = false; #endif - _written = false; } void MarlinSerial::end() { @@ -416,179 +329,176 @@ CBI(M_UCSRxB, M_UDRIEx); } + void MarlinSerial::checkRx(void) { + if (TEST(M_UCSRxA, M_RXCx)) { + CRITICAL_SECTION_START; + store_rxd_char(); + CRITICAL_SECTION_END; + } + } + int MarlinSerial::peek(void) { - const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail; - return h == t ? -1 : rx_buffer.buffer[t]; + CRITICAL_SECTION_START; + const int v = rx_buffer.head == rx_buffer.tail ? -1 : rx_buffer.buffer[rx_buffer.tail]; + CRITICAL_SECTION_END; + return v; } int MarlinSerial::read(void) { - const ring_buffer_pos_t h = atomic_read_rx_head(); + int v; + CRITICAL_SECTION_START; + const ring_buffer_pos_t t = rx_buffer.tail; + if (rx_buffer.head == t) + v = -1; + else { + v = rx_buffer.buffer[t]; + rx_buffer.tail = (ring_buffer_pos_t)(t + 1) & (RX_BUFFER_SIZE - 1); - // Read the tail. Main thread owns it, so it is safe to directly read it - ring_buffer_pos_t t = rx_buffer.tail; - - // If nothing to read, return now - if (h == t) return -1; - - // Get the next char - const int v = rx_buffer.buffer[t]; - t = (ring_buffer_pos_t)(t + 1) & (RX_BUFFER_SIZE - 1); - - // Advance tail - Making sure the RX ISR will always get an stable value, even - // if it interrupts the writing of the value of that variable in the middle. - atomic_set_rx_tail(t); - - #if ENABLED(SERIAL_XON_XOFF) - // If the XOFF char was sent, or about to be sent... - if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XOFF_CHAR) { - // Get count of bytes in the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - if (rx_count < (RX_BUFFER_SIZE) / 10) { - #if TX_BUFFER_SIZE > 0 - // Signal we want an XON character to be sent. - xon_xoff_state = XON_CHAR; - // Enable TX ISR. Non atomic, but it will eventually enable them - SBI(M_UCSRxB, M_UDRIEx); - #else - // If not using TX interrupts, we must send the XON char now - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - while (!TEST(M_UCSRxA, M_UDREx)) sw_barrier(); - M_UDRx = XON_CHAR; - #endif - } + #if ENABLED(SERIAL_XON_XOFF) + if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XOFF_CHAR) { + // Get count of bytes in the RX buffer + ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(rx_buffer.head - rx_buffer.tail) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); + // When below 10% of RX buffer capacity, send XON before + // running out of RX buffer bytes + if (rx_count < (RX_BUFFER_SIZE) / 10) { + xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; + CRITICAL_SECTION_END; // End critical section before returning! + writeNoHandshake(XON_CHAR); + return v; + } + } + #endif } - #endif - + CRITICAL_SECTION_END; return v; } ring_buffer_pos_t MarlinSerial::available(void) { - const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail; + CRITICAL_SECTION_START; + const ring_buffer_pos_t h = rx_buffer.head, t = rx_buffer.tail; + CRITICAL_SECTION_END; return (ring_buffer_pos_t)(RX_BUFFER_SIZE + h - t) & (RX_BUFFER_SIZE - 1); } void MarlinSerial::flush(void) { - - // Set the tail to the head: - // - Read the RX head index in a safe way. (See atomic_read_rx_head.) - // - Set the tail, making sure the RX ISR will always get a stable value, even - // if it interrupts the writing of the value of that variable in the middle. - atomic_set_rx_tail(atomic_read_rx_head()); + // Don't change this order of operations. If the RX interrupt occurs between + // reading rx_buffer_head and updating rx_buffer_tail, the previous rx_buffer_head + // may be written to rx_buffer_tail, making the buffer appear full rather than empty. + CRITICAL_SECTION_START; + rx_buffer.head = rx_buffer.tail; + CRITICAL_SECTION_END; #if ENABLED(SERIAL_XON_XOFF) - // If the XOFF char was sent, or about to be sent... if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XOFF_CHAR) { - #if TX_BUFFER_SIZE > 0 - // Signal we want an XON character to be sent. - xon_xoff_state = XON_CHAR; - // Enable TX ISR. Non atomic, but it will eventually enable it. - SBI(M_UCSRxB, M_UDRIEx); - #else - // If not using TX interrupts, we must send the XON char now - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - while (!TEST(M_UCSRxA, M_UDREx)) sw_barrier(); - M_UDRx = XON_CHAR; - #endif + xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; + writeNoHandshake(XON_CHAR); } #endif } #if TX_BUFFER_SIZE > 0 + uint8_t MarlinSerial::availableForWrite(void) { + CRITICAL_SECTION_START; + const uint8_t h = tx_buffer.head, t = tx_buffer.tail; + CRITICAL_SECTION_END; + return (uint8_t)(TX_BUFFER_SIZE + h - t) & (TX_BUFFER_SIZE - 1); + } + void MarlinSerial::write(const uint8_t c) { + #if ENABLED(SERIAL_XON_XOFF) + const uint8_t state = xon_xoff_state; + if (!(state & XON_XOFF_CHAR_SENT)) { + // Send 2 chars: XON/XOFF, then a user-specified char + writeNoHandshake(state & XON_XOFF_CHAR_MASK); + xon_xoff_state = state | XON_XOFF_CHAR_SENT; + } + #endif + writeNoHandshake(c); + } + + void MarlinSerial::writeNoHandshake(const uint8_t c) { _written = true; + CRITICAL_SECTION_START; + bool emty = (tx_buffer.head == tx_buffer.tail); + CRITICAL_SECTION_END; - // If the TX interrupts are disabled 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. - // Yes, there is a race condition between the sending of the - // XOFF char at the RX ISR, but it is properly handled there - if (!TEST(M_UCSRxB, M_UDRIEx) && TEST(M_UCSRxA, M_UDREx)) { - 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 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; } - const uint8_t i = (tx_buffer.head + 1) & (TX_BUFFER_SIZE - 1); - // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { - - // Make room by polling if it is possible to transmit, and do so! - while (i == tx_buffer.tail) { - - // If we can transmit another byte, do it. - if (TEST(M_UCSRxA, M_UDREx)) _tx_udr_empty_irq(); - - // Make sure compiler rereads tx_buffer.tail - sw_barrier(); + // 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 } } - else { - // Interrupts are enabled, just wait until there is space - while (i == tx_buffer.tail) { sw_barrier(); } - } - // Store new char. head is always safe to move tx_buffer.buffer[tx_buffer.head] = c; - tx_buffer.head = i; - - // Enable TX ISR - Non atomic, but it will eventually enable TX ISR - SBI(M_UCSRxB, M_UDRIEx); + { CRITICAL_SECTION_START; + tx_buffer.head = i; + SBI(M_UCSRxB, M_UDRIEx); + CRITICAL_SECTION_END; + } + return; } void MarlinSerial::flushTX(void) { - // No bytes written, no need to flush. This special case is needed since there's - // no way to force the TXC (transmit complete) bit to 1 during initialization. - if (!_written) return; + // 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; - // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { - - // Wait until everything was transmitted - We must do polling, as interrupts are disabled - while (tx_buffer.head != tx_buffer.tail || !TEST(M_UCSRxA, M_TXCx)) { - - // If there is more space, send an extra character + 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(); - - sw_barrier(); - } - } - else { - // Wait until everything was transmitted - while (tx_buffer.head != tx_buffer.tail || !TEST(M_UCSRxA, M_TXCx)) sw_barrier(); - } - - // At this point nothing is queued anymore (DRIE is disabled) and - // the hardware finished transmission (TXC is set). + // If we get here, nothing is queued anymore (DRIE is disabled) and + // the hardware finished tranmission (TXC is set). } #else // TX_BUFFER_SIZE == 0 void MarlinSerial::write(const uint8_t c) { - _written = true; - while (!TEST(M_UCSRxA, M_UDREx)) sw_barrier(); + #if ENABLED(SERIAL_XON_XOFF) + // Do a priority insertion of an XON/XOFF char, if needed. + const uint8_t state = xon_xoff_state; + if (!(state & XON_XOFF_CHAR_SENT)) { + writeNoHandshake(state & XON_XOFF_CHAR_MASK); + xon_xoff_state = state | XON_XOFF_CHAR_SENT; + } + #endif + writeNoHandshake(c); + } + + void MarlinSerial::writeNoHandshake(uint8_t c) { + while (!TEST(M_UCSRxA, M_UDREx)) {/* nada */} M_UDRx = c; } - void MarlinSerial::flushTX(void) { - // No bytes written, no need to flush. This special case is needed since there's - // no way to force the TXC (transmit complete) bit to 1 during initialization. - if (!_written) return; - - // Wait until everything was transmitted - while (!TEST(M_UCSRxA, M_TXCx)) sw_barrier(); - - // At this point nothing is queued anymore (DRIE is disabled) and - // the hardware finished transmission (TXC is set). - } #endif // TX_BUFFER_SIZE == 0 /** @@ -612,9 +522,13 @@ } void MarlinSerial::print(long n, int base) { - if (base == 0) write(n); + if (base == 0) + write(n); else if (base == 10) { - if (n < 0) { print('-'); n = -n; } + if (n < 0) { + print('-'); + n = -n; + } printNumber(n, 10); } else @@ -732,9 +646,9 @@ // Preinstantiate MarlinSerial customizedSerial; -#endif // USE_MARLINSERIAL && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H) +#endif // !USBCON && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H) // For AT90USB targets use the UART for BT interfacing -#if !USE_MARLINSERIAL && ENABLED(BLUETOOTH) +#if defined(USBCON) && ENABLED(BLUETOOTH) HardwareSerial bluetoothSerial; #endif diff --git a/Marlin/MarlinSerial.h b/Marlin/MarlinSerial.h index d8bd534..b3b5096 100644 --- a/Marlin/MarlinSerial.h +++ b/Marlin/MarlinSerial.h @@ -21,16 +21,16 @@ */ /** - * 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) - * Modified 01 October 2017 by Eduardo José Tagle (added XON/XOFF) - */ + MarlinSerial.h - Hardware serial library for Wiring + Copyright (c) 2006 Nicholas Zambetti. All right reserved. -#ifndef _MARLINSERIAL_H_ -#define _MARLINSERIAL_H_ + Modified 28 September 2010 by Mark Sproul + Modified 14 February 2016 by Andreas Hardtung (added tx buffer) + +*/ + +#ifndef MARLINSERIAL_H +#define MARLINSERIAL_H #include "MarlinConfig.h" @@ -60,9 +60,6 @@ #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_FEx SERIAL_REGNAME(FE,SERIAL_PORT,) -#define M_DORx SERIAL_REGNAME(DOR,SERIAL_PORT,) -#define M_UPEx SERIAL_REGNAME(UPE,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) @@ -89,7 +86,7 @@ #define TX_BUFFER_SIZE 32 #endif -#if USE_MARLINSERIAL +#ifndef USBCON #if RX_BUFFER_SIZE > 256 typedef uint16_t ring_buffer_pos_t; @@ -101,19 +98,11 @@ extern uint8_t rx_dropped_bytes; #endif - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - extern uint8_t rx_buffer_overruns; - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - extern uint8_t rx_framing_errors; - #endif - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) extern ring_buffer_pos_t rx_max_enqueued; #endif - class MarlinSerial { + class MarlinSerial { //: public Stream public: MarlinSerial() {}; @@ -123,25 +112,27 @@ static int read(void); static void flush(void); static ring_buffer_pos_t available(void); + static void checkRx(void); static void write(const uint8_t c); - static void flushTX(void); + #if TX_BUFFER_SIZE > 0 + static uint8_t availableForWrite(void); + static void flushTX(void); + #endif + static void writeNoHandshake(const uint8_t c); #if ENABLED(SERIAL_STATS_DROPPED_RX) FORCE_INLINE static uint32_t dropped() { return rx_dropped_bytes; } #endif - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - FORCE_INLINE static uint32_t buffer_overruns() { return rx_buffer_overruns; } - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - FORCE_INLINE static uint32_t framing_errors() { return rx_framing_errors; } - #endif - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) FORCE_INLINE static ring_buffer_pos_t rxMaxEnqueued() { return rx_max_enqueued; } #endif + private: + static void printNumber(unsigned long, const uint8_t); + static void printFloat(double, uint8_t); + + public: FORCE_INLINE static void write(const char* str) { while (*str) write(*str++); } FORCE_INLINE static void write(const uint8_t* buffer, size_t size) { while (size--) write(*buffer++); } FORCE_INLINE static void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); } @@ -165,20 +156,15 @@ static void println(unsigned long, int = DEC); static void println(double, int = 2); static void println(void); - operator bool() { return true; } - - private: - static void printNumber(unsigned long, const uint8_t); - static void printFloat(double, uint8_t); }; extern MarlinSerial customizedSerial; -#endif // USE_MARLINSERIAL +#endif // !USBCON // Use the UART for Bluetooth in AT90USB configurations -#if !USE_MARLINSERIAL && ENABLED(BLUETOOTH) +#if defined(USBCON) && ENABLED(BLUETOOTH) extern HardwareSerial bluetoothSerial; #endif -#endif // _MARLINSERIAL_H_ +#endif // MARLINSERIAL_H diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a6c1612..5aeac1c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -25,7 +25,7 @@ * * This firmware is a mashup between Sprinter and grbl. * - https://github.com/kliment/Sprinter - * - https://github.com/grbl/grbl + * - https://github.com/simen/grbl/tree */ /** @@ -51,7 +51,6 @@ * G3 - CCW ARC * G4 - Dwell S or P * G5 - Cubic B-spline with XYZE destination and IJPQ offsets - * G6 - Direct stepper move (Requires UNREGISTERED_MOVE_SUPPORT). Hangprinter defaults to relative moves. Others default to absolute moves. * G10 - Retract filament according to settings of M207 (Requires FWRETRACT) * G11 - Retract recover filament according to settings of M208 (Requires FWRETRACT) * G12 - Clean tool (Requires NOZZLE_CLEAN_FEATURE) @@ -73,8 +72,6 @@ * G90 - Use Absolute Coordinates * G91 - Use Relative Coordinates * G92 - Set current position to coordinates given - * G95 - Set torque mode (Requires MECHADUINO_I2C_COMMANDS enabled) - * G96 - Set encoder reference point (Requires MECHADUINO_I2C_COMMANDS enabled) * * "M" Codes * @@ -93,8 +90,6 @@ * M25 - Pause SD print. (Requires SDSUPPORT) * M26 - Set SD position in bytes: "M26 S12345". (Requires SDSUPPORT) * M27 - Report SD print status. (Requires SDSUPPORT) - * OR, with 'S' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS) - * OR, with 'C' get the current filename. * M28 - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT) * M29 - Stop SD write. (Requires SDSUPPORT) * M30 - Delete file from SD: "M30 /path/file.gco" @@ -106,7 +101,7 @@ * M34 - Set SD Card sorting options. (Requires SDCARD_SORT_ALPHA) * M42 - Change pin status via gcode: M42 P S. LED pin assumed if P is omitted. * M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins - * M48 - Measure Z Probe repeatability: M48 P X Y V E L S. (Requires Z_MIN_PROBE_REPEATABILITY_TEST) + * M48 - Measure Z Probe repeatability: M48 P X Y V E L. (Requires Z_MIN_PROBE_REPEATABILITY_TEST) * M75 - Start the print job timer. * M76 - Pause the print job timer. * M77 - Stop the print job timer. @@ -133,14 +128,13 @@ * M112 - Emergency stop. * M113 - Get or set the timeout interval for Host Keepalive "busy" messages. (Requires HOST_KEEPALIVE_FEATURE) * M114 - Report current position. - * - S1 Compute length traveled since last G96 using encoder position data (Requires MECHADUINO_I2C_COMMANDS, only kinematic axes) * M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT) * M117 - Display a message on the controller screen. (Requires an LCD) * M118 - Display a message in the host console. * M119 - Report endstops status. * M120 - Enable endstops detection. * M121 - Disable endstops detection. - * M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) + * M122 - Debug stepper (Requires HAVE_TMC2130) * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE) * M126 - Solenoid Air Valve Open. (Requires BARICUDA) * M127 - Solenoid Air Valve Closed. (Requires BARICUDA) @@ -152,8 +146,8 @@ * M150 - Set Status LED Color as R U B P. Values 0-255. (Requires BLINKM, RGB_LED, RGBW_LED, NEOPIXEL_LED, or PCA9632). * M155 - Auto-report temperatures with interval of S. (Requires AUTO_REPORT_TEMPERATURES) * M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER) - * M164 - Commit the mix (Req. MIXING_EXTRUDER) and optionally save as a virtual tool (Req. MIXING_VIRTUAL_TOOLS > 1) - * M165 - Set the mix for a mixing extruder wuth parameters ABCDHI. (Requires MIXING_EXTRUDER and DIRECT_MIXING_IN_G1) + * 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 for heating or cooling. ** * M200 - Set filament diameter, D, setting E axis units to cubic. (Use S0 to revert to linear units.) @@ -163,7 +157,7 @@ * M204 - Set default acceleration in units/sec^2: P R T * M205 - Set advanced settings. Current units apply: S T minimum speeds - Q + B X, Y, Z, E * M206 - Set additional homing offset. (Disabled by NO_WORKSPACE_OFFSETS or DELTA) * M207 - Set Retract Length: S, Feedrate: F, and Z lift: Z. (Requires FWRETRACT) @@ -171,7 +165,7 @@ * M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT) Every normal extrude-only move will be classified as retract depending on the direction. * M211 - Enable, Disable, and/or Report software endstops: S<0|1> (Requires MIN_SOFTWARE_ENDSTOPS or MAX_SOFTWARE_ENDSTOPS) - * M218 - Set/get a tool offset: "M218 T X Y". (Requires 2 or more extruders) + * M218 - Set a tool offset: "M218 T X Y". (Requires 2 or more extruders) * M220 - Set Feedrate Percentage: "M220 S" (i.e., "FR" on the LCD) * M221 - Set Flow Percentage: "M221 S" * M226 - Wait until a pin is in a given state: "M226 P S" @@ -192,30 +186,25 @@ * M380 - Activate solenoid on active extruder. (Requires EXT_SOLENOID) * M381 - Disable all solenoids. (Requires EXT_SOLENOID) * M400 - Finish all moves. - * M401 - Deploy and activate Z probe. (Requires a probe) - * M402 - Deactivate and stow Z probe. (Requires a probe) + * M401 - Lower Z probe. (Requires a probe) + * M402 - Raise Z probe. (Requires a probe) * M404 - Display or set the Nominal Filament Width: "W". (Requires FILAMENT_WIDTH_SENSOR) * M405 - Enable Filament Sensor flow control. "M405 D". (Requires FILAMENT_WIDTH_SENSOR) * M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR) * M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR) * M410 - Quickstop. Abort all planned moves. * M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL) - * M421 - Set a single Z coordinate in the Mesh Leveling grid. X Y Z (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL) + * M421 - Set a single Z coordinate in the Mesh Leveling grid. X Y Z (Requires MESH_BED_LEVELING or AUTO_BED_LEVELING_UBL) * M428 - Set the home_offset based on the current_position. Nearest edge applies. (Disabled by NO_WORKSPACE_OFFSETS or DELTA) * M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS) * M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS) * M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! ** * M503 - Print the current settings (in memory): "M503 S". S0 specifies compact output. - * M524 - Abort SD card print job started with M24 (Requires SDSUPPORT) * M540 - Enable/disable SD card abort on endstop hit: "M540 S". (Requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) * M600 - Pause for filament change: "M600 X Y Z E L". (Requires ADVANCED_PAUSE_FEATURE) - * M603 - Configure filament change: "M603 T U L". (Requires ADVANCED_PAUSE_FEATURE) - * M605 - Set Dual X-Carriage movement mode: "M605 S [X] [R]". (Requires DUAL_X_CARRIAGE) - * M665 - Set Delta configurations: "M665 H L R S B X Y Z (Requires DELTA) - * M665 - Set Hangprinter configurations: "M665 W E R T Y U I O P S" (Requires HANGPRINTER) - * M666 - Set/get endstop offsets for delta (Requires DELTA) or dual endstops (Requires [XYZ]_DUAL_ENDSTOPS). - * M701 - Load filament (requires FILAMENT_LOAD_UNLOAD_GCODES) - * M702 - Unload filament (requires FILAMENT_LOAD_UNLOAD_GCODES) + * M665 - Set delta configurations: "M665 L R S A B C I J K" (Requires DELTA) + * M666 - Set delta endstop adjustment. (Requires DELTA) + * M605 - Set dual x-carriage movement mode: "M605 S [X] [R]". (Requires DUAL_X_CARRIAGE) * M851 - Set Z probe's Z offset in current units. (Negative = below the nozzle.) * M852 - Set skew factors: "M852 [I] [J] [K]". (Requires SKEW_CORRECTION_GCODE, and SKEW_CORRECTION_FOR_Z for IJ) * M860 - Report the position of position encoder modules. @@ -228,14 +217,14 @@ * M867 - Enable/disable or toggle error correction for position encoder modules. * M868 - Report or set position encoder module error correction threshold. * M869 - Report position encoder module error. - * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE) - * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) + * M900 - Get and/or Set advance K factor and WH/D ratio. (Requires LIN_ADVANCE) + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires HAVE_TMC2130 or HAVE_TMC2208) * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots) * M908 - Control digital trimpot directly. (Requires DAC_STEPPER_CURRENT or DIGIPOTSS_PIN) * M909 - Print digipot/DAC current value. (Requires DAC_STEPPER_CURRENT) * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT) - * M911 - Report stepper driver overtemperature pre-warn condition. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) - * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) + * M911 - Report stepper driver overtemperature pre-warn condition. (Requires HAVE_TMC2130 or HAVE_TMC2208) + * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires HAVE_TMC2130 or HAVE_TMC2208) * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD) * M914 - Set SENSORLESS_HOMING sensitivity. (Requires SENSORLESS_HOMING) * @@ -268,16 +257,11 @@ #include "pins_arduino.h" #include "math.h" #include "nozzle.h" -#include "printcounter.h" #include "duration_t.h" #include "types.h" -#include "parser.h" +#include "gcode.h" -#if ENABLED(AUTO_POWER_CONTROL) - #include "power.h" -#endif - -#if ABL_PLANAR +#if HAS_ABL #include "vector_3.h" #if ENABLED(AUTO_BED_LEVELING_LINEAR) #include "least_squares_fit.h" @@ -290,18 +274,6 @@ #include "planner_bezier.h" #endif -#if ENABLED(FWRETRACT) - #include "fwretract.h" -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "power_loss_recovery.h" -#endif - -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - #include "runout.h" -#endif - #if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER) #include "buzzer.h" #endif @@ -326,10 +298,6 @@ #include #endif -#if HAS_TRINAMIC - #include "tmc_util.h" -#endif - #if ENABLED(DAC_STEPPER_CURRENT) #include "stepper_dac.h" #endif @@ -342,6 +310,10 @@ #include "I2CPositionEncoder.h" #endif +#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) + #include "endstop_interrupts.h" +#endif + #if ENABLED(M100_FREE_MEMORY_WATCHER) void gcode_M100(); void M100_dump_routine(const char * const title, const char *start, const char *end); @@ -367,6 +339,8 @@ #if ENABLED(AUTO_BED_LEVELING_UBL) #include "ubl.h" + extern bool defer_return_to_status; + unified_bed_leveling ubl; #endif #if ENABLED(CNC_COORDINATE_SYSTEMS) @@ -388,7 +362,7 @@ uint8_t marlin_debug_flags = DEBUG_NONE; * Used by 'buffer_line_to_current_position' to do a move after changing it. * Used by 'SYNC_PLAN_POSITION_KINEMATIC' to update 'planner.position'. */ -float current_position[XYZE] = { 0 }; +float current_position[XYZE] = { 0.0 }; /** * Cartesian Destination @@ -396,7 +370,7 @@ float current_position[XYZE] = { 0 }; * and expected by functions like 'prepare_move_to_destination'. * Set with 'gcode_get_destination' or 'set_destination_from_current'. */ -float destination[XYZE] = { 0 }; +float destination[XYZE] = { 0.0 }; /** * axis_homed @@ -407,7 +381,7 @@ float destination[XYZE] = { 0 }; * Flags that the position is known in each linear axis. Set when homed. * Cleared whenever a stepper powers off, potentially losing its position. */ -uint8_t axis_homed, axis_known_position; // = 0 +bool axis_homed[XYZ] = { false }, axis_known_position[XYZ] = { false }; /** * GCode line number handling. Hosts may opt to include line numbers when @@ -425,11 +399,14 @@ static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0; * the main loop. The process_next_command function parses the next * command and hands off execution to individual handler functions. */ -uint8_t commands_in_queue = 0, // Count of commands in the queue - cmd_queue_index_r = 0, // Ring buffer read (out) position - cmd_queue_index_w = 0; // Ring buffer write (in) position - -char command_queue[BUFSIZE][MAX_CMD_SIZE]; +uint8_t commands_in_queue = 0; // Count of commands in the queue +static uint8_t cmd_queue_index_r = 0, // Ring buffer read position + cmd_queue_index_w = 0; // Ring buffer write position +#if ENABLED(M100_FREE_MEMORY_WATCHER) + char command_queue[BUFSIZE][MAX_CMD_SIZE]; // Necessary so M100 Free Memory Dumper can show us the commands and any corruption +#else // This can be collapsed back to the way it was soon. +static char command_queue[BUFSIZE][MAX_CMD_SIZE]; +#endif /** * Next Injected Command pointer. NULL if no commands are being injected. @@ -447,26 +424,21 @@ static const char *injected_commands_P = NULL; * but the planner and stepper like mm/s units. */ static const float homing_feedrate_mm_s[] PROGMEM = { - #if ENABLED(HANGPRINTER) - MMM_TO_MMS(DUMMY_HOMING_FEEDRATE), MMM_TO_MMS(DUMMY_HOMING_FEEDRATE), - MMM_TO_MMS(DUMMY_HOMING_FEEDRATE), MMM_TO_MMS(DUMMY_HOMING_FEEDRATE), 0 + #if ENABLED(DELTA) + MMM_TO_MMS(HOMING_FEEDRATE_Z), MMM_TO_MMS(HOMING_FEEDRATE_Z), #else - #if ENABLED(DELTA) - MMM_TO_MMS(HOMING_FEEDRATE_Z), MMM_TO_MMS(HOMING_FEEDRATE_Z), - #else - MMM_TO_MMS(HOMING_FEEDRATE_XY), MMM_TO_MMS(HOMING_FEEDRATE_XY), - #endif - MMM_TO_MMS(HOMING_FEEDRATE_Z), 0 + MMM_TO_MMS(HOMING_FEEDRATE_XY), MMM_TO_MMS(HOMING_FEEDRATE_XY), #endif + MMM_TO_MMS(HOMING_FEEDRATE_Z), 0 }; FORCE_INLINE float homing_feedrate(const AxisEnum a) { return pgm_read_float(&homing_feedrate_mm_s[a]); } -float feedrate_mm_s = MMM_TO_MMS(1500.0f); +float feedrate_mm_s = MMM_TO_MMS(1500.0); static float saved_feedrate_mm_s; int16_t feedrate_percentage = 100, saved_feedrate_percentage; // Initialized by settings.load() -bool axis_relative_modes[XYZE] = AXIS_RELATIVE_MODES; +bool axis_relative_modes[] = AXIS_RELATIVE_MODES; #if HAS_WORKSPACE_OFFSET #if HAS_POSITION_SHIFT @@ -501,50 +473,42 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS }, new_fanSpeeds[FAN_COUNT]; #endif #if ENABLED(PROBING_FANS_OFF) - bool fans_paused; // = false; + bool fans_paused = false; int16_t paused_fanSpeeds[FAN_COUNT] = { 0 }; #endif #endif -#if ENABLED(USE_CONTROLLER_FAN) - int controllerFanSpeed; // = 0; -#endif - // The active extruder (tool). Set with T command. -uint8_t active_extruder; // = 0; +uint8_t active_extruder = 0; // Relative Mode. Enable with G91, disable with G90. -static bool relative_mode; // = false; +static bool relative_mode = false; // For M109 and M190, this flag may be cleared (by M108) to exit the wait loop volatile bool wait_for_heatup = true; // For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop #if HAS_RESUME_CONTINUE - volatile bool wait_for_user; // = false; -#endif - -#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - bool suspend_auto_report; // = false + volatile bool wait_for_user = false; #endif const char axis_codes[XYZE] = { 'X', 'Y', 'Z', 'E' }; -#if ENABLED(HANGPRINTER) - const char axis_codes_hangprinter[ABCDE] = { 'A', 'B', 'C', 'D', 'E' }; - #define RAW_AXIS_CODES(I) axis_codes_hangprinter[I] -#else - #define RAW_AXIS_CODES(I) axis_codes[I] -#endif - // Number of characters read in the current line of serial input -static int serial_count; // = 0; +static int serial_count = 0; // Inactivity shutdown -millis_t previous_move_ms; // = 0; -static millis_t max_inactive_time; // = 0; +millis_t previous_cmd_ms = 0; +static millis_t max_inactive_time = 0; static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL; +// Print Job Timer +#if ENABLED(PRINTCOUNTER) + PrintCounter print_job_timer = PrintCounter(); +#else + 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) @@ -586,8 +550,14 @@ uint8_t target_extruder; #define ADJUST_DELTA(V) NOOP #endif -#if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) - const static char msg_wait_for_bed_heating[] PROGMEM = "Wait for bed heating...\n"; +#if ENABLED(X_DUAL_ENDSTOPS) + float x_endstop_adj; // Initialized by settings.load() +#endif +#if ENABLED(Y_DUAL_ENDSTOPS) + float y_endstop_adj; // Initialized by settings.load() +#endif +#if ENABLED(Z_DUAL_ENDSTOPS) + float z_endstop_adj; // Initialized by settings.load() #endif // Extruder offsets @@ -595,7 +565,7 @@ uint8_t target_extruder; float hotend_offset[XYZ][HOTENDS]; // Initialized by settings.load() #endif -#if HAS_Z_SERVO_PROBE +#if HAS_Z_SERVO_ENDSTOP const int z_servo_angle[2] = Z_SERVO_ANGLES; #endif @@ -604,21 +574,32 @@ uint8_t target_extruder; baricuda_e_to_p_pressure = 0; #endif +#if ENABLED(FWRETRACT) // Initialized by settings.load()... + bool autoretract_enabled, // M209 S - Autoretract switch + retracted[EXTRUDERS] = { false }; // Which extruders are currently retracted + float retract_length, // M207 S - G10 Retract length + retract_feedrate_mm_s, // M207 F - G10 Retract feedrate + retract_zlift, // M207 Z - G10 Retract hop size + retract_recover_length, // M208 S - G11 Recover length + retract_recover_feedrate_mm_s, // M208 F - G11 Recover feedrate + swap_retract_length, // M207 W - G10 Swap Retract length + swap_retract_recover_length, // M208 W - G11 Swap Recover length + swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate + #if EXTRUDERS > 1 + bool retracted_swap[EXTRUDERS] = { false }; // Which extruders are swap-retracted + #else + constexpr bool retracted_swap[1] = { false }; + #endif +#endif // FWRETRACT + #if HAS_POWER_SWITCH - bool powersupply_on = ( + bool powersupply_on = #if ENABLED(PS_DEFAULT_OFF) false #else true #endif - ); - #if ENABLED(AUTO_POWER_CONTROL) - #define PSU_ON() powerManager.power_on() - #define PSU_OFF() powerManager.power_off() - #else - #define PSU_ON() PSU_PIN_ON() - #define PSU_OFF() PSU_PIN_OFF() - #endif + ; #endif #if ENABLED(DELTA) @@ -639,40 +620,12 @@ uint8_t target_extruder; float delta_safe_distance_from_top(); -#elif ENABLED(HANGPRINTER) - - float anchor_A_y, - anchor_A_z, - anchor_B_x, - anchor_B_y, - anchor_B_z, - anchor_C_x, - anchor_C_y, - anchor_C_z, - anchor_D_z, - line_lengths[ABCD], - line_lengths_origin[ABCD], - delta_segments_per_second; - #endif #if ENABLED(AUTO_BED_LEVELING_BILINEAR) int bilinear_grid_spacing[2], bilinear_start[2]; float bilinear_grid_factor[2], z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - #define ABL_BG_SPACING(A) bilinear_grid_spacing_virt[A] - #define ABL_BG_FACTOR(A) bilinear_grid_factor_virt[A] - #define ABL_BG_POINTS_X ABL_GRID_POINTS_VIRT_X - #define ABL_BG_POINTS_Y ABL_GRID_POINTS_VIRT_Y - #define ABL_BG_GRID(X,Y) z_values_virt[X][Y] - #else - #define ABL_BG_SPACING(A) bilinear_grid_spacing[A] - #define ABL_BG_FACTOR(A) bilinear_grid_factor[A] - #define ABL_BG_POINTS_X GRID_MAX_POINTS_X - #define ABL_BG_POINTS_Y GRID_MAX_POINTS_Y - #define ABL_BG_GRID(X,Y) z_values[X][Y] - #endif #endif #if IS_SCARA @@ -688,7 +641,7 @@ uint8_t target_extruder; float cartes[XYZ] = { 0 }; #if ENABLED(FILAMENT_WIDTH_SENSOR) - bool filament_sensor; // = false; // M405 turns on filament sensor control. M406 turns it off. + bool filament_sensor = false; // M405 turns on filament sensor control. M406 turns it off. float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA, // Nominal filament width. Change with M404. filament_width_meas = DEFAULT_MEASURED_FILAMENT_DIA; // Measured filament diameter uint8_t meas_delay_cm = MEASUREMENT_DELAY_CM; // Distance delay setting @@ -696,10 +649,12 @@ float cartes[XYZ] = { 0 }; filwidth_delay_index[2] = { 0, -1 }; // Indexes into ring buffer #endif +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + static bool filament_ran_out = false; +#endif + #if ENABLED(ADVANCED_PAUSE_FEATURE) AdvancedPauseMenuResponse advanced_pause_menu_response; - float filament_change_unload_length[EXTRUDERS], - filament_change_load_length[EXTRUDERS]; #endif #if ENABLED(MIXING_EXTRUDER) @@ -714,9 +669,9 @@ 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_PROBE - #define DEPLOY_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, z_servo_angle[0]) - #define STOW_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, z_servo_angle[1]) + #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 @@ -725,6 +680,10 @@ static bool send_ok[BUFSIZE]; bool chdkActive = false; #endif +#if ENABLED(PID_EXTRUSION_SCALING) + int lpq_len = 20; +#endif + #if ENABLED(HOST_KEEPALIVE_FEATURE) MarlinBusyState busy_state = NOT_BUSY; static millis_t next_busy_signal_ms = 0; @@ -735,6 +694,8 @@ static bool send_ok[BUFSIZE]; #if ENABLED(I2C_POSITION_ENCODERS) I2CPositionEncodersMgr I2CPEM; + uint8_t blockBufferIndexRef = 0; + millis_t lastUpdateMillis; #endif #if ENABLED(CNC_WORKSPACE_PLANES) @@ -776,9 +737,10 @@ void set_current_from_steppers_for_axis(const AxisEnum axis); #endif #if ENABLED(BEZIER_CURVE_SUPPORT) - void plan_cubic_move(const float (&cart)[XYZE], const float (&offset)[4]); + void plan_cubic_move(const float (&offset)[4]); #endif +void tool_change(const uint8_t tmp_extruder, const float fr_mm_s=0.0, bool no_move=false); void report_current_position(); void report_current_position_detail(); @@ -797,6 +759,12 @@ void report_current_position_detail(); print_xyz(prefix, suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]); } + #if HAS_ABL + 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(SUFFIX,VAR) do { \ print_xyz(PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); }while(0) #endif @@ -806,26 +774,29 @@ void report_current_position_detail(); * * Set the planner/stepper positions directly from current_position with * no kinematic translation. Used for homing axes and cartesian/core syncing. - * - * This is not possible for Hangprinter because current_position and position are different sizes */ void sync_plan_position() { - #if DISABLED(HANGPRINTER) - #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_CART]); + #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]); } -void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_CART]); } +inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_AXIS]); } #if IS_KINEMATIC + inline void sync_plan_position_kinematic() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position_kinematic", current_position); #endif planner.set_position_mm_kinematic(current_position); } + #define SYNC_PLAN_POSITION_KINEMATIC() sync_plan_position_kinematic() + +#else + + #define SYNC_PLAN_POSITION_KINEMATIC() sync_plan_position() + #endif #if ENABLED(SDSUPPORT) @@ -839,10 +810,10 @@ extern "C" { int freeMemory() { int free_memory; - if (int(__brkval) == 0) - free_memory = (int(&free_memory)) - (int(&__bss_end)); + if ((int)__brkval == 0) + free_memory = ((int)&free_memory) - ((int)&__bss_end); else - free_memory = (int(&free_memory)) - (int(__brkval)); + free_memory = ((int)&free_memory) - ((int)__brkval); return free_memory; } } @@ -878,14 +849,15 @@ static bool drain_injected_commands_P() { */ void enqueue_and_echo_commands_P(const char * const pgcode) { injected_commands_P = pgcode; - (void)drain_injected_commands_P(); // first command executed asap (when possible) + drain_injected_commands_P(); // first command executed asap (when possible) } /** * Clear the Marlin command queue */ void clear_command_queue() { - cmd_queue_index_r = cmd_queue_index_w = commands_in_queue = 0; + cmd_queue_index_r = cmd_queue_index_w; + commands_in_queue = 0; } /** @@ -912,8 +884,8 @@ inline bool _enqueuecommand(const char* cmd, bool say_ok=false) { /** * Enqueue with Serial Echo */ -bool enqueue_and_echo_command(const char* cmd) { - if (_enqueuecommand(cmd)) { +bool enqueue_and_echo_command(const char* cmd, bool say_ok/*=false*/) { + if (_enqueuecommand(cmd, say_ok)) { SERIAL_ECHO_START(); SERIAL_ECHOPAIR(MSG_ENQUEUEING, cmd); SERIAL_CHAR('"'); @@ -923,33 +895,33 @@ bool enqueue_and_echo_command(const char* cmd) { return false; } -#if HAS_QUEUE_NOW - void enqueue_and_echo_command_now(const char* cmd) { - while (!enqueue_and_echo_command(cmd)) idle(); - } - #if HAS_LCD_QUEUE_NOW - void enqueue_and_echo_commands_now_P(const char * const pgcode) { - enqueue_and_echo_commands_P(pgcode); - while (drain_injected_commands_P()) idle(); - } - #endif -#endif - void setup_killpin() { #if HAS_KILL SET_INPUT_PULLUP(KILL_PIN); #endif } +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + + void setup_filrunoutpin() { + #if ENABLED(ENDSTOPPULLUP_FIL_RUNOUT) + SET_INPUT_PULLUP(FIL_RUNOUT_PIN); + #else + SET_INPUT(FIL_RUNOUT_PIN); + #endif + } + +#endif + void setup_powerhold() { #if HAS_SUICIDE OUT_WRITE(SUICIDE_PIN, HIGH); #endif #if HAS_POWER_SWITCH #if ENABLED(PS_DEFAULT_OFF) - PSU_OFF(); + OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); #else - PSU_ON(); + OUT_WRITE(PS_ON_PIN, PS_ON_AWAKE); #endif #endif } @@ -978,7 +950,7 @@ void servo_init() { servo[3].detach(); #endif - #if HAS_Z_SERVO_PROBE + #if HAS_Z_SERVO_ENDSTOP /** * Set position of Z Servo Endstop * @@ -1019,7 +991,7 @@ void gcode_line_error(const char* err, bool doFlush = true) { serialprintPGM(err); SERIAL_ERRORLN(gcode_LastN); //Serial.println(gcode_N); - if (doFlush) flush_and_request_resend(); + if (doFlush) FlushSerialRequestResend(); serial_count = 0; } @@ -1034,10 +1006,10 @@ inline void get_serial_commands() { // If the command buffer is empty for too long, // send "wait" to indicate Marlin is still waiting. - #if NO_TIMEOUTS > 0 + #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0 static millis_t last_command_time = 0; const millis_t ms = millis(); - if (commands_in_queue == 0 && !MYSERIAL0.available() && ELAPSED(ms, last_command_time + NO_TIMEOUTS)) { + if (commands_in_queue == 0 && !MYSERIAL.available() && ELAPSED(ms, last_command_time + NO_TIMEOUTS)) { SERIAL_ECHOLNPGM(MSG_WAIT); last_command_time = ms; } @@ -1047,7 +1019,7 @@ inline void get_serial_commands() { * Loop while serial characters are incoming and the queue is not full */ int c; - while (commands_in_queue < BUFSIZE && (c = MYSERIAL0.read()) >= 0) { + while (commands_in_queue < BUFSIZE && (c = MYSERIAL.read()) >= 0) { char serial_char = c; @@ -1058,8 +1030,7 @@ inline void get_serial_commands() { serial_comment_mode = false; // end of line == end of comment - // Skip empty lines and comments - if (!serial_count) { thermalManager.manage_heater(); continue; } + if (!serial_count) continue; // Skip empty lines serial_line_buffer[serial_count] = 0; // Terminate string serial_count = 0; // Reset buffer @@ -1080,40 +1051,38 @@ inline void get_serial_commands() { gcode_N = strtol(npos + 1, NULL, 10); - if (gcode_N != gcode_LastN + 1 && !M110) - return gcode_line_error(PSTR(MSG_ERR_LINE_NO)); + if (gcode_N != gcode_LastN + 1 && !M110) { + gcode_line_error(PSTR(MSG_ERR_LINE_NO)); + return; + } char *apos = strrchr(command, '*'); if (apos) { uint8_t checksum = 0, count = uint8_t(apos - command); while (count) checksum ^= command[--count]; - if (strtol(apos + 1, NULL, 10) != checksum) - return gcode_line_error(PSTR(MSG_ERR_CHECKSUM_MISMATCH)); + if (strtol(apos + 1, NULL, 10) != checksum) { + gcode_line_error(PSTR(MSG_ERR_CHECKSUM_MISMATCH)); + return; + } + } + else { + gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM)); + return; } - else - return gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM)); gcode_LastN = gcode_N; } - #if ENABLED(SDSUPPORT) - else if (card.saving && strcmp(command, "M29") != 0) // No line number with M29 in Pronterface - return gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM)); - #endif // Movement commands alert when stopped if (IsStopped()) { char* gpos = strchr(command, 'G'); if (gpos) { - switch (strtol(gpos + 1, NULL, 10)) { + const int codenum = strtol(gpos + 1, NULL, 10); + switch (codenum) { case 0: case 1: - #if ENABLED(ARC_SUPPORT) - case 2: - case 3: - #endif - #if ENABLED(BEZIER_CURVE_SUPPORT) - case 5: - #endif + case 2: + case 3: SERIAL_ERRORLNPGM(MSG_ERR_STOPPED); LCD_MESSAGEPGM(MSG_STOPPED); break; @@ -1122,15 +1091,15 @@ inline void get_serial_commands() { } #if DISABLED(EMERGENCY_PARSER) - // Process critical commands early + // If command was e-stop process now if (strcmp(command, "M108") == 0) { wait_for_heatup = false; - #if ENABLED(NEWPANEL) + #if ENABLED(ULTIPANEL) wait_for_user = false; #endif } if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED)); - if (strcmp(command, "M410") == 0) quickstop_stepper(); + if (strcmp(command, "M410") == 0) { quickstop_stepper(); } #endif #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0 @@ -1144,9 +1113,12 @@ inline void get_serial_commands() { // Keep fetching, but ignore normal characters beyond the max length // The command will be injected when EOL is reached } - else if (serial_char == '\\') { // Handle escapes - if ((c = MYSERIAL0.read()) >= 0 && !serial_comment_mode) // if we have one more character, copy it over - serial_line_buffer[serial_count++] = (char)c; + else if (serial_char == '\\') { // Handle escapes + if ((c = MYSERIAL.read()) >= 0) { + // if we have one more character, copy it over + serial_char = c; + if (!serial_comment_mode) serial_line_buffer[serial_count++] = serial_char; + } // otherwise do nothing } else { // it's not a newline, carriage return or escape char @@ -1159,10 +1131,6 @@ inline void get_serial_commands() { #if ENABLED(SDSUPPORT) - #if ENABLED(PRINTER_EVENT_LEDS) && HAS_RESUME_CONTINUE - static bool lights_off_after_print; // = false - #endif - /** * Get commands from the SD Card until the command buffer is full * or until the end of the file is reached. The special character '#' @@ -1205,19 +1173,13 @@ inline void get_serial_commands() { LCD_MESSAGEPGM(MSG_INFO_COMPLETED_PRINTS); leds.set_green(); #if HAS_RESUME_CONTINUE - lights_off_after_print = true; - enqueue_and_echo_commands_P(PSTR("M0 S" - #if ENABLED(NEWPANEL) - "1800" - #else - "60" - #endif - )); + enqueue_and_echo_commands_P(PSTR("M0")); // end of the queue! #else - safe_delay(2000); - leds.set_off(); + safe_delay(1000); #endif - #endif // PRINTER_EVENT_LEDS + leds.set_off(); + #endif + card.checkautostart(true); } } else if (n == -1) { @@ -1228,8 +1190,7 @@ inline void get_serial_commands() { sd_comment_mode = false; // for new command - // Skip empty lines and comments - if (!sd_count) { thermalManager.manage_heater(); continue; } + if (!sd_count) continue; // skip empty lines (and comment lines) command_queue[cmd_queue_index_w][sd_count] = '\0'; // terminate string sd_count = 0; // clear sd line buffer @@ -1249,43 +1210,21 @@ inline void get_serial_commands() { } } - #if ENABLED(POWER_LOSS_RECOVERY) - - inline bool drain_job_recovery_commands() { - static uint8_t job_recovery_commands_index = 0; // Resets on reboot - if (job_recovery_commands_count) { - if (_enqueuecommand(job_recovery_commands[job_recovery_commands_index])) { - ++job_recovery_commands_index; - if (!--job_recovery_commands_count) job_recovery_phase = JOB_RECOVERY_DONE; - } - return true; - } - return false; - } - - #endif - #endif // SDSUPPORT /** * Add to the circular command queue the next command from: * - The command-injection queue (injected_commands_P) * - The active serial input (usually USB) - * - Commands left in the queue after power-loss * - The SD card file being actively printed */ void get_available_commands() { - // Immediate commands block the other queues + // if any immediate commands remain, don't get other commands yet if (drain_injected_commands_P()) return; get_serial_commands(); - #if ENABLED(POWER_LOSS_RECOVERY) - // Commands for power-loss recovery take precedence - if (job_recovery_phase == JOB_RECOVERY_YES && drain_job_recovery_commands()) return; - #endif - #if ENABLED(SDSUPPORT) get_sdcard_commands(); #endif @@ -1346,7 +1285,7 @@ bool get_target_extruder_from_command(const uint16_t code) { #endif // DUAL_X_CARRIAGE -#if HAS_WORKSPACE_OFFSET || ENABLED(DUAL_X_CARRIAGE) || ENABLED(DELTA) +#if HAS_WORKSPACE_OFFSET || ENABLED(DUAL_X_CARRIAGE) /** * Software endstops can be used to monitor the open end of @@ -1366,7 +1305,7 @@ bool get_target_extruder_from_command(const uint16_t code) { if (axis == X_AXIS) { // In Dual X mode hotend_offset[X] is T1's home position - const float dual_max_x = MAX(hotend_offset[X_AXIS][1], X2_MAX_POS); + float dual_max_x = max(hotend_offset[X_AXIS][1], X2_MAX_POS); if (active_extruder != 0) { // T1 can move from X2_MIN_POS to X2_MAX_POS or X2 home position (whichever is larger) @@ -1377,7 +1316,7 @@ bool get_target_extruder_from_command(const uint16_t code) { // In Duplication Mode, T0 can move as far left as X_MIN_POS // but not so far to the right that T1 would move past the end soft_endstop_min[X_AXIS] = base_min_pos(X_AXIS); - soft_endstop_max[X_AXIS] = MIN(base_max_pos(X_AXIS), dual_max_x - duplicate_extruder_x_offset); + soft_endstop_max[X_AXIS] = min(base_max_pos(X_AXIS), dual_max_x - duplicate_extruder_x_offset); } else { // In other modes, T0 can move from X_MIN_POS to X_MAX_POS @@ -1408,15 +1347,13 @@ bool get_target_extruder_from_command(const uint16_t code) { #endif #if ENABLED(DELTA) - switch (axis) { - #if HAS_SOFTWARE_ENDSTOPS - case X_AXIS: - case Y_AXIS: - // Get a minimum radius for clamping - soft_endstop_radius = MIN3(ABS(MAX(soft_endstop_min[X_AXIS], soft_endstop_min[Y_AXIS])), soft_endstop_max[X_AXIS], soft_endstop_max[Y_AXIS]); - soft_endstop_radius_2 = sq(soft_endstop_radius); - break; - #endif + switch(axis) { + case X_AXIS: + case Y_AXIS: + // Get a minimum radius for clamping + soft_endstop_radius = MIN3(FABS(max(soft_endstop_min[X_AXIS], soft_endstop_min[Y_AXIS])), soft_endstop_max[X_AXIS], soft_endstop_max[Y_AXIS]); + soft_endstop_radius_2 = sq(soft_endstop_radius); + break; case Z_AXIS: delta_clip_start_height = soft_endstop_max[axis] - delta_safe_distance_from_top(); default: break; @@ -1424,12 +1361,16 @@ bool get_target_extruder_from_command(const uint16_t code) { #endif } -#endif // HAS_WORKSPACE_OFFSET || DUAL_X_CARRIAGE || DELTA +#endif // HAS_WORKSPACE_OFFSET || DUAL_X_CARRIAGE #if HAS_M206_COMMAND /** - * Change the home offset for an axis. - * Also refreshes the workspace offset. + * Change the home offset for an axis, update the current + * position and the software endstops to retain the same + * relative distance to the new home. + * + * Since this changes the current_position, code should + * call sync_plan_position soon after this. */ static void set_home_offset(const AxisEnum axis, const float v) { home_offset[axis] = v; @@ -1464,8 +1405,7 @@ static void set_axis_is_at_home(const AxisEnum axis) { } #endif - SBI(axis_known_position, axis); - SBI(axis_homed, axis); + axis_known_position[axis] = axis_homed[axis] = true; #if HAS_POSITION_SHIFT position_shift[axis] = 0; @@ -1567,12 +1507,9 @@ static void set_axis_is_at_home(const AxisEnum axis) { } /** - * Homing bump feedrate (mm/s) + * Some planner shorthand inline functions */ inline float get_homing_bump_feedrate(const AxisEnum axis) { - #if HOMING_Z_WITH_PROBE - if (axis == Z_AXIS) return MMM_TO_MMS(Z_PROBE_SPEED_SLOW); - #endif static const uint8_t homing_bump_divisor[] PROGMEM = HOMING_BUMP_DIVISOR; uint8_t hbd = pgm_read_byte(&homing_bump_divisor[axis]); if (hbd < 1) { @@ -1583,43 +1520,33 @@ inline float get_homing_bump_feedrate(const AxisEnum axis) { return homing_feedrate(axis) / hbd; } -/** - * Some planner shorthand inline functions - */ - /** * Move the planner to the current position from wherever it last moved * (or from wherever it has been told it is located). - * - * Impossible on Hangprinter because current_position and position are of different sizes */ inline void buffer_line_to_current_position() { - #if DISABLED(HANGPRINTER) // emptying this function probably breaks do_blocking_move_to() - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_CART], feedrate_mm_s, active_extruder); - #endif + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate_mm_s, active_extruder); } /** * Move the planner to the position stored in the destination array, which is * used by G0/G1/G2/G3/G5 and many other functions to set a destination. */ -inline void buffer_line_to_destination(const float &fr_mm_s) { - #if ENABLED(HANGPRINTER) - UNUSED(fr_mm_s); - #else - planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_CART], fr_mm_s, active_extruder); - #endif +inline void buffer_line_to_destination(const float fr_mm_s) { + planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], fr_mm_s, active_extruder); } #if IS_KINEMATIC /** * Calculate delta, start a line, and set current_position to destination */ - void prepare_uninterpolated_move_to_destination(const float fr_mm_s=0) { + void prepare_uninterpolated_move_to_destination(const float fr_mm_s=0.0) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_uninterpolated_move_to_destination", destination); #endif + refresh_cmd_timeout(); + #if UBL_SEGMENTED // ubl segmented line will do z-only moves in single segment ubl.prepare_segmented_line_to(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s)); @@ -1627,7 +1554,7 @@ inline void buffer_line_to_destination(const float &fr_mm_s) { if ( current_position[X_AXIS] == destination[X_AXIS] && current_position[Y_AXIS] == destination[Y_AXIS] && current_position[Z_AXIS] == destination[Z_AXIS] - && current_position[E_CART] == destination[E_CART] + && current_position[E_AXIS] == destination[E_AXIS] ) return; planner.buffer_line_kinematic(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s), active_extruder); @@ -1638,11 +1565,10 @@ inline void buffer_line_to_destination(const float &fr_mm_s) { #endif // IS_KINEMATIC /** - * Plan a move to (X, Y, Z) and set the current_position. - * The final current_position may not be the one that was requested - * Caution: 'destination' is modified by this function. + * 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(const float rx, const float ry, const float rz, const float &fr_mm_s/*=0.0*/) { +void do_blocking_move_to(const float &rx, const float &ry, const float &rz, const float &fr_mm_s/*=0.0*/) { const float old_feedrate_mm_s = feedrate_mm_s; #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -1750,7 +1676,7 @@ void do_blocking_move_to(const float rx, const float ry, const float rz, const f #endif - planner.synchronize(); + stepper.synchronize(); feedrate_mm_s = old_feedrate_mm_s; @@ -1777,34 +1703,58 @@ void do_blocking_move_to_xy(const float &rx, const float &ry, const float &fr_mm // - Reset the command timeout // - Enable the endstops (for endstop moves) // -void setup_for_endstop_or_probe_move() { +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_s = feedrate_mm_s; saved_feedrate_percentage = feedrate_percentage; feedrate_percentage = 100; + refresh_cmd_timeout(); } -void clean_up_after_endstop_or_probe_move() { +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_s = saved_feedrate_mm_s; feedrate_percentage = saved_feedrate_percentage; + refresh_cmd_timeout(); } +#if HAS_BED_PROBE + /** + * Raise Z to a minimum height to make room for a probe to move + */ + inline void do_probe_raise(const float z_raise) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("do_probe_raise(", z_raise); + SERIAL_CHAR(')'); + SERIAL_EOL(); + } + #endif + + float z_dest = z_raise; + if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset; + + if (z_dest > current_position[Z_AXIS]) + do_blocking_move_to_z(z_dest); + } + +#endif // HAS_BED_PROBE + #if HAS_AXIS_UNHOMED_ERR bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) { #if ENABLED(HOME_AFTER_DEACTIVATE) - const bool xx = x && !TEST(axis_known_position, X_AXIS), - yy = y && !TEST(axis_known_position, Y_AXIS), - zz = z && !TEST(axis_known_position, Z_AXIS); + const bool xx = x && !axis_known_position[X_AXIS], + yy = y && !axis_known_position[Y_AXIS], + zz = z && !axis_known_position[Z_AXIS]; #else - const bool xx = x && !TEST(axis_homed, X_AXIS), - yy = y && !TEST(axis_homed, Y_AXIS), - zz = z && !TEST(axis_homed, Z_AXIS); + const bool xx = x && !axis_homed[X_AXIS], + yy = y && !axis_homed[Y_AXIS], + zz = z && !axis_homed[Z_AXIS]; #endif if (xx || yy || zz) { SERIAL_ECHO_START(); @@ -2077,7 +2027,7 @@ void clean_up_after_endstop_or_probe_move() { #if ENABLED(BLTOUCH) void bltouch_command(int angle) { - MOVE_SERVO(Z_PROBE_SERVO_NR, angle); // Give the BL-Touch the command and wait + MOVE_SERVO(Z_ENDSTOP_SERVO_NR, angle); // Give the BL-Touch the command and wait safe_delay(BLTOUCH_DELAY); } @@ -2112,29 +2062,8 @@ void clean_up_after_endstop_or_probe_move() { #endif // BLTOUCH - /** - * Raise Z to a minimum height to make room for a probe to move - */ - inline void do_probe_raise(const float z_raise) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("do_probe_raise(", z_raise); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - float z_dest = z_raise; - if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset; - - NOMORE(z_dest, Z_MAX_POS); - - if (z_dest > current_position[Z_AXIS]) - do_blocking_move_to_z(z_dest); - } - // returns false for ok and true for failure - bool set_probe_deployed(const bool deploy) { + bool set_probe_deployed(bool deploy) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { @@ -2145,23 +2074,8 @@ void clean_up_after_endstop_or_probe_move() { if (endstops.z_probe_enabled == deploy) return false; - // Make room for probe to deploy (or stow) - // Fix-mounted probe should only raise for deploy - #if ENABLED(FIX_MOUNTED_PROBE) - const bool deploy_stow_condition = deploy; - #else - constexpr bool deploy_stow_condition = true; - #endif - - // For beds that fall when Z is powered off only raise for trusted Z - #if ENABLED(UNKNOWN_Z_NO_RAISE) - const bool unknown_condition = TEST(axis_known_position, Z_AXIS); - #else - constexpr float unknown_condition = true; - #endif - - if (deploy_stow_condition && unknown_condition) - do_probe_raise(MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_CLEARANCE_DEPLOY_PROBE)); + // Make room for probe + do_probe_raise(_Z_CLEARANCE_DEPLOY_PROBE); #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) #if ENABLED(Z_PROBE_SLED) @@ -2202,9 +2116,9 @@ void clean_up_after_endstop_or_probe_move() { dock_sled(!deploy); - #elif HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH) + #elif HAS_Z_SERVO_ENDSTOP && DISABLED(BLTOUCH) - MOVE_SERVO(Z_PROBE_SERVO_NR, z_servo_angle[deploy ? 0 : 1]); + MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[deploy ? 0 : 1]); #elif ENABLED(Z_PROBE_ALLEN_KEY) @@ -2241,21 +2155,11 @@ void clean_up_after_endstop_or_probe_move() { * @param fr_mm_s Feedrate in mm/s * @return true to indicate an error */ - static bool do_probe_move(const float z, const float fr_mm_s) { + static bool do_probe_move(const float z, const float fr_mm_m) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS(">>> do_probe_move", current_position); #endif - #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) - // Wait for bed to heat back up between probing points - if (thermalManager.isHeatingBed()) { - serialprintPGM(msg_wait_for_bed_heating); - LCD_MESSAGEPGM(MSG_BED_HEATING); - while (thermalManager.isHeatingBed()) safe_delay(200); - lcd_reset_status(); - } - #endif - // Deploy BLTouch at the start of any probe #if ENABLED(BLTOUCH) if (set_bltouch_deployed(true)) return true; @@ -2266,10 +2170,10 @@ void clean_up_after_endstop_or_probe_move() { #endif // Move down until probe triggered - do_blocking_move_to_z(z, fr_mm_s); + do_blocking_move_to_z(z, MMM_TO_MMS(fr_mm_m)); // Check to see if the probe was triggered - const bool probe_triggered = TEST(endstops.trigger_state(), + const bool probe_triggered = TEST(Endstops::endstop_hit_bits, #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) Z_MIN #else @@ -2286,6 +2190,7 @@ void clean_up_after_endstop_or_probe_move() { if (probe_triggered && set_bltouch_deployed(false)) return true; #endif + // Clear endstop flags endstops.hit_on_purpose(); // Get Z where the steppers were interrupted @@ -2313,23 +2218,14 @@ void clean_up_after_endstop_or_probe_move() { if (DEBUGGING(LEVELING)) DEBUG_POS(">>> run_z_probe", current_position); #endif - // Stop the probe before it goes too low to prevent damage. - // If Z isn't known then probe to -10mm. - const float z_probe_low_point = TEST(axis_known_position, Z_AXIS) ? -zprobe_zoffset + Z_PROBE_LOW_POINT : -10.0; + // Prevent stepper_inactive_time from running out and EXTRUDER_RUNOUT_PREVENT from extruding + refresh_cmd_timeout(); // Double-probing does a fast probe followed by a slow probe #if MULTIPLE_PROBING == 2 // Do a first probe at the fast speed - if (do_probe_move(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_FAST))) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("FAST Probe fail!"); - DEBUG_POS("<<< run_z_probe", current_position); - } - #endif - return NAN; - } + if (do_probe_move(-10, Z_PROBE_SPEED_FAST)) return NAN; float first_probe_z = current_position[Z_AXIS]; @@ -2338,18 +2234,19 @@ void clean_up_after_endstop_or_probe_move() { #endif // move up to make clearance for the probe - do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); + do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); #else - // If the nozzle is well over the travel height then + // If the nozzle is above the travel height then // move down quickly before doing the slow probe - float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0; + float z = Z_CLEARANCE_DEPLOY_PROBE; if (zprobe_zoffset < 0) z -= zprobe_zoffset; - if (current_position[Z_AXIS] > z) { + if (z < current_position[Z_AXIS]) { + // If we don't make it to the z position (i.e. the probe triggered), move up to make clearance for the probe - if (!do_probe_move(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST))) + if (!do_probe_move(z, Z_PROBE_SPEED_FAST)) do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); } #endif @@ -2360,26 +2257,18 @@ void clean_up_after_endstop_or_probe_move() { #endif // move down slowly to find bed - if (do_probe_move(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW))) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("SLOW Probe fail!"); - DEBUG_POS("<<< run_z_probe", current_position); - } - #endif - return NAN; - } + if (do_probe_move(-10, Z_PROBE_SPEED_SLOW)) return NAN; #if MULTIPLE_PROBING > 2 probes_total += current_position[Z_AXIS]; - if (p > 1) do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); + if (p > 1) do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); } #endif #if MULTIPLE_PROBING > 2 // Return the average value of all probes - const float measured_z = probes_total * (1.0f / (MULTIPLE_PROBING)); + return probes_total * (1.0 / (MULTIPLE_PROBING)); #elif MULTIPLE_PROBING == 2 @@ -2393,20 +2282,18 @@ void clean_up_after_endstop_or_probe_move() { #endif // Return a weighted average of the fast and slow probes - const float measured_z = (z2 * 3.0 + first_probe_z * 2.0) * 0.2; + return (z2 * 3.0 + first_probe_z * 2.0) * 0.2; #else // Return the single probe result - const float measured_z = current_position[Z_AXIS]; + return current_position[Z_AXIS]; #endif #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("<<< run_z_probe", current_position); #endif - - return measured_z; } /** @@ -2418,15 +2305,13 @@ void clean_up_after_endstop_or_probe_move() { * - Raise to the BETWEEN height * - Return the probed Z position */ - float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/) { + float probe_pt(const float &rx, const float &ry, const bool stow, const uint8_t verbose_level, const bool probe_relative=true) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR(">>> probe_pt(", LOGICAL_X_POSITION(rx)); SERIAL_ECHOPAIR(", ", LOGICAL_Y_POSITION(ry)); - SERIAL_ECHOPAIR(", ", raise_after == PROBE_PT_RAISE ? "raise" : raise_after == PROBE_PT_STOW ? "stow" : "none"); - SERIAL_ECHOPAIR(", ", int(verbose_level)); - SERIAL_ECHOPAIR(", ", probe_relative ? "probe" : "nozzle"); - SERIAL_ECHOLNPGM("_relative)"); + SERIAL_ECHOPAIR(", ", stow ? "" : "no "); + SERIAL_ECHOLNPGM("stow)"); DEBUG_POS("", current_position); } #endif @@ -2443,7 +2328,7 @@ void clean_up_after_endstop_or_probe_move() { const float nz = #if ENABLED(DELTA) // Move below clip height or xy move will be aborted by do_blocking_move_to - MIN(current_position[Z_AXIS], delta_clip_start_height) + min(current_position[Z_AXIS], delta_clip_start_height) #else current_position[Z_AXIS] #endif @@ -2459,10 +2344,9 @@ void clean_up_after_endstop_or_probe_move() { if (!DEPLOY_PROBE()) { measured_z = run_z_probe() + zprobe_zoffset; - const bool big_raise = raise_after == PROBE_PT_BIG_RAISE; - if (big_raise || raise_after == PROBE_PT_RAISE) - do_blocking_move_to_z(current_position[Z_AXIS] + (big_raise ? 25 : Z_CLEARANCE_BETWEEN_PROBES), MMM_TO_MMS(Z_PROBE_SPEED_FAST)); - else if (raise_after == PROBE_PT_STOW) + if (!stow) + do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); + else if (STOW_PROBE()) measured_z = NAN; } @@ -2476,6 +2360,10 @@ void clean_up_after_endstop_or_probe_move() { SERIAL_EOL(); } + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< probe_pt"); + #endif + feedrate_mm_s = old_feedrate_mm_s; if (isnan(measured_z)) { @@ -2484,10 +2372,6 @@ void clean_up_after_endstop_or_probe_move() { SERIAL_ERRORLNPGM(MSG_ERR_PROBING_FAILED); } - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< probe_pt"); - #endif - return measured_z; } @@ -2498,11 +2382,11 @@ void clean_up_after_endstop_or_probe_move() { bool leveling_is_valid() { return #if ENABLED(MESH_BED_LEVELING) - mbl.has_mesh() + mbl.has_mesh #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) !!bilinear_grid_spacing[X_AXIS] #elif ENABLED(AUTO_BED_LEVELING_UBL) - ubl.mesh_is_valid() + true #else // 3POINT, LINEAR true #endif @@ -2526,8 +2410,6 @@ void clean_up_after_endstop_or_probe_move() { if (can_change && enable != planner.leveling_active) { - planner.synchronize(); - #if ENABLED(MESH_BED_LEVELING) if (!enable) @@ -2544,27 +2426,13 @@ void clean_up_after_endstop_or_probe_move() { planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); planner.leveling_active = false; // disable only AFTER calling apply_leveling } - else { // leveling from off to on + else { // leveling from off to on planner.leveling_active = true; // enable BEFORE calling unapply_leveling, otherwise ignored // change physical current_position to unleveled current_position without moving steppers. planner.unapply_leveling(current_position); } #else - // UBL equivalents for apply/unapply_leveling - #if ENABLED(SKEW_CORRECTION) - float pos[XYZ] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; - planner.skew(pos[X_AXIS], pos[Y_AXIS], pos[Z_AXIS]); - #else - const float (&pos)[XYZE] = current_position; - #endif - if (planner.leveling_active) { - current_position[Z_AXIS] += ubl.get_z_correction(pos[X_AXIS], pos[Y_AXIS]); - planner.leveling_active = false; - } - else { - planner.leveling_active = true; - current_position[Z_AXIS] -= ubl.get_z_correction(pos[X_AXIS], pos[Y_AXIS]); - } + planner.leveling_active = enable; // just flip the bit, current_position will be wrong until next move. #endif #else // ABL @@ -2603,16 +2471,30 @@ void clean_up_after_endstop_or_probe_move() { void set_z_fade_height(const float zfh, const bool do_report/*=true*/) { - if (planner.z_fade_height == zfh) return; + if (planner.z_fade_height == zfh) return; // do nothing if no change - const bool leveling_was_active = planner.leveling_active; - set_bed_leveling_enabled(false); + const bool level_active = planner.leveling_active; + + #if ENABLED(AUTO_BED_LEVELING_UBL) + if (level_active) set_bed_leveling_enabled(false); // turn off before changing fade height for proper apply/unapply leveling to maintain current_position + #endif planner.set_z_fade_height(zfh); - if (leveling_was_active) { + if (level_active) { const float oldpos[] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; - set_bed_leveling_enabled(true); + #if ENABLED(AUTO_BED_LEVELING_UBL) + set_bed_leveling_enabled(true); // turn back on after changing fade height + #else + set_current_from_steppers_for_axis( + #if ABL_PLANAR + ALL_AXES + #else + Z_AXIS + #endif + ); + SYNC_PLAN_POSITION_KINEMATIC(); + #endif if (do_report && memcmp(oldpos, current_position, sizeof(oldpos))) report_current_position(); } @@ -2629,7 +2511,10 @@ void clean_up_after_endstop_or_probe_move() { #endif set_bed_leveling_enabled(false); #if ENABLED(MESH_BED_LEVELING) - mbl.reset(); + if (leveling_is_valid()) { + mbl.reset(); + mbl.has_mesh = false; + } #elif ENABLED(AUTO_BED_LEVELING_UBL) ubl.reset(); #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) @@ -2660,12 +2545,12 @@ void clean_up_after_endstop_or_probe_move() { /** * Print calibration results for plotting or manual frame adjustment. */ - void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, const element_2d_fn fn) { + static void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, float (*fn)(const uint8_t, const uint8_t)) { #ifndef SCAD_MESH_OUTPUT for (uint8_t x = 0; x < sx; x++) { for (uint8_t i = 0; i < precision + 2 + (x < 10 ? 1 : 0); i++) SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOL(int(x)); + SERIAL_PROTOCOL((int)x); } SERIAL_EOL(); #endif @@ -2677,14 +2562,14 @@ void clean_up_after_endstop_or_probe_move() { SERIAL_PROTOCOLPGM(" ["); // open sub-array #else if (y < 10) SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOL(int(y)); + SERIAL_PROTOCOL((int)y); #endif for (uint8_t x = 0; x < sx; x++) { SERIAL_PROTOCOLCHAR(' '); const float offset = fn(x, y); if (!isnan(offset)) { if (offset >= 0) SERIAL_PROTOCOLCHAR('+'); - SERIAL_PROTOCOL_F(offset, int(precision)); + SERIAL_PROTOCOL_F(offset, precision); } else { #ifdef SCAD_MESH_OUTPUT @@ -2725,11 +2610,11 @@ void clean_up_after_endstop_or_probe_move() { if (DEBUGGING(LEVELING)) { SERIAL_ECHOPGM("Extrapolate ["); if (x < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(int(x)); + SERIAL_ECHO((int)x); SERIAL_CHAR(xdir ? (xdir > 0 ? '+' : '-') : ' '); SERIAL_CHAR(' '); if (y < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(int(y)); + SERIAL_ECHO((int)y); SERIAL_CHAR(ydir ? (ydir > 0 ? '+' : '-') : ' '); SERIAL_CHAR(']'); } @@ -2931,134 +2816,55 @@ void clean_up_after_endstop_or_probe_move() { #endif // AUTO_BED_LEVELING_BILINEAR -#if ENABLED(SENSORLESS_HOMING) - - /** - * Set sensorless homing if the axis has it, accounting for Core Kinematics. - */ - void sensorless_homing_per_axis(const AxisEnum axis, const bool enable=true) { - switch (axis) { - #if X_SENSORLESS - case X_AXIS: - tmc_sensorless_homing(stepperX, enable); - #if CORE_IS_XY && Y_SENSORLESS - tmc_sensorless_homing(stepperY, enable); - #elif CORE_IS_XZ && Z_SENSORLESS - tmc_sensorless_homing(stepperZ, enable); - #endif - break; - #endif - #if Y_SENSORLESS - case Y_AXIS: - tmc_sensorless_homing(stepperY, enable); - #if CORE_IS_XY && X_SENSORLESS - tmc_sensorless_homing(stepperX, enable); - #elif CORE_IS_YZ && Z_SENSORLESS - tmc_sensorless_homing(stepperZ, enable); - #endif - break; - #endif - #if Z_SENSORLESS - case Z_AXIS: - tmc_sensorless_homing(stepperZ, enable); - #if CORE_IS_XZ && X_SENSORLESS - tmc_sensorless_homing(stepperX, enable); - #elif CORE_IS_YZ && Y_SENSORLESS - tmc_sensorless_homing(stepperY, enable); - #endif - break; - #endif - default: break; - } - } - -#endif // SENSORLESS_HOMING - /** * Home an individual linear axis */ -static void do_homing_move(const AxisEnum axis, const float distance, const float fr_mm_s=0) { +static void do_homing_move(const AxisEnum axis, const float distance, const float fr_mm_s=0.0) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR(">>> do_homing_move(", axis_codes[axis]); SERIAL_ECHOPAIR(", ", distance); - SERIAL_ECHOPGM(", "); - if (fr_mm_s) - SERIAL_ECHO(fr_mm_s); - else { - SERIAL_ECHOPAIR("[", homing_feedrate(axis)); - SERIAL_CHAR(']'); - } - SERIAL_ECHOLNPGM(")"); + SERIAL_ECHOPAIR(", ", fr_mm_s); + SERIAL_CHAR(')'); + SERIAL_EOL(); } #endif - #if HOMING_Z_WITH_PROBE && HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) - // Wait for bed to heat back up between probing points - if (axis == Z_AXIS && distance < 0 && thermalManager.isHeatingBed()) { - serialprintPGM(msg_wait_for_bed_heating); - LCD_MESSAGEPGM(MSG_BED_HEATING); - while (thermalManager.isHeatingBed()) safe_delay(200); - lcd_reset_status(); - } + #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) + const bool deploy_bltouch = (axis == Z_AXIS && distance < 0); + if (deploy_bltouch) set_bltouch_deployed(true); #endif - // Only do some things when moving towards an endstop - const int8_t axis_home_dir = - #if ENABLED(DUAL_X_CARRIAGE) - (axis == X_AXIS) ? x_home_dir(active_extruder) : - #endif - home_dir(axis); - const bool is_home_dir = (axis_home_dir > 0) == (distance > 0); - - if (is_home_dir) { - - #if HOMING_Z_WITH_PROBE && QUIET_PROBING - if (axis == Z_AXIS) probing_pause(true); - #endif - - // Disable stealthChop if used. Enable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - sensorless_homing_per_axis(axis); - #endif - } + #if QUIET_PROBING + if (axis == Z_AXIS) probing_pause(true); + #endif // Tell the planner the axis is at 0 current_position[axis] = 0; - // Do the move, which is required to hit an endstop #if IS_SCARA SYNC_PLAN_POSITION_KINEMATIC(); current_position[axis] = distance; inverse_kinematics(current_position); - planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], current_position[E_CART], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder); - #elif ENABLED(HANGPRINTER) // TODO: Hangprinter homing is not finished (Jan 7, 2018) - SYNC_PLAN_POSITION_KINEMATIC(); - current_position[axis] = distance; - inverse_kinematics(current_position); - planner.buffer_line(line_lengths[A_AXIS], line_lengths[B_AXIS], line_lengths[C_AXIS], line_lengths[D_AXIS], current_position[E_CART], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder); + planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder); #else sync_plan_position(); - current_position[axis] = distance; // Set delta/cartesian axes directly - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_CART], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder); + current_position[axis] = distance; + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder); #endif - planner.synchronize(); + stepper.synchronize(); - if (is_home_dir) { + #if QUIET_PROBING + if (axis == Z_AXIS) probing_pause(false); + #endif - #if HOMING_Z_WITH_PROBE && QUIET_PROBING - if (axis == Z_AXIS) probing_pause(false); - #endif + #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) + if (deploy_bltouch) set_bltouch_deployed(false); + #endif - endstops.validate_homing_move(); - - // Re-enable stealthChop if used. Disable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - sensorless_homing_per_axis(axis, false); - #endif - } + endstops.hit_on_purpose(); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { @@ -3069,6 +2875,29 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa #endif } +/** + * TMC2130 specific sensorless homing using stallGuard2. + * stallGuard2 only works when in spreadCycle mode. + * spreadCycle and stealthChop are mutually exclusive. + */ +#if ENABLED(SENSORLESS_HOMING) + template + void tmc_sensorless_homing(TMC &st, bool enable=true) { + #if ENABLED(STEALTHCHOP) + if (enable) { + st.coolstep_min_speed(1024UL * 1024UL - 1UL); + st.stealthChop(0); + } + else { + st.coolstep_min_speed(0); + st.stealthChop(1); + } + #endif + + st.diag1_stall(enable ? 1 : 0); + } +#endif + /** * Home an individual "raw axis" to its endstop. * This applies to XYZ on Cartesian and Core robots, and @@ -3080,6 +2909,8 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa * before updating the current position. */ +#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS) + static void homeaxis(const AxisEnum axis) { #if IS_SCARA @@ -3087,7 +2918,7 @@ static void homeaxis(const AxisEnum axis) { if (axis != Z_AXIS) { BUZZ(100, 880); return; } #else #define CAN_HOME(A) \ - (axis == _AXIS(A) && ((A##_MIN_PIN > -1 && A##_HOME_DIR < 0) || (A##_MAX_PIN > -1 && A##_HOME_DIR > 0))) + (axis == A##_AXIS && ((A##_MIN_PIN > -1 && A##_HOME_DIR < 0) || (A##_MAX_PIN > -1 && A##_HOME_DIR > 0))) if (!CAN_HOME(X) && !CAN_HOME(Y) && !CAN_HOME(Z)) return; #endif @@ -3099,12 +2930,11 @@ static void homeaxis(const AxisEnum axis) { } #endif - const int axis_home_dir = ( + const int axis_home_dir = #if ENABLED(DUAL_X_CARRIAGE) - axis == X_AXIS ? x_home_dir(active_extruder) : + (axis == X_AXIS) ? x_home_dir(active_extruder) : #endif - home_dir(axis) - ); + home_dir(axis); // Homing Z towards the bed? Deploy the Z probe or endstop. #if HOMING_Z_WITH_PROBE @@ -3112,43 +2942,36 @@ static void homeaxis(const AxisEnum axis) { #endif // Set flags for X, Y, Z motor locking - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - switch (axis) { - #if ENABLED(X_DUAL_ENDSTOPS) - case X_AXIS: - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - case Y_AXIS: - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - case Z_AXIS: - #endif - stepper.set_homing_dual_axis(true); - default: break; - } + #if ENABLED(X_DUAL_ENDSTOPS) + if (axis == X_AXIS) stepper.set_homing_flag_x(true); + #endif + #if ENABLED(Y_DUAL_ENDSTOPS) + if (axis == Y_AXIS) stepper.set_homing_flag_y(true); + #endif + #if ENABLED(Z_DUAL_ENDSTOPS) + if (axis == Z_AXIS) stepper.set_homing_flag_z(true); + #endif + + // Disable stealthChop if used. Enable diag1 pin on driver. + #if ENABLED(SENSORLESS_HOMING) + #if ENABLED(X_IS_TMC2130) + if (axis == X_AXIS) tmc_sensorless_homing(stepperX); + #endif + #if ENABLED(Y_IS_TMC2130) + if (axis == Y_AXIS) tmc_sensorless_homing(stepperY); + #endif #endif // Fast move towards endstop until triggered #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 1 Fast:"); #endif - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - // BLTOUCH needs to be deployed every time - if (axis == Z_AXIS && set_bltouch_deployed(true)) return; - #endif - - do_homing_move(axis, 1.5f * max_length(axis) * axis_home_dir); - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - // BLTOUCH needs to be stowed after trigger to rearm itself - if (axis == Z_AXIS) set_bltouch_deployed(false); - #endif + do_homing_move(axis, 1.5 * max_length(axis) * axis_home_dir); // When homing Z with probe respect probe clearance const float bump = axis_home_dir * ( #if HOMING_Z_WITH_PROBE - (axis == Z_AXIS && (Z_HOME_BUMP_MM)) ? MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_HOME_BUMP_MM) : + (axis == Z_AXIS) ? max(Z_CLEARANCE_BETWEEN_PROBES, home_bump_mm(Z_AXIS)) : #endif home_bump_mm(axis) ); @@ -3159,28 +2982,13 @@ static void homeaxis(const AxisEnum axis) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Move Away:"); #endif - do_homing_move(axis, -bump - #if HOMING_Z_WITH_PROBE - , axis == Z_AXIS ? MMM_TO_MMS(Z_PROBE_SPEED_FAST) : 0.00 - #endif - ); + do_homing_move(axis, -bump); // Slow move towards endstop until triggered #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 2 Slow:"); #endif - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - // BLTOUCH needs to be deployed every time - if (axis == Z_AXIS && set_bltouch_deployed(true)) return; - #endif - do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis)); - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - // BLTOUCH needs to be stowed after trigger to rearm itself - if (axis == Z_AXIS) set_bltouch_deployed(false); - #endif } /** @@ -3190,38 +2998,34 @@ static void homeaxis(const AxisEnum axis) { const bool pos_dir = axis_home_dir > 0; #if ENABLED(X_DUAL_ENDSTOPS) if (axis == X_AXIS) { - const float adj = ABS(endstops.x_endstop_adj); - if (adj) { - if (pos_dir ? (endstops.x_endstop_adj > 0) : (endstops.x_endstop_adj < 0)) stepper.set_x_lock(true); else stepper.set_x2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_x_lock(false); - stepper.set_x2_lock(false); - } + const bool lock_x1 = pos_dir ? (x_endstop_adj > 0) : (x_endstop_adj < 0); + const float adj = FABS(x_endstop_adj); + if (lock_x1) stepper.set_x_lock(true); else stepper.set_x2_lock(true); + do_homing_move(axis, pos_dir ? -adj : adj); + if (lock_x1) stepper.set_x_lock(false); else stepper.set_x2_lock(false); + stepper.set_homing_flag_x(false); } #endif #if ENABLED(Y_DUAL_ENDSTOPS) if (axis == Y_AXIS) { - const float adj = ABS(endstops.y_endstop_adj); - if (adj) { - if (pos_dir ? (endstops.y_endstop_adj > 0) : (endstops.y_endstop_adj < 0)) stepper.set_y_lock(true); else stepper.set_y2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_y_lock(false); - stepper.set_y2_lock(false); - } + const bool lock_y1 = pos_dir ? (y_endstop_adj > 0) : (y_endstop_adj < 0); + const float adj = FABS(y_endstop_adj); + if (lock_y1) stepper.set_y_lock(true); else stepper.set_y2_lock(true); + do_homing_move(axis, pos_dir ? -adj : adj); + if (lock_y1) stepper.set_y_lock(false); else stepper.set_y2_lock(false); + stepper.set_homing_flag_y(false); } #endif #if ENABLED(Z_DUAL_ENDSTOPS) if (axis == Z_AXIS) { - const float adj = ABS(endstops.z_endstop_adj); - if (adj) { - if (pos_dir ? (endstops.z_endstop_adj > 0) : (endstops.z_endstop_adj < 0)) stepper.set_z_lock(true); else stepper.set_z2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_z_lock(false); - stepper.set_z2_lock(false); - } + const bool lock_z1 = pos_dir ? (z_endstop_adj > 0) : (z_endstop_adj < 0); + const float adj = FABS(z_endstop_adj); + if (lock_z1) stepper.set_z_lock(true); else stepper.set_z2_lock(true); + do_homing_move(axis, pos_dir ? -adj : adj); + if (lock_z1) stepper.set_z_lock(false); else stepper.set_z2_lock(false); + stepper.set_homing_flag_z(false); } #endif - stepper.set_homing_dual_axis(false); #endif #if IS_SCARA @@ -3235,12 +3039,12 @@ static void homeaxis(const AxisEnum axis) { // so here it re-homes each tower in turn. // Delta homing treats the axes as normal linear axes. - // retrace by the amount specified in delta_endstop_adj + additional dist in order to have minimum steps + // retrace by the amount specified in delta_endstop_adj + additional 0.1mm in order to have minimum steps if (delta_endstop_adj[axis] * Z_HOME_DIR <= 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("delta_endstop_adj:"); #endif - do_homing_move(axis, delta_endstop_adj[axis] - (MIN_STEPS_PER_SEGMENT + 1) * planner.steps_to_mm[axis] * Z_HOME_DIR); + do_homing_move(axis, delta_endstop_adj[axis] - 0.1 * Z_HOME_DIR); } #else @@ -3258,16 +3062,21 @@ static void homeaxis(const AxisEnum axis) { #endif + // Re-enable stealthChop if used. Disable diag1 pin on driver. + #if ENABLED(SENSORLESS_HOMING) + #if ENABLED(X_IS_TMC2130) + if (axis == X_AXIS) tmc_sensorless_homing(stepperX, false); + #endif + #if ENABLED(Y_IS_TMC2130) + if (axis == Y_AXIS) tmc_sensorless_homing(stepperY, false); + #endif + #endif + // Put away the Z probe #if HOMING_Z_WITH_PROBE if (axis == Z_AXIS && STOW_PROBE()) return; #endif - // Clear retracted status if homing the Z axis - #if ENABLED(FWRETRACT) - if (axis == Z_AXIS) fwretract.hop_amount = 0.0; - #endif - #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR("<<< homeaxis(", axis_codes[axis]); @@ -3277,16 +3086,138 @@ static void homeaxis(const AxisEnum axis) { #endif } // homeaxis() +#if ENABLED(FWRETRACT) + + /** + * Retract or recover according to firmware settings + * + * This function handles retract/recover moves for G10 and G11, + * plus auto-retract moves sent from G0/G1 when E-only moves are done. + * + * To simplify the logic, doubled retract/recover moves are ignored. + * + * Note: Z lift is done transparently to the planner. Aborting + * a print between G10 and G11 may corrupt the Z position. + * + * Note: Auto-retract will apply the set Z hop in addition to any Z hop + * included in the G-code. Use M207 Z0 to to prevent double hop. + */ + void retract(const bool retracting + #if EXTRUDERS > 1 + , bool swapping = false + #endif + ) { + + static float hop_amount = 0.0; // Total amount lifted, for use in recover + + // Prevent two retracts or recovers in a row + if (retracted[active_extruder] == retracting) return; + + // Prevent two swap-retract or recovers in a row + #if EXTRUDERS > 1 + // Allow G10 S1 only after G10 + if (swapping && retracted_swap[active_extruder] == retracting) return; + // G11 priority to recover the long retract if activated + if (!retracting) swapping = retracted_swap[active_extruder]; + #else + const bool swapping = false; + #endif + + /* // debugging + SERIAL_ECHOLNPAIR("retracting ", retracting); + SERIAL_ECHOLNPAIR("swapping ", swapping); + SERIAL_ECHOLNPAIR("active extruder ", active_extruder); + for (uint8_t i = 0; i < EXTRUDERS; ++i) { + SERIAL_ECHOPAIR("retracted[", i); + SERIAL_ECHOLNPAIR("] ", retracted[i]); + SERIAL_ECHOPAIR("retracted_swap[", i); + SERIAL_ECHOLNPAIR("] ", retracted_swap[i]); + } + SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]); + SERIAL_ECHOLNPAIR("hop_amount ", hop_amount); + //*/ + + const bool has_zhop = retract_zlift > 0.01; // Is there a hop set? + const float old_feedrate_mm_s = feedrate_mm_s; + + // The current position will be the destination for E and Z moves + set_destination_from_current(); + stepper.synchronize(); // Wait for buffered moves to complete + + const float renormalize = 1.0 / planner.e_factor[active_extruder]; + + if (retracting) { + // Retract by moving from a faux E position back to the current E position + feedrate_mm_s = retract_feedrate_mm_s; + current_position[E_AXIS] += (swapping ? swap_retract_length : retract_length) * renormalize; + sync_plan_position_e(); + prepare_move_to_destination(); + + // Is a Z hop set, and has the hop not yet been done? + if (has_zhop && !hop_amount) { + hop_amount += retract_zlift; // Carriage is raised for retraction hop + feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS]; // Z feedrate to max + current_position[Z_AXIS] -= retract_zlift; // Pretend current pos is lower. Next move raises Z. + SYNC_PLAN_POSITION_KINEMATIC(); // Set the planner to the new position + prepare_move_to_destination(); // Raise up to the old current pos + feedrate_mm_s = retract_feedrate_mm_s; // Restore feedrate + } + } + else { + // If a hop was done and Z hasn't changed, undo the Z hop + if (hop_amount) { + current_position[Z_AXIS] += retract_zlift; // Pretend current pos is lower. Next move raises Z. + SYNC_PLAN_POSITION_KINEMATIC(); // Set the planner to the new position + feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS]; // Z feedrate to max + prepare_move_to_destination(); // Raise up to the old current pos + hop_amount = 0.0; // Clear hop + } + + // A retract multiplier has been added here to get faster swap recovery + feedrate_mm_s = swapping ? swap_retract_recover_feedrate_mm_s : retract_recover_feedrate_mm_s; + + const float move_e = swapping ? swap_retract_length + swap_retract_recover_length : retract_length + retract_recover_length; + current_position[E_AXIS] -= move_e * renormalize; + sync_plan_position_e(); + prepare_move_to_destination(); // Recover E + } + + feedrate_mm_s = old_feedrate_mm_s; // Restore original feedrate + + retracted[active_extruder] = retracting; // Active extruder now retracted / recovered + + // If swap retract/recover update the retracted_swap flag too + #if EXTRUDERS > 1 + if (swapping) retracted_swap[active_extruder] = retracting; + #endif + + /* // debugging + SERIAL_ECHOLNPAIR("retracting ", retracting); + SERIAL_ECHOLNPAIR("swapping ", swapping); + SERIAL_ECHOLNPAIR("active_extruder ", active_extruder); + for (uint8_t i = 0; i < EXTRUDERS; ++i) { + SERIAL_ECHOPAIR("retracted[", i); + SERIAL_ECHOLNPAIR("] ", retracted[i]); + SERIAL_ECHOPAIR("retracted_swap[", i); + SERIAL_ECHOLNPAIR("] ", retracted_swap[i]); + } + SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]); + SERIAL_ECHOLNPAIR("hop_amount ", hop_amount); + //*/ + + } + +#endif // FWRETRACT + #if ENABLED(MIXING_EXTRUDER) void normalize_mix() { float mix_total = 0.0; - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) mix_total += mixing_factor[i]; + for (uint8_t i = 0; i < MIXING_STEPPERS; i++) mix_total += RECIPROCAL(mixing_factor[i]); // Scale all values if they don't add up to ~1.0 if (!NEAR(mix_total, 1.0)) { SERIAL_PROTOCOLLNPGM("Warning: Mix factors must add up to 1.0. Scaling."); - const float inverse_sum = RECIPROCAL(mix_total); - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) mixing_factor[i] *= inverse_sum; + for (uint8_t i = 0; i < MIXING_STEPPERS; i++) mixing_factor[i] *= mix_total; } } @@ -3295,25 +3226,14 @@ static void homeaxis(const AxisEnum axis) { // The total "must" be 1.0 (but it will be normalized) // If no mix factors are given, the old mix is preserved void gcode_get_mix() { - const char mixing_codes[] = { 'A', 'B' - #if MIXING_STEPPERS > 2 - , 'C' - #if MIXING_STEPPERS > 3 - , 'D' - #if MIXING_STEPPERS > 4 - , 'H' - #if MIXING_STEPPERS > 5 - , 'I' - #endif // MIXING_STEPPERS > 5 - #endif // MIXING_STEPPERS > 4 - #endif // MIXING_STEPPERS > 3 - #endif // MIXING_STEPPERS > 2 - }; + const char* mixing_codes = "ABCDHI"; byte mix_bits = 0; for (uint8_t i = 0; i < MIXING_STEPPERS; i++) { if (parser.seenval(mixing_codes[i])) { SBI(mix_bits, i); - mixing_factor[i] = MAX(parser.value_float(), 0.0); + float v = parser.value_float(); + NOLESS(v, 0.0); + mixing_factor[i] = RECIPROCAL(v); } } // If any mixing factors were included, clear the rest @@ -3344,21 +3264,19 @@ static void homeaxis(const AxisEnum axis) { void gcode_get_destination() { LOOP_XYZE(i) { if (parser.seen(axis_codes[i])) { - const float v = parser.value_axis_units((AxisEnum)i); - destination[i] = (axis_relative_modes[i] || relative_mode) - ? current_position[i] + v - : (i == E_CART) ? v : LOGICAL_TO_NATIVE(v, i); + const float v = parser.value_axis_units((AxisEnum)i) + (axis_relative_modes[i] || relative_mode ? current_position[i] : 0); + destination[i] = i == E_AXIS ? v : LOGICAL_TO_NATIVE(v, i); } else destination[i] = current_position[i]; } - if (parser.linearval('F') > 0) + if (parser.linearval('F') > 0.0) feedrate_mm_s = MMM_TO_MMS(parser.value_feedrate()); #if ENABLED(PRINTCOUNTER) if (!DEBUGGING(DRYRUN)) - print_job_timer.incFilamentUsed(destination[E_CART] - current_position[E_CART]); + print_job_timer.incFilamentUsed(destination[E_AXIS] - current_position[E_AXIS]); #endif // Get ABCDHI mixing factors @@ -3375,7 +3293,7 @@ void gcode_get_destination() { */ void host_keepalive() { const millis_t ms = millis(); - if (!suspend_auto_report && host_keepalive_interval && busy_state != NOT_BUSY) { + if (host_keepalive_interval && busy_state != NOT_BUSY) { if (PENDING(ms, next_busy_signal_ms)) return; switch (busy_state) { case IN_HANDLER: @@ -3424,14 +3342,14 @@ inline void gcode_G0_G1( #if ENABLED(FWRETRACT) if (MIN_AUTORETRACT <= MAX_AUTORETRACT) { - // When M209 Autoretract is enabled, convert E-only moves to firmware retract/prime moves - if (fwretract.autoretract_enabled && parser.seen('E') && !(parser.seen('X') || parser.seen('Y') || parser.seen('Z'))) { - const float echange = destination[E_CART] - current_position[E_CART]; - // Is this a retract or prime move? - if (WITHIN(ABS(echange), MIN_AUTORETRACT, MAX_AUTORETRACT) && fwretract.retracted[active_extruder] == (echange > 0.0)) { - current_position[E_CART] = destination[E_CART]; // Hide a G1-based retract/prime from calculations + // When M209 Autoretract is enabled, convert E-only moves to firmware retract/recover moves + if (autoretract_enabled && parser.seen('E') && !(parser.seen('X') || parser.seen('Y') || parser.seen('Z'))) { + const float echange = destination[E_AXIS] - current_position[E_AXIS]; + // Is this a retract or recover move? + if (WITHIN(FABS(echange), MIN_AUTORETRACT, MAX_AUTORETRACT) && retracted[active_extruder] == (echange > 0.0)) { + current_position[E_AXIS] = destination[E_AXIS]; // Hide a G1-based retract/recover from calculations sync_plan_position_e(); // AND from the planner - return fwretract.retract(echange < 0.0); // Firmware-based retract/prime (double-retract ignored) + return retract(echange < 0.0); // Firmware-based retract/recover (double-retract ignored) } } } @@ -3445,12 +3363,12 @@ inline void gcode_G0_G1( #if ENABLED(NANODLP_Z_SYNC) #if ENABLED(NANODLP_ALL_AXIS) - #define _MOVE_SYNC parser.seenval('X') || parser.seenval('Y') || parser.seenval('Z') // For any move wait and output sync message + #define _MOVE_SYNC true // For any move wait and output sync message #else #define _MOVE_SYNC parser.seenval('Z') // Only for Z move #endif if (_MOVE_SYNC) { - planner.synchronize(); + stepper.synchronize(); SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); } #endif @@ -3503,19 +3421,19 @@ inline void gcode_G0_G1( relative_mode = relative_mode_backup; #endif - float arc_offset[2] = { 0, 0 }; + float arc_offset[2] = { 0.0, 0.0 }; if (parser.seenval('R')) { const float r = parser.value_linear_units(), p1 = current_position[X_AXIS], q1 = current_position[Y_AXIS], p2 = destination[X_AXIS], q2 = destination[Y_AXIS]; if (r && (p2 != p1 || q2 != q1)) { - const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1 - dx = p2 - p1, dy = q2 - q1, // X and Y differences - d = HYPOT(dx, dy), // Linear distance between the points - h = SQRT(sq(r) - sq(d * 0.5f)), // Distance to the arc pivot-point - mx = (p1 + p2) * 0.5f, my = (q1 + q2) * 0.5f, // Point between the two points - sx = -dy / d, sy = dx / d, // Slope of the perpendicular bisector - cx = mx + e * h * sx, cy = my + e * h * sy; // Pivot-point of the arc + const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1 + dx = p2 - p1, dy = q2 - q1, // X and Y differences + d = HYPOT(dx, dy), // Linear distance between the points + h = SQRT(sq(r) - sq(d * 0.5)), // Distance to the arc pivot-point + mx = (p1 + p2) * 0.5, my = (q1 + q2) * 0.5, // Point between the two points + sx = -dy / d, sy = dx / d, // Slope of the perpendicular bisector + cx = mx + e * h * sx, cy = my + e * h * sy; // Pivot-point of the arc arc_offset[0] = cx - p1; arc_offset[1] = cy - q1; } @@ -3540,6 +3458,7 @@ inline void gcode_G0_G1( // Send the arc to the planner plan_arc(destination, arc_offset, clockwise); + refresh_cmd_timeout(); } else { // Bad arguments @@ -3552,7 +3471,8 @@ inline void gcode_G0_G1( #endif // ARC_SUPPORT void dwell(millis_t time) { - time += millis(); + refresh_cmd_timeout(); + time += previous_cmd_ms; while (PENDING(millis(), time)) idle(); } @@ -3565,7 +3485,7 @@ inline void gcode_G4() { if (parser.seenval('P')) dwell_ms = parser.value_millis(); // milliseconds to wait if (parser.seenval('S')) dwell_ms = parser.value_millis_from_seconds(); // seconds to wait - planner.synchronize(); + stepper.synchronize(); #if ENABLED(NANODLP_Z_SYNC) SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); #endif @@ -3611,80 +3531,12 @@ inline void gcode_G4() { parser.linearval('Q') }; - plan_cubic_move(destination, offset); + plan_cubic_move(offset); } } #endif // BEZIER_CURVE_SUPPORT -#if ENABLED(UNREGISTERED_MOVE_SUPPORT) - - /** - * G6 implementation for Hangprinter based on - * http://reprap.org/wiki/GCodes#G6:_Direct_Stepper_Move - * Accessed Jan 8, 2018 - * - * G6 is used frequently to tighten lines with Hangprinter, so Hangprinter default is relative moves. - * Hangprinter uses switches - * S1 for absolute moves - * S2 for saving recording new line length after unregistered move - * (typically used while tuning LINE_BUILDUP_COMPENSATION_FEATURE parameters) - */ - - /** - * G6: Direct Stepper Move - */ - inline void gcode_G6() { - bool count_it = false; - #if ENABLED(NO_MOTION_BEFORE_HOMING) - if (axis_unhomed_error()) return; - #endif - if (IsRunning()) { - float go[MOV_AXIS] = { 0.0 }, - tmp_fr_mm_s = 0.0; - - LOOP_MOV_AXIS(i) - if (parser.seen(RAW_AXIS_CODES(i))) - go[i] = parser.value_axis_units((AxisEnum)i); - - #if ENABLED(HANGPRINTER) - #define GO_SRC line_lengths - #elif ENABLED(DELTA) - #define GO_SRC delta - #else - #define GO_SRC current_position - #endif - - if ( - #if ENABLED(HANGPRINTER) // Sending R to another machine is the same as not sending S1 to Hangprinter - parser.byteval('S') != 2 - #else - parser.seen('R') - #endif - ) - LOOP_MOV_AXIS(i) go[i] += GO_SRC[i]; - else - LOOP_MOV_AXIS(i) if (!parser.seen(RAW_AXIS_CODES(i))) go[i] += GO_SRC[i]; - - tmp_fr_mm_s = parser.linearval('F') > 0.0 ? MMM_TO_MMS(parser.value_feedrate()) : feedrate_mm_s; - - #if ENABLED(HANGPRINTER) - if (parser.byteval('S') == 2) { - LOOP_MOV_AXIS(i) line_lengths[i] = go[i]; - count_it = true; - } - #endif - - planner.buffer_segment(go[A_AXIS], go[B_AXIS], go[C_AXIS] - #if ENABLED(HANGPRINTER) - , go[D_AXIS] - #endif - , current_position[E_CART], tmp_fr_mm_s, active_extruder, 0.0, count_it - ); - } - } -#endif - #if ENABLED(FWRETRACT) /** @@ -3693,8 +3545,9 @@ inline void gcode_G4() { inline void gcode_G10() { #if EXTRUDERS > 1 const bool rs = parser.boolval('S'); + retracted_swap[active_extruder] = rs; // Use 'S' for swap, default to false #endif - fwretract.retract(true + retract(true #if EXTRUDERS > 1 , rs #endif @@ -3704,7 +3557,7 @@ inline void gcode_G4() { /** * G11 - Recover filament according to settings of M208 */ - inline void gcode_G11() { fwretract.retract(false); } + inline void gcode_G11() { retract(false); } #endif // FWRETRACT @@ -3778,18 +3631,15 @@ inline void gcode_G4() { } /** - * G53: Apply native workspace to the current move - * - * In CNC G-code G53 is a modifier. + * In CNC G-code G53 is like a modifier * It precedes a movement command (or other modifiers) on the same line. * This is the first command to use parser.chain() to make this possible. - * - * Marlin also uses G53 on a line by itself to go back to native space. */ inline void gcode_G53() { - const int8_t _system = active_coordinate_system; - active_coordinate_system = -1; - if (parser.chain()) { // If this command has more following... + // If this command has more following... + if (parser.chain()) { + const int8_t _system = active_coordinate_system; + active_coordinate_system = -1; process_parsed_command(); active_coordinate_system = _system; } @@ -3862,23 +3712,11 @@ inline void gcode_G4() { const float mlx = max_length(X_AXIS), mly = max_length(Y_AXIS), mlratio = mlx > mly ? mly / mlx : mlx / mly, - fr_mm_s = MIN(homing_feedrate(X_AXIS), homing_feedrate(Y_AXIS)) * SQRT(sq(mlratio) + 1.0); - - #if ENABLED(SENSORLESS_HOMING) - sensorless_homing_per_axis(X_AXIS); - sensorless_homing_per_axis(Y_AXIS); - #endif + fr_mm_s = min(homing_feedrate(X_AXIS), homing_feedrate(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_s); - - endstops.validate_homing_move(); - + endstops.hit_on_purpose(); // clear endstop hit flags current_position[X_AXIS] = current_position[Y_AXIS] = 0.0; - - #if ENABLED(SENSORLESS_HOMING) - sensorless_homing_per_axis(X_AXIS, false); - sensorless_homing_per_axis(Y_AXIS, false); - #endif } #endif // QUICK_HOME @@ -3904,7 +3742,7 @@ inline void gcode_G4() { SERIAL_ECHOLNPGM("FIX_MOUNTED_PROBE"); #elif ENABLED(BLTOUCH) SERIAL_ECHOLNPGM("BLTOUCH"); - #elif HAS_Z_SERVO_PROBE + #elif HAS_Z_SERVO_ENDSTOP SERIAL_ECHOLNPGM("SERVO PROBE"); #elif ENABLED(Z_PROBE_SLED) SERIAL_ECHOLNPGM("Z_PROBE_SLED"); @@ -3928,17 +3766,9 @@ inline void gcode_G4() { SERIAL_ECHOPGM(" (Aligned With"); #endif #if Y_PROBE_OFFSET_FROM_EXTRUDER > 0 - #if IS_SCARA - SERIAL_ECHOPGM("-Distal"); - #else - SERIAL_ECHOPGM("-Back"); - #endif + SERIAL_ECHOPGM("-Back"); #elif Y_PROBE_OFFSET_FROM_EXTRUDER < 0 - #if IS_SCARA - SERIAL_ECHOPGM("-Proximal"); - #else - SERIAL_ECHOPGM("-Front"); - #endif + SERIAL_ECHOPGM("-Front"); #elif X_PROBE_OFFSET_FROM_EXTRUDER != 0 SERIAL_ECHOPGM("-Center"); #endif @@ -3964,15 +3794,11 @@ inline void gcode_G4() { #endif if (planner.leveling_active) { SERIAL_ECHOLNPGM(" (enabled)"); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (planner.z_fade_height) - SERIAL_ECHOLNPAIR("Z Fade: ", planner.z_fade_height); - #endif #if ABL_PLANAR const float diff[XYZ] = { - planner.get_axis_position_mm(X_AXIS) - current_position[X_AXIS], - planner.get_axis_position_mm(Y_AXIS) - current_position[Y_AXIS], - planner.get_axis_position_mm(Z_AXIS) - current_position[Z_AXIS] + stepper.get_axis_position_mm(X_AXIS) - current_position[X_AXIS], + stepper.get_axis_position_mm(Y_AXIS) - current_position[Y_AXIS], + stepper.get_axis_position_mm(Z_AXIS) - current_position[Z_AXIS] }; SERIAL_ECHOPGM("ABL Adjustment X"); if (diff[X_AXIS] > 0) SERIAL_CHAR('+'); @@ -3983,25 +3809,10 @@ inline void gcode_G4() { SERIAL_ECHOPGM(" Z"); if (diff[Z_AXIS] > 0) SERIAL_CHAR('+'); SERIAL_ECHO(diff[Z_AXIS]); - #else - #if ENABLED(AUTO_BED_LEVELING_UBL) - SERIAL_ECHOPGM("UBL Adjustment Z"); - const float rz = ubl.get_z_correction(current_position[X_AXIS], current_position[Y_AXIS]); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - SERIAL_ECHOPAIR("Bilinear Grid X", bilinear_start[X_AXIS]); - SERIAL_ECHOPAIR(" Y", bilinear_start[Y_AXIS]); - SERIAL_ECHOPAIR(" W", ABL_BG_SPACING(X_AXIS)); - SERIAL_ECHOLNPAIR(" H", ABL_BG_SPACING(Y_AXIS)); - SERIAL_ECHOPGM("ABL Adjustment Z"); - const float rz = bilinear_z_offset(current_position); - #endif - SERIAL_ECHO(ftostr43sign(rz, '+')); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (planner.z_fade_height) { - SERIAL_ECHOPAIR(" (", ftostr43sign(rz * planner.fade_scaling_factor_for_z(current_position[Z_AXIS]), '+')); - SERIAL_CHAR(')'); - } - #endif + #elif ENABLED(AUTO_BED_LEVELING_UBL) + SERIAL_ECHOPAIR("UBL Adjustment Z", stepper.get_axis_position_mm(Z_AXIS) - current_position[Z_AXIS]); + #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) + SERIAL_ECHOPAIR("ABL Adjustment Z", bilinear_z_offset(current_position)); #endif } else @@ -4013,20 +3824,10 @@ inline void gcode_G4() { SERIAL_ECHOPGM("Mesh Bed Leveling"); if (planner.leveling_active) { + float rz = current_position[Z_AXIS]; + planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], rz); SERIAL_ECHOLNPGM(" (enabled)"); - SERIAL_ECHOPAIR("MBL Adjustment Z", ftostr43sign(mbl.get_z(current_position[X_AXIS], current_position[Y_AXIS] - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , 1.0 - #endif - ), '+')); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (planner.z_fade_height) { - SERIAL_ECHOPAIR(" (", ftostr43sign( - mbl.get_z(current_position[X_AXIS], current_position[Y_AXIS], planner.fade_scaling_factor_for_z(current_position[Z_AXIS])), '+' - )); - SERIAL_CHAR(')'); - } - #endif + SERIAL_ECHOPAIR("MBL Adjustment Z", rz); } else SERIAL_ECHOPGM(" (disabled)"); @@ -4040,19 +3841,11 @@ inline void gcode_G4() { #if ENABLED(DELTA) - #if ENABLED(SENSORLESS_HOMING) - inline void delta_sensorless_homing(const bool on=true) { - sensorless_homing_per_axis(A_AXIS, on); - sensorless_homing_per_axis(B_AXIS, on); - sensorless_homing_per_axis(C_AXIS, on); - } - #endif - /** * A delta can only safely home all axes at the same time * This is like quick_home_xy() but for 3 towers. */ - inline void home_delta() { + inline bool home_delta() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS(">>> home_delta", current_position); #endif @@ -4060,29 +3853,28 @@ inline void gcode_G4() { ZERO(current_position); sync_plan_position(); - // Disable stealthChop if used. Enable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - delta_sensorless_homing(); - #endif - // Move all carriages together linearly until an endstop is hit. current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = (delta_height + 10); feedrate_mm_s = homing_feedrate(X_AXIS); buffer_line_to_current_position(); - planner.synchronize(); + stepper.synchronize(); - // Re-enable stealthChop if used. Disable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - delta_sensorless_homing(false); - #endif + // If an endstop was not hit, then damage can occur if homing is continued. + // This can occur if the delta height not set correctly. + if (!(Endstops::endstop_hit_bits & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) { + LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED); + SERIAL_ERROR_START(); + SERIAL_ERRORLNPGM(MSG_ERR_HOMING_FAILED); + return false; + } - endstops.validate_homing_move(); + endstops.hit_on_purpose(); // clear endstop hit flags // At least one carriage has reached the top. // Now re-home each carriage separately. - homeaxis(A_AXIS); - homeaxis(B_AXIS); - homeaxis(C_AXIS); + HOMEAXIS(A); + HOMEAXIS(B); + HOMEAXIS(C); // Set all carriages to their home positions // Do this here all at once for Delta, because @@ -4095,33 +3887,18 @@ inline void gcode_G4() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("<<< home_delta", current_position); #endif + + return true; } -#elif ENABLED(HANGPRINTER) - /** - * A hangprinter cannot home itself - */ - inline void home_hangprinter() { - SERIAL_ECHOLNPGM("Warning: G28 is not implemented for Hangprinter."); - } - -#endif - -#ifdef Z_AFTER_PROBING - void move_z_after_probing() { - if (current_position[Z_AXIS] != Z_AFTER_PROBING) { - do_blocking_move_to_z(Z_AFTER_PROBING); - current_position[Z_AXIS] = Z_AFTER_PROBING; - } - } -#endif +#endif // DELTA #if ENABLED(Z_SAFE_HOMING) inline void home_z_safely() { // Disallow Z homing if X or Y are unknown - if (!TEST(axis_known_position, X_AXIS) || !TEST(axis_known_position, Y_AXIS)) { + if (!axis_known_position[X_AXIS] || !axis_known_position[Y_AXIS]) { LCD_MESSAGEPGM(MSG_ERR_Z_HOMING); SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(MSG_ERR_Z_HOMING); @@ -4157,12 +3934,8 @@ inline void gcode_G4() { active_extruder_parked = false; #endif - #if ENABLED(SENSORLESS_HOMING) - safe_delay(500); // Short delay needed to settle - #endif - do_blocking_move_to_xy(destination[X_AXIS], destination[Y_AXIS]); - homeaxis(Z_AXIS); + HOMEAXIS(Z); } else { LCD_MESSAGEPGM(MSG_ZPROBE_OUT); @@ -4191,10 +3964,6 @@ inline void gcode_G4() { * None Home to all axes with no parameters. * With QUICK_HOME enabled XY will home together, then Z. * - * O Home only if position is unknown - * - * Rn Raise by n mm/inches before homing - * * Cartesian parameters * * X Home to the X endstop @@ -4206,36 +3975,13 @@ inline void gcode_G28(const bool always_home_all) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM(">>> G28"); + SERIAL_ECHOLNPGM(">>> gcode_G28"); log_machine_info(); } #endif - #if ENABLED(MARLIN_DEV_MODE) - if (parser.seen('S')) { - LOOP_XYZ(a) set_axis_is_at_home((AxisEnum)a); - SYNC_PLAN_POSITION_KINEMATIC(); - SERIAL_ECHOLNPGM("Simulated Homing"); - report_current_position(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G28"); - #endif - return; - } - #endif - - if (all_axes_known() && parser.boolval('O')) { // home only if needed - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("> homing not needed, skip"); - SERIAL_ECHOLNPGM("<<< G28"); - } - #endif - return; - } - // Wait for planner moves to finish! - planner.synchronize(); + stepper.synchronize(); // Cancel the active G29 session #if ENABLED(PROBE_MANUALLY) @@ -4244,8 +3990,8 @@ inline void gcode_G28(const bool always_home_all) { // Disable the leveling matrix before homing #if HAS_LEVELING - #if ENABLED(RESTORE_LEVELING_AFTER_G28) - const bool leveling_was_active = planner.leveling_active; + #if ENABLED(AUTO_BED_LEVELING_UBL) + const bool ubl_state_at_entry = planner.leveling_active; #endif set_bed_leveling_enabled(false); #endif @@ -4254,17 +4000,9 @@ inline void gcode_G28(const bool always_home_all) { workspace_plane = PLANE_XY; #endif - #if ENABLED(BLTOUCH) - // Make sure any BLTouch error condition is cleared - bltouch_command(BLTOUCH_RESET); - set_bltouch_deployed(false); - #endif - // Always home with tool 0 active #if HOTENDS > 1 - #if DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE) - const uint8_t old_tool_index = active_extruder; - #endif + const uint8_t old_tool_index = active_extruder; tool_change(0, 0, true); #endif @@ -4283,12 +4021,7 @@ inline void gcode_G28(const bool always_home_all) { home_delta(); UNUSED(always_home_all); - #elif ENABLED(HANGPRINTER) - - home_hangprinter(); - UNUSED(always_home_all); - - #else // NOT Delta or Hangprinter + #else // NOT DELTA const bool homeX = always_home_all || parser.seen('X'), homeY = always_home_all || parser.seen('Y'), @@ -4299,20 +4032,18 @@ inline void gcode_G28(const bool always_home_all) { #if Z_HOME_DIR > 0 // If homing away from BED do Z first - if (home_all || homeZ) homeaxis(Z_AXIS); + if (home_all || homeZ) { + HOMEAXIS(Z); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("> HOMEAXIS(Z)", current_position); + #endif + } #endif - const float z_homing_height = ( - #if ENABLED(UNKNOWN_Z_NO_RAISE) - !TEST(axis_known_position, Z_AXIS) ? 0 : - #endif - (parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT) - ); - - if (z_homing_height && (home_all || homeX || homeY)) { + if (home_all || homeX || homeY) { // Raise Z before homing any other axes and z is not already high enough (never lower z) - destination[Z_AXIS] = z_homing_height; + destination[Z_AXIS] = Z_HOMING_HEIGHT; if (destination[Z_AXIS] > current_position[Z_AXIS]) { #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -4330,36 +4061,33 @@ inline void gcode_G28(const bool always_home_all) { #endif - // Home Y (before X) #if ENABLED(HOME_Y_BEFORE_X) - if (home_all || homeY - #if ENABLED(CODEPENDENT_XY_HOMING) - || homeX + // Home Y + if (home_all || homeY) { + HOMEAXIS(Y); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position); #endif - ) homeaxis(Y_AXIS); + } #endif // Home X - if (home_all || homeX - #if ENABLED(CODEPENDENT_XY_HOMING) && DISABLED(HOME_Y_BEFORE_X) - || homeY - #endif - ) { + if (home_all || homeX) { #if ENABLED(DUAL_X_CARRIAGE) // Always home the 2nd (right) extruder first active_extruder = 1; - homeaxis(X_AXIS); + HOMEAXIS(X); // Remember this extruder's position for later tool change inactive_extruder_x_pos = current_position[X_AXIS]; // Home the 1st (left) extruder active_extruder = 0; - homeaxis(X_AXIS); + HOMEAXIS(X); // Consider the active extruder to be parked COPY(raised_parked_position, current_position); @@ -4368,14 +4096,23 @@ inline void gcode_G28(const bool always_home_all) { #else - homeaxis(X_AXIS); + HOMEAXIS(X); #endif + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("> homeX", current_position); + #endif } - // Home Y (after X) #if DISABLED(HOME_Y_BEFORE_X) - if (home_all || homeY) homeaxis(Y_AXIS); + // Home Y + if (home_all || homeY) { + HOMEAXIS(Y); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position); + #endif + } #endif // Home Z last if homing towards the bed @@ -4384,13 +4121,11 @@ inline void gcode_G28(const bool always_home_all) { #if ENABLED(Z_SAFE_HOMING) home_z_safely(); #else - homeaxis(Z_AXIS); + HOMEAXIS(Z); #endif - - #if HOMING_Z_WITH_PROBE && defined(Z_AFTER_PROBING) - move_z_after_probing(); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("> (home_all || homeZ) > final", current_position); #endif - } // home_all || homeZ #endif // Z_HOME_DIR < 0 @@ -4405,14 +4140,14 @@ inline void gcode_G28(const bool always_home_all) { do_blocking_move_to_z(delta_clip_start_height); #endif - #if ENABLED(RESTORE_LEVELING_AFTER_G28) - set_bed_leveling_enabled(leveling_was_active); + #if ENABLED(AUTO_BED_LEVELING_UBL) + set_bed_leveling_enabled(ubl_state_at_entry); #endif clean_up_after_endstop_or_probe_move(); // Restore the active tool after homing - #if HOTENDS > 1 && (DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE)) + #if HOTENDS > 1 #if ENABLED(PARKING_EXTRUDER) #define NO_FETCH false // fetch the previous toolhead #else @@ -4436,24 +4171,33 @@ inline void gcode_G28(const bool always_home_all) { #endif #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G28"); + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< gcode_G28"); #endif } // G28 void home_all_axes() { gcode_G28(true); } +#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."); + } + +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(PROBE_MANUALLY) + #if ENABLED(LCD_BED_LEVELING) + extern bool lcd_wait_for_move; + #else + constexpr bool lcd_wait_for_move = false; + #endif + inline void _manual_goto_xy(const float &rx, const float &ry) { - #ifdef MANUAL_PROBE_START_Z - #if MANUAL_PROBE_HEIGHT > 0 - do_blocking_move_to(rx, ry, MANUAL_PROBE_HEIGHT); - do_blocking_move_to_z(MAX(0,MANUAL_PROBE_START_Z)); - #else - do_blocking_move_to(rx, ry, MAX(0,MANUAL_PROBE_START_Z)); - #endif - #elif MANUAL_PROBE_HEIGHT > 0 + #if MANUAL_PROBE_HEIGHT > 0 const float prev_z = current_position[Z_AXIS]; do_blocking_move_to(rx, ry, MANUAL_PROBE_HEIGHT); do_blocking_move_to_z(prev_z); @@ -4476,6 +4220,15 @@ void home_all_axes() { gcode_G28(true); } // Save 130 bytes with non-duplication of PSTR void echo_not_entered() { SERIAL_PROTOCOLLNPGM(" not entered."); } + void mbl_mesh_report() { + SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(GRID_MAX_POINTS_X) "," STRINGIFY(GRID_MAX_POINTS_Y)); + SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5); + SERIAL_PROTOCOLLNPGM("\nMeasured points:"); + print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5, + [](const uint8_t ix, const uint8_t iy) { return mbl.z_values[ix][iy]; } + ); + } + /** * G29: Mesh-based Z probe, probes a grid and produces a * mesh to compensate for variable bed height @@ -4504,7 +4257,7 @@ void home_all_axes() { gcode_G28(true); } static bool enable_soft_endstops; #endif - MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport); + const MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport); if (!WITHIN(state, 0, 5)) { SERIAL_PROTOCOLLNPGM("S out of range (0-5)."); return; @@ -4516,7 +4269,7 @@ void home_all_axes() { gcode_G28(true); } case MeshReport: if (leveling_is_valid()) { SERIAL_PROTOCOLLNPAIR("State: ", planner.leveling_active ? MSG_ON : MSG_OFF); - mbl.report_mesh(); + mbl_mesh_report(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling has no data."); @@ -4525,11 +4278,8 @@ void home_all_axes() { gcode_G28(true); } case MeshStart: mbl.reset(); mbl_probe_index = 0; - if (!lcd_wait_for_move) { - enqueue_and_echo_commands_P(PSTR("G28\nG29 S2")); - return; - } - state = MeshNext; + enqueue_and_echo_commands_P(lcd_wait_for_move ? PSTR("G29 S2") : PSTR("G28\nG29 S2")); + break; case MeshNext: if (mbl_probe_index < 0) { @@ -4542,11 +4292,9 @@ void home_all_axes() { gcode_G28(true); } // For the initial G29 S2 save software endstop state enable_soft_endstops = soft_endstops_enabled; #endif - // Move close to the bed before the first point - do_blocking_move_to_z(0); } else { - // Save Z for the previous mesh position + // For G29 S2 after adjusting Z. mbl.set_zigzag_z(mbl_probe_index - 1, current_position[Z_AXIS]); #if HAS_SOFTWARE_ENDSTOPS soft_endstops_enabled = enable_soft_endstops; @@ -4554,35 +4302,38 @@ void home_all_axes() { gcode_G28(true); } } // If there's another point to sample, move there with optional lift. if (mbl_probe_index < GRID_MAX_POINTS) { + mbl.zigzag(mbl_probe_index, px, py); + _manual_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]); + #if HAS_SOFTWARE_ENDSTOPS // Disable software endstops to allow manual adjustment // If G29 is not completed, they will not be re-enabled soft_endstops_enabled = false; #endif - mbl.zigzag(mbl_probe_index++, px, py); - _manual_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]); + mbl_probe_index++; } else { // One last "return to the bed" (as originally coded) at completion - current_position[Z_AXIS] = MANUAL_PROBE_HEIGHT; + current_position[Z_AXIS] = Z_MIN_POS + MANUAL_PROBE_HEIGHT; buffer_line_to_current_position(); - planner.synchronize(); + stepper.synchronize(); // After recording the last point, activate home and activate mbl_probe_index = -1; SERIAL_PROTOCOLLNPGM("Mesh probing done."); BUZZ(100, 659); BUZZ(100, 698); + mbl.has_mesh = true; home_all_axes(); set_bed_leveling_enabled(true); #if ENABLED(MESH_G28_REST_ORIGIN) - current_position[Z_AXIS] = 0; + current_position[Z_AXIS] = Z_MIN_POS; set_destination_from_current(); buffer_line_to_destination(homing_feedrate(Z_AXIS)); - planner.synchronize(); + stepper.synchronize(); #endif #if ENABLED(LCD_BED_LEVELING) @@ -4637,10 +4388,10 @@ void home_all_axes() { gcode_G28(true); } reset_bed_level(); break; - } // switch (state) + } // switch(state) - if (state == MeshNext) { - SERIAL_PROTOCOLPAIR("MBL G29 point ", MIN(mbl_probe_index, GRID_MAX_POINTS)); + if (state == MeshStart || state == MeshNext) { + SERIAL_PROTOCOLPAIR("MBL G29 point ", min(mbl_probe_index, GRID_MAX_POINTS)); SERIAL_PROTOCOLLNPAIR(" of ", int(GRID_MAX_POINTS)); } @@ -4669,8 +4420,6 @@ void home_all_axes() { gcode_G28(true); } * * Enhanced G29 Auto Bed Leveling Probe Routine * - * O Auto-level only if needed - * * D Dry-Run mode. Just evaluate the bed Topology - Don't apply * or alter the bed level data. Useful to check the topology * after a first run of G29. @@ -4739,54 +4488,36 @@ void home_all_axes() { gcode_G28(true); } */ inline void gcode_G29() { - #if ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(PROBE_MANUALLY) - const bool seenQ = parser.seen('Q'); - #else - constexpr bool seenQ = false; - #endif - // G29 Q is also available if debugging #if ENABLED(DEBUG_LEVELING_FEATURE) + const bool query = parser.seen('Q'); const uint8_t old_debug_flags = marlin_debug_flags; - if (seenQ) marlin_debug_flags |= DEBUG_LEVELING; + if (query) marlin_debug_flags |= DEBUG_LEVELING; if (DEBUGGING(LEVELING)) { DEBUG_POS(">>> G29", current_position); log_machine_info(); } marlin_debug_flags = old_debug_flags; #if DISABLED(PROBE_MANUALLY) - if (seenQ) return; + if (query) return; #endif #endif #if ENABLED(PROBE_MANUALLY) - const bool seenA = parser.seen('A'); - #else - constexpr bool seenA = false; + const bool seenA = parser.seen('A'), seenQ = parser.seen('Q'), no_action = seenA || seenQ; #endif - const bool no_action = seenA || seenQ, - faux = - #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) - parser.boolval('C') - #else - no_action - #endif - ; + #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) + const bool faux = parser.boolval('C'); + #elif ENABLED(PROBE_MANUALLY) + const bool faux = no_action; + #else + bool constexpr faux = false; + #endif // Don't allow auto-leveling without homing first if (axis_unhomed_error()) return; - if (!no_action && planner.leveling_active && parser.boolval('O')) { // Auto-level only if needed - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("> Auto-level not needed, skip"); - SERIAL_ECHOLNPGM("<<< G29"); - } - #endif - return; - } - // Define local vars 'static' for manual probing, 'auto' otherwise #if ENABLED(PROBE_MANUALLY) #define ABL_VAR static @@ -4799,7 +4530,7 @@ void home_all_axes() { gcode_G28(true); } ABL_VAR bool dryrun, abl_should_enable; #if ENABLED(PROBE_MANUALLY) || ENABLED(AUTO_BED_LEVELING_LINEAR) - ABL_VAR int16_t abl_probe_index; + ABL_VAR int abl_probe_index; #endif #if HAS_SOFTWARE_ENDSTOPS && ENABLED(PROBE_MANUALLY) @@ -4826,9 +4557,9 @@ void home_all_axes() { gcode_G28(true); } #endif #if ENABLED(AUTO_BED_LEVELING_LINEAR) - ABL_VAR int16_t abl_points; + ABL_VAR int abl2; #elif ENABLED(PROBE_MANUALLY) // Bilinear - int16_t constexpr abl_points = GRID_MAX_POINTS; + int constexpr abl2 = GRID_MAX_POINTS; #endif #if ENABLED(AUTO_BED_LEVELING_BILINEAR) @@ -4847,14 +4578,14 @@ void home_all_axes() { gcode_G28(true); } #elif ENABLED(AUTO_BED_LEVELING_3POINT) #if ENABLED(PROBE_MANUALLY) - int8_t constexpr abl_points = 3; // used to show total points + int constexpr abl2 = 3; // used to show total points #endif // Probe at 3 arbitrary points ABL_VAR vector_3 points[3] = { - vector_3(PROBE_PT_1_X, PROBE_PT_1_Y, 0), - vector_3(PROBE_PT_2_X, PROBE_PT_2_Y, 0), - vector_3(PROBE_PT_3_X, PROBE_PT_3_Y, 0) + vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, 0), + vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, 0), + vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, 0) }; #endif // AUTO_BED_LEVELING_3POINT @@ -4869,10 +4600,6 @@ void home_all_axes() { gcode_G28(true); } */ if (!g29_in_progress) { - #if ENABLED(DUAL_X_CARRIAGE) - if (active_extruder != 0) tool_change(0); - #endif - #if ENABLED(PROBE_MANUALLY) || ENABLED(AUTO_BED_LEVELING_LINEAR) abl_probe_index = -1; #endif @@ -4881,8 +4608,7 @@ void home_all_axes() { gcode_G28(true); } #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - const bool seen_w = parser.seen('W'); - if (seen_w) { + if (parser.seen('W')) { if (!leveling_is_valid()) { SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("No bilinear grid"); @@ -4903,8 +4629,8 @@ void home_all_axes() { gcode_G28(true); } if (!isnan(rx) && !isnan(ry)) { // Get nearest i / j from rx / ry - i = (rx - bilinear_start[X_AXIS] + 0.5f * xGridSpacing) / xGridSpacing; - j = (ry - bilinear_start[Y_AXIS] + 0.5f * yGridSpacing) / yGridSpacing; + i = (rx - bilinear_start[X_AXIS] + 0.5 * xGridSpacing) / xGridSpacing; + j = (ry - bilinear_start[Y_AXIS] + 0.5 * yGridSpacing) / yGridSpacing; i = constrain(i, 0, GRID_MAX_POINTS_X - 1); j = constrain(j, 0, GRID_MAX_POINTS_Y - 1); } @@ -4920,14 +4646,10 @@ void home_all_axes() { gcode_G28(true); } return; } // parser.seen('W') - #else - - constexpr bool seen_w = false; - #endif // Jettison bed leveling data - if (!seen_w && parser.seen('J')) { + if (parser.seen('J')) { reset_bed_level(); return; } @@ -4954,16 +4676,12 @@ void home_all_axes() { gcode_G28(true); } abl_grid_points_y = parser.intval('Y', GRID_MAX_POINTS_Y); if (parser.seenval('P')) abl_grid_points_x = abl_grid_points_y = parser.value_int(); - if (!WITHIN(abl_grid_points_x, 2, GRID_MAX_POINTS_X)) { - SERIAL_PROTOCOLLNPGM("?Probe points (X) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); - return; - } - if (!WITHIN(abl_grid_points_y, 2, GRID_MAX_POINTS_Y)) { - SERIAL_PROTOCOLLNPGM("?Probe points (Y) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); + if (abl_grid_points_x < 2 || abl_grid_points_y < 2) { + SERIAL_PROTOCOLLNPGM("?Number of probe points is implausible (2 minimum)."); return; } - abl_points = abl_grid_points_x * abl_grid_points_y; + abl2 = abl_grid_points_x * abl_grid_points_y; mean = 0; #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) @@ -4976,23 +4694,37 @@ void home_all_axes() { gcode_G28(true); } xy_probe_feedrate_mm_s = MMM_TO_MMS(parser.linearval('S', XY_PROBE_SPEED)); - left_probe_bed_position = parser.seenval('L') ? int(RAW_X_POSITION(parser.value_linear_units())) : LEFT_PROBE_BED_POSITION; - right_probe_bed_position = parser.seenval('R') ? int(RAW_X_POSITION(parser.value_linear_units())) : RIGHT_PROBE_BED_POSITION; - front_probe_bed_position = parser.seenval('F') ? int(RAW_Y_POSITION(parser.value_linear_units())) : FRONT_PROBE_BED_POSITION; - back_probe_bed_position = parser.seenval('B') ? int(RAW_Y_POSITION(parser.value_linear_units())) : BACK_PROBE_BED_POSITION; + left_probe_bed_position = parser.seenval('L') ? (int)RAW_X_POSITION(parser.value_linear_units()) : LEFT_PROBE_BED_POSITION; + right_probe_bed_position = parser.seenval('R') ? (int)RAW_X_POSITION(parser.value_linear_units()) : RIGHT_PROBE_BED_POSITION; + front_probe_bed_position = parser.seenval('F') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : FRONT_PROBE_BED_POSITION; + back_probe_bed_position = parser.seenval('B') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : BACK_PROBE_BED_POSITION; - if ( - #if IS_SCARA || ENABLED(DELTA) - !position_is_reachable_by_probe(left_probe_bed_position, 0) - || !position_is_reachable_by_probe(right_probe_bed_position, 0) - || !position_is_reachable_by_probe(0, front_probe_bed_position) - || !position_is_reachable_by_probe(0, back_probe_bed_position) - #else - !position_is_reachable_by_probe(left_probe_bed_position, front_probe_bed_position) - || !position_is_reachable_by_probe(right_probe_bed_position, back_probe_bed_position) - #endif - ) { - SERIAL_PROTOCOLLNPGM("? (L,R,F,B) out of bounds."); + const bool left_out_l = left_probe_bed_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 = 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 = 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 = 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); + } + 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; + } + 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); + } + 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; + } return; } @@ -5008,11 +4740,11 @@ void home_all_axes() { gcode_G28(true); } SERIAL_EOL(); } - planner.synchronize(); + stepper.synchronize(); // Disable auto bed leveling during G29. // Be formal so G29 can be done successively without G28. - if (!no_action) set_bed_leveling_enabled(false); + set_bed_leveling_enabled(false); #if HAS_BED_PROBE // Deploy the probe. Probe will raise if needed. @@ -5088,8 +4820,8 @@ void home_all_axes() { gcode_G28(true); } if (verbose_level || seenQ) { SERIAL_PROTOCOLPGM("Manual G29 "); if (g29_in_progress) { - SERIAL_PROTOCOLPAIR("point ", MIN(abl_probe_index + 1, abl_points)); - SERIAL_PROTOCOLLNPAIR(" of ", abl_points); + SERIAL_PROTOCOLPAIR("point ", min(abl_probe_index + 1, abl2)); + SERIAL_PROTOCOLLNPAIR(" of ", abl2); } else SERIAL_PROTOCOLLNPGM("idle"); @@ -5102,15 +4834,8 @@ void home_all_axes() { gcode_G28(true); } #if HAS_SOFTWARE_ENDSTOPS enable_soft_endstops = soft_endstops_enabled; #endif - // Move close to the bed before the first point - do_blocking_move_to_z(0); } else { - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT) - const uint16_t index = abl_probe_index - 1; - #endif - // For G29 after adjusting Z. // Save the previous Z before going to the next point measured_z = current_position[Z_AXIS]; @@ -5118,17 +4843,13 @@ void home_all_axes() { gcode_G28(true); } #if ENABLED(AUTO_BED_LEVELING_LINEAR) mean += measured_z; - eqnBVector[index] = measured_z; - eqnAMatrix[index + 0 * abl_points] = xProbe; - eqnAMatrix[index + 1 * abl_points] = yProbe; - eqnAMatrix[index + 2 * abl_points] = 1; + eqnBVector[abl_probe_index] = measured_z; + eqnAMatrix[abl_probe_index + 0 * abl2] = xProbe; + eqnAMatrix[abl_probe_index + 1 * abl2] = yProbe; + eqnAMatrix[abl_probe_index + 2 * abl2] = 1; incremental_LSF(&lsf_results, xProbe, yProbe, measured_z); - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - - points[index].z = measured_z; - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) z_values[xCount][yCount] = measured_z + zoffset; @@ -5141,6 +4862,10 @@ void home_all_axes() { gcode_G28(true); } } #endif + #elif ENABLED(AUTO_BED_LEVELING_3POINT) + + points[abl_probe_index].z = measured_z; + #endif } @@ -5151,7 +4876,7 @@ void home_all_axes() { gcode_G28(true); } #if ABL_GRID // Skip any unreachable points - while (abl_probe_index < abl_points) { + while (abl_probe_index < abl2) { // Set xCount, yCount based on abl_probe_index, with zig-zag PR_OUTER_VAR = abl_probe_index / PR_INNER_END; @@ -5178,7 +4903,7 @@ void home_all_axes() { gcode_G28(true); } } // Is there a next point to move to? - if (abl_probe_index < abl_points) { + if (abl_probe_index < abl2) { _manual_goto_xy(xProbe, yProbe); // Can be used here too! #if HAS_SOFTWARE_ENDSTOPS // Disable software endstops to allow manual adjustment @@ -5202,7 +4927,7 @@ void home_all_axes() { gcode_G28(true); } #elif ENABLED(AUTO_BED_LEVELING_3POINT) // Probe at 3 arbitrary points - if (abl_probe_index < abl_points) { + if (abl_probe_index < abl2) { xProbe = points[abl_probe_index].x; yProbe = points[abl_probe_index].y; _manual_goto_xy(xProbe, yProbe); @@ -5241,7 +4966,7 @@ void home_all_axes() { gcode_G28(true); } #else // !PROBE_MANUALLY { - const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; + const bool stow_probe_after_each = parser.boolval('E'); measured_z = 0; @@ -5287,7 +5012,7 @@ void home_all_axes() { gcode_G28(true); } if (!position_is_reachable_by_probe(xProbe, yProbe)) continue; #endif - measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level); + measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level); if (isnan(measured_z)) { set_bed_leveling_enabled(abl_should_enable); @@ -5298,9 +5023,9 @@ void home_all_axes() { gcode_G28(true); } mean += measured_z; eqnBVector[abl_probe_index] = measured_z; - eqnAMatrix[abl_probe_index + 0 * abl_points] = xProbe; - eqnAMatrix[abl_probe_index + 1 * abl_points] = yProbe; - eqnAMatrix[abl_probe_index + 2 * abl_points] = 1; + eqnAMatrix[abl_probe_index + 0 * abl2] = xProbe; + eqnAMatrix[abl_probe_index + 1 * abl2] = yProbe; + eqnAMatrix[abl_probe_index + 2 * abl2] = 1; incremental_LSF(&lsf_results, xProbe, yProbe, measured_z); @@ -5324,7 +5049,7 @@ void home_all_axes() { gcode_G28(true); } // Retain the last probe position xProbe = points[i].x; yProbe = points[i].y; - measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level); + measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level); if (isnan(measured_z)) { set_bed_leveling_enabled(abl_should_enable); break; @@ -5347,7 +5072,7 @@ void home_all_axes() { gcode_G28(true); } #endif // AUTO_BED_LEVELING_3POINT - // Stow the probe. No raise for FIX_MOUNTED_PROBE. + // Raise to _Z_CLEARANCE_DEPLOY_PROBE. Stow the probe. if (STOW_PROBE()) { set_bed_leveling_enabled(abl_should_enable); measured_z = NAN; @@ -5408,7 +5133,7 @@ void home_all_axes() { gcode_G28(true); } plane_equation_coefficients[1] = -lsf_results.B; // but that is not yet tested. plane_equation_coefficients[2] = -lsf_results.D; - mean /= abl_points; + mean /= abl2; if (verbose_level) { SERIAL_PROTOCOLPGM("Eqn coefficients: a: "); @@ -5452,8 +5177,8 @@ void home_all_axes() { gcode_G28(true); } for (uint8_t xx = 0; xx < abl_grid_points_x; xx++) { int ind = indexIntoAB[xx][yy]; float diff = eqnBVector[ind] - mean, - x_tmp = eqnAMatrix[ind + 0 * abl_points], - y_tmp = eqnAMatrix[ind + 1 * abl_points], + x_tmp = eqnAMatrix[ind + 0 * abl2], + y_tmp = eqnAMatrix[ind + 1 * abl2], z_tmp = 0; apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp); @@ -5476,8 +5201,8 @@ void home_all_axes() { gcode_G28(true); } for (int8_t yy = abl_grid_points_y - 1; yy >= 0; yy--) { for (uint8_t xx = 0; xx < abl_grid_points_x; xx++) { int ind = indexIntoAB[xx][yy]; - float x_tmp = eqnAMatrix[ind + 0 * abl_points], - y_tmp = eqnAMatrix[ind + 1 * abl_points], + float x_tmp = eqnAMatrix[ind + 0 * abl2], + y_tmp = eqnAMatrix[ind + 1 * abl2], z_tmp = 0; apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp); @@ -5566,8 +5291,8 @@ void home_all_axes() { gcode_G28(true); } #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT); #endif - planner.synchronize(); enqueue_and_echo_commands_P(PSTR(Z_PROBE_END_SCRIPT)); + stepper.synchronize(); #endif // Auto Bed Leveling is complete! Enable if possible. @@ -5581,16 +5306,12 @@ void home_all_axes() { gcode_G28(true); } if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G29"); #endif + report_current_position(); + KEEPALIVE_STATE(IN_HANDLER); if (planner.leveling_active) SYNC_PLAN_POSITION_KINEMATIC(); - - #if HAS_BED_PROBE && defined(Z_AFTER_PROBING) - move_z_after_probing(); - #endif - - report_current_position(); } #endif // OLDSCHOOL_ABL @@ -5604,7 +5325,7 @@ void home_all_axes() { gcode_G28(true); } * * X Probe X position (default current X) * Y Probe Y position (default current Y) - * E Engage the probe for each probe (default 1) + * E Engage the probe for each probe */ inline void gcode_G30() { const float xpos = parser.linearval('X', current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER), @@ -5619,21 +5340,16 @@ void home_all_axes() { gcode_G28(true); } setup_for_endstop_or_probe_move(); - const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; - const float measured_z = probe_pt(xpos, ypos, raise_after, parser.intval('V', 1)); + const float measured_z = probe_pt(xpos, ypos, parser.boolval('E'), 1); if (!isnan(measured_z)) { - SERIAL_PROTOCOLPAIR_F("Bed X: ", xpos); - SERIAL_PROTOCOLPAIR_F(" Y: ", ypos); - SERIAL_PROTOCOLLNPAIR_F(" Z: ", measured_z); + SERIAL_PROTOCOLPAIR("Bed X: ", FIXFLOAT(xpos)); + SERIAL_PROTOCOLPAIR(" Y: ", FIXFLOAT(ypos)); + SERIAL_PROTOCOLLNPAIR(" Z: ", FIXFLOAT(measured_z)); } clean_up_after_endstop_or_probe_move(); - #ifdef Z_AFTER_PROBING - if (raise_after == PROBE_PT_STOW) move_z_after_probing(); - #endif - report_current_position(); } @@ -5658,7 +5374,7 @@ void home_all_axes() { gcode_G28(true); } constexpr uint8_t _7P_STEP = 1, // 7-point step - to change number of calibration points _4P_STEP = _7P_STEP * 2, // 4-point step NPP = _7P_STEP * 6; // number of calibration points on the radius - enum CalEnum : char { // the 7 main calibration points - add definitions if needed + enum CalEnum { // the 7 main calibration points - add definitions if needed CEN = 0, __A = 1, _AB = __A + _7P_STEP, @@ -5675,52 +5391,7 @@ void home_all_axes() { gcode_G28(true); } #define LOOP_CAL_RAD(VAR) LOOP_CAL_PT(VAR, __A, _7P_STEP) #define LOOP_CAL_ACT(VAR, _4P, _OP) LOOP_CAL_PT(VAR, _OP ? _AB : __A, _4P ? _4P_STEP : _7P_STEP) - #if HOTENDS > 1 - const uint8_t old_tool_index = active_extruder; - #define AC_CLEANUP() ac_cleanup(old_tool_index) - #else - #define AC_CLEANUP() ac_cleanup() - #endif - - float lcd_probe_pt(const float &rx, const float &ry); - - void ac_home() { - endstops.enable(true); - home_delta(); - endstops.not_homing(); - } - - void ac_setup(const bool reset_bed) { - #if HOTENDS > 1 - tool_change(0, 0, true); - #endif - - planner.synchronize(); - setup_for_endstop_or_probe_move(); - - #if HAS_LEVELING - if (reset_bed) reset_bed_level(); // After full calibration bed-level data is no longer valid - #endif - } - - void ac_cleanup( - #if HOTENDS > 1 - const uint8_t old_tool_index - #endif - ) { - #if ENABLED(DELTA_HOME_TO_SAFE_ZONE) - do_blocking_move_to_z(delta_clip_start_height); - #endif - #if HAS_BED_PROBE - STOW_PROBE(); - #endif - clean_up_after_endstop_or_probe_move(); - #if HOTENDS > 1 - tool_change(old_tool_index, 0, true); - #endif - } - - void print_signed_float(const char * const prefix, const float &f) { + static void print_signed_float(const char * const prefix, const float &f) { SERIAL_PROTOCOLPGM(" "); serialprintPGM(prefix); SERIAL_PROTOCOLCHAR(':'); @@ -5728,10 +5399,7 @@ void home_all_axes() { gcode_G28(true); } SERIAL_PROTOCOL_F(f, 2); } - /** - * - Print the delta settings - */ - static void print_calibration_settings(const bool end_stops, const bool tower_angles) { + static void print_G33_settings(const bool end_stops, const bool tower_angles) { SERIAL_PROTOCOLPAIR(".Height:", delta_height); if (end_stops) { print_signed_float(PSTR("Ex"), delta_endstop_adj[A_AXIS]); @@ -5752,25 +5420,16 @@ void home_all_axes() { gcode_G28(true); } if ((!end_stops && tower_angles) || (end_stops && !tower_angles)) { // XOR SERIAL_PROTOCOLPAIR(" Radius:", delta_radius); } - #if HAS_BED_PROBE - if (!end_stops && !tower_angles) { - SERIAL_PROTOCOL_SP(30); - print_signed_float(PSTR("Offset"), zprobe_zoffset); - } - #endif SERIAL_EOL(); } - /** - * - Print the probe results - */ - static void print_calibration_results(const float z_pt[NPP + 1], const bool tower_points, const bool opposite_points) { + static void print_G33_results(const float z_at_pt[NPP + 1], const bool tower_points, const bool opposite_points) { SERIAL_PROTOCOLPGM(". "); - print_signed_float(PSTR("c"), z_pt[CEN]); + print_signed_float(PSTR("c"), z_at_pt[CEN]); if (tower_points) { - print_signed_float(PSTR(" x"), z_pt[__A]); - print_signed_float(PSTR(" y"), z_pt[__B]); - print_signed_float(PSTR(" z"), z_pt[__C]); + print_signed_float(PSTR(" x"), z_at_pt[__A]); + print_signed_float(PSTR(" y"), z_at_pt[__B]); + print_signed_float(PSTR(" z"), z_at_pt[__C]); } if (tower_points && opposite_points) { SERIAL_EOL(); @@ -5778,63 +5437,50 @@ void home_all_axes() { gcode_G28(true); } SERIAL_PROTOCOL_SP(13); } if (opposite_points) { - print_signed_float(PSTR("yz"), z_pt[_BC]); - print_signed_float(PSTR("zx"), z_pt[_CA]); - print_signed_float(PSTR("xy"), z_pt[_AB]); + print_signed_float(PSTR("yz"), z_at_pt[_BC]); + print_signed_float(PSTR("zx"), z_at_pt[_CA]); + print_signed_float(PSTR("xy"), z_at_pt[_AB]); } SERIAL_EOL(); } /** - * - Calculate the standard deviation from the zero plane + * After G33: + * - Move to the print ceiling (DELTA_HOME_TO_SAFE_ZONE only) + * - Stow the probe + * - Restore endstops state + * - Select the old tool, if needed */ - static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool _1p_cal, const bool _4p_cal, const bool _4p_opp) { - if (!_0p_cal) { - float S2 = sq(z_pt[CEN]); - int16_t N = 1; - if (!_1p_cal) { // std dev from zero plane - LOOP_CAL_ACT(rad, _4p_cal, _4p_opp) { - S2 += sq(z_pt[rad]); - N++; - } - return LROUND(SQRT(S2 / N) * 1000.0) / 1000.0 + 0.00001; - } - } - return 0.00001; + static void G33_cleanup( + #if HOTENDS > 1 + const uint8_t old_tool_index + #endif + ) { + #if ENABLED(DELTA_HOME_TO_SAFE_ZONE) + do_blocking_move_to_z(delta_clip_start_height); + #endif + STOW_PROBE(); + clean_up_after_endstop_or_probe_move(); + #if HOTENDS > 1 + tool_change(old_tool_index, 0, true); + #endif } - /** - * - Probe a point - */ - static float calibration_probe(const float &nx, const float &ny, const bool stow, const bool set_up) { + inline float calibration_probe(const float nx, const float ny, const bool stow) { #if HAS_BED_PROBE - return probe_pt(nx, ny, set_up ? PROBE_PT_BIG_RAISE : stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, false); + return probe_pt(nx, ny, stow, 0, false); #else UNUSED(stow); - UNUSED(set_up); return lcd_probe_pt(nx, ny); #endif } - #if HAS_BED_PROBE && ENABLED(ULTIPANEL) - static float probe_z_shift(const float center) { - STOW_PROBE(); - endstops.enable_z_probe(false); - float z_shift = lcd_probe_pt(0, 0) - center; - endstops.enable_z_probe(true); - return z_shift; - } - #endif - - /** - * - Probe a grid - */ - static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_points, const bool towers_set, const bool stow_after_each, const bool set_up) { + static float probe_G33_points(float z_at_pt[NPP + 1], const int8_t probe_points, const bool towers_set, const bool stow_after_each) { const bool _0p_calibration = probe_points == 0, - _1p_calibration = probe_points == 1 || probe_points == -1, + _1p_calibration = probe_points == 1, _4p_calibration = probe_points == 2, _4p_opposite_points = _4p_calibration && !towers_set, - _7p_calibration = probe_points >= 3, + _7p_calibration = probe_points >= 3 || probe_points == 0, _7p_no_intermediates = probe_points == 3, _7p_1_intermediates = probe_points == 4, _7p_2_intermediates = probe_points == 5, @@ -5844,28 +5490,28 @@ void home_all_axes() { gcode_G28(true); } _7p_11_intermediates = probe_points == 9, _7p_14_intermediates = probe_points == 10, _7p_intermed_points = probe_points >= 4, - _7p_6_center = probe_points >= 5 && probe_points <= 7, - _7p_9_center = probe_points >= 8; + _7p_6_centre = probe_points >= 5 && probe_points <= 7, + _7p_9_centre = probe_points >= 8; - LOOP_CAL_ALL(rad) z_pt[rad] = 0.0; + LOOP_CAL_ALL(axis) z_at_pt[axis] = 0.0; if (!_0p_calibration) { if (!_7p_no_intermediates && !_7p_4_intermediates && !_7p_11_intermediates) { // probe the center - z_pt[CEN] += calibration_probe(0, 0, stow_after_each, set_up); - if (isnan(z_pt[CEN])) return false; + z_at_pt[CEN] += calibration_probe(0, 0, stow_after_each); + if (isnan(z_at_pt[CEN])) return NAN; } if (_7p_calibration) { // probe extra center points - const float start = _7p_9_center ? float(_CA) + _7P_STEP / 3.0 : _7p_6_center ? float(_CA) : float(__C), - steps = _7p_9_center ? _4P_STEP / 3.0 : _7p_6_center ? _7P_STEP : _4P_STEP; - I_LOOP_CAL_PT(rad, start, steps) { - const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), + const float start = _7p_9_centre ? _CA + _7P_STEP / 3.0 : _7p_6_centre ? _CA : __C, + steps = _7p_9_centre ? _4P_STEP / 3.0 : _7p_6_centre ? _7P_STEP : _4P_STEP; + I_LOOP_CAL_PT(axis, start, steps) { + const float a = RADIANS(210 + (360 / NPP) * (axis - 1)), r = delta_calibration_radius * 0.1; - z_pt[CEN] += calibration_probe(cos(a) * r, sin(a) * r, stow_after_each, set_up); - if (isnan(z_pt[CEN])) return false; + z_at_pt[CEN] += calibration_probe(cos(a) * r, sin(a) * r, stow_after_each); + if (isnan(z_at_pt[CEN])) return NAN; } - z_pt[CEN] /= float(_7p_2_intermediates ? 7 : probe_points); + z_at_pt[CEN] /= float(_7p_2_intermediates ? 7 : probe_points); } if (!_1p_calibration) { // probe the radius @@ -5880,156 +5526,190 @@ void home_all_axes() { gcode_G28(true); } _7p_no_intermediates ? _7P_STEP : // 1r * 6 + 3c = 9 _4P_STEP; // .5r * 6 + 1c = 4 bool zig_zag = true; - F_LOOP_CAL_PT(rad, start, _7p_9_center ? steps * 3 : steps) { - const int8_t offset = _7p_9_center ? 2 : 0; - for (int8_t circle = 0; circle <= offset; circle++) { - const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), - r = delta_calibration_radius * (1 - 0.1 * (zig_zag ? offset - circle : circle)), - interpol = fmod(rad, 1); - const float z_temp = calibration_probe(cos(a) * r, sin(a) * r, stow_after_each, set_up); - if (isnan(z_temp)) return false; + F_LOOP_CAL_PT(axis, start, _7p_9_centre ? steps * 3 : steps) { + const int8_t offset = _7p_9_centre ? 1 : 0; + for (int8_t circle = -offset; circle <= offset; circle++) { + const float a = RADIANS(210 + (360 / NPP) * (axis - 1)), + r = delta_calibration_radius * (1 + 0.1 * (zig_zag ? circle : - circle)), + interpol = fmod(axis, 1); + const float z_temp = calibration_probe(cos(a) * r, sin(a) * r, stow_after_each); + if (isnan(z_temp)) return NAN; // split probe point to neighbouring calibration points - z_pt[uint8_t(LROUND(rad - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90))); - z_pt[uint8_t(LROUND(rad - interpol)) % NPP + 1] += z_temp * sq(sin(RADIANS(interpol * 90))); + z_at_pt[uint8_t(round(axis - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90))); + z_at_pt[uint8_t(round(axis - interpol)) % NPP + 1] += z_temp * sq(sin(RADIANS(interpol * 90))); } zig_zag = !zig_zag; } if (_7p_intermed_points) - LOOP_CAL_RAD(rad) - z_pt[rad] /= _7P_STEP / steps; + LOOP_CAL_RAD(axis) + z_at_pt[axis] /= _7P_STEP / steps; + } - do_blocking_move_to_xy(0.0, 0.0); + float S1 = z_at_pt[CEN], + S2 = sq(z_at_pt[CEN]); + int16_t N = 1; + if (!_1p_calibration) { // std dev from zero plane + LOOP_CAL_ACT(axis, _4p_calibration, _4p_opposite_points) { + S1 += z_at_pt[axis]; + S2 += sq(z_at_pt[axis]); + N++; + } + return round(SQRT(S2 / N) * 1000.0) / 1000.0 + 0.00001; } } - return true; + + return 0.00001; } - /** - * kinematics routines and auto tune matrix scaling parameters: - * see https://github.com/LVD-AC/Marlin-AC/tree/1.1.x-AC/documentation for - * - formulae for approximative forward kinematics in the end-stop displacement matrix - * - definition of the matrix scaling parameters - */ - static void reverse_kinematics_probe_points(float z_pt[NPP + 1], float mm_at_pt_axis[NPP + 1][ABC]) { - float pos[XYZ] = { 0.0 }; + #if HAS_BED_PROBE - LOOP_CAL_ALL(rad) { - const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), - r = (rad == CEN ? 0.0 : delta_calibration_radius); - pos[X_AXIS] = cos(a) * r; - pos[Y_AXIS] = sin(a) * r; - pos[Z_AXIS] = z_pt[rad]; - inverse_kinematics(pos); - LOOP_XYZ(axis) mm_at_pt_axis[rad][axis] = delta[axis]; + static bool G33_auto_tune() { + float z_at_pt[NPP + 1] = { 0.0 }, + z_at_pt_base[NPP + 1] = { 0.0 }, + z_temp, h_fac = 0.0, r_fac = 0.0, a_fac = 0.0, norm = 0.8; + + #define ZP(N,I) ((N) * z_at_pt[I]) + #define Z06(I) ZP(6, I) + #define Z03(I) ZP(3, I) + #define Z02(I) ZP(2, I) + #define Z01(I) ZP(1, I) + #define Z32(I) ZP(3/2, I) + + SERIAL_PROTOCOLPGM("AUTO TUNE baseline"); + SERIAL_EOL(); + if (isnan(probe_G33_points(z_at_pt_base, 3, true, false))) return false; + print_G33_results(z_at_pt_base, true, true); + + LOOP_XYZ(axis) { + delta_endstop_adj[axis] -= 1.0; + recalc_delta_settings(); + + endstops.enable(true); + if (!home_delta()) return false; + endstops.not_homing(); + + SERIAL_PROTOCOLPGM("Tuning E"); + SERIAL_CHAR(tolower(axis_codes[axis])); + SERIAL_EOL(); + + if (isnan(probe_G33_points(z_at_pt, 3, true, false))) return false; + LOOP_CAL_ALL(axis) z_at_pt[axis] -= z_at_pt_base[axis]; + print_G33_results(z_at_pt, true, true); + delta_endstop_adj[axis] += 1.0; + recalc_delta_settings(); + switch (axis) { + case A_AXIS : + h_fac += 4.0 / (Z03(CEN) +Z01(__A) +Z32(_CA) +Z32(_AB)); // Offset by X-tower end-stop + break; + case B_AXIS : + h_fac += 4.0 / (Z03(CEN) +Z01(__B) +Z32(_BC) +Z32(_AB)); // Offset by Y-tower end-stop + break; + case C_AXIS : + h_fac += 4.0 / (Z03(CEN) +Z01(__C) +Z32(_BC) +Z32(_CA) ); // Offset by Z-tower end-stop + break; + } + } + h_fac /= 3.0; + h_fac *= norm; // Normalize to 1.02 for Kossel mini + + for (int8_t zig_zag = -1; zig_zag < 2; zig_zag += 2) { + delta_radius += 1.0 * zig_zag; + recalc_delta_settings(); + + endstops.enable(true); + if (!home_delta()) return false; + endstops.not_homing(); + + SERIAL_PROTOCOLPGM("Tuning R"); + SERIAL_PROTOCOL(zig_zag == -1 ? "-" : "+"); + SERIAL_EOL(); + if (isnan(probe_G33_points(z_at_pt, 3, true, false))) return false; + LOOP_CAL_ALL(axis) z_at_pt[axis] -= z_at_pt_base[axis]; + print_G33_results(z_at_pt, true, true); + delta_radius -= 1.0 * zig_zag; + recalc_delta_settings(); + r_fac -= zig_zag * 6.0 / (Z03(__A) +Z03(__B) +Z03(__C) +Z03(_BC) +Z03(_CA) +Z03(_AB)); // Offset by delta radius + } + r_fac /= 2.0; + r_fac *= 3 * norm; // Normalize to 2.25 for Kossel mini + + LOOP_XYZ(axis) { + delta_tower_angle_trim[axis] += 1.0; + delta_endstop_adj[(axis + 1) % 3] -= 1.0 / 4.5; + delta_endstop_adj[(axis + 2) % 3] += 1.0 / 4.5; + z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]); + delta_height -= z_temp; + LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp; + recalc_delta_settings(); + + endstops.enable(true); + if (!home_delta()) return false; + endstops.not_homing(); + + SERIAL_PROTOCOLPGM("Tuning T"); + SERIAL_CHAR(tolower(axis_codes[axis])); + SERIAL_EOL(); + + if (isnan(probe_G33_points(z_at_pt, 3, true, false))) return false; + LOOP_CAL_ALL(axis) z_at_pt[axis] -= z_at_pt_base[axis]; + print_G33_results(z_at_pt, true, true); + + delta_tower_angle_trim[axis] -= 1.0; + delta_endstop_adj[(axis+1) % 3] += 1.0/4.5; + delta_endstop_adj[(axis+2) % 3] -= 1.0/4.5; + z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]); + delta_height -= z_temp; + LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp; + recalc_delta_settings(); + switch (axis) { + case A_AXIS : + a_fac += 4.0 / ( Z06(__B) -Z06(__C) +Z06(_CA) -Z06(_AB)); // Offset by alpha tower angle + break; + case B_AXIS : + a_fac += 4.0 / (-Z06(__A) +Z06(__C) -Z06(_BC) +Z06(_AB)); // Offset by beta tower angle + break; + case C_AXIS : + a_fac += 4.0 / (Z06(__A) -Z06(__B) +Z06(_BC) -Z06(_CA) ); // Offset by gamma tower angle + break; + } + } + a_fac /= 3.0; + a_fac *= norm; // Normalize to 0.83 for Kossel mini + + endstops.enable(true); + if (!home_delta()) return false; + endstops.not_homing(); + print_signed_float(PSTR( "H_FACTOR: "), h_fac); + print_signed_float(PSTR(" R_FACTOR: "), r_fac); + print_signed_float(PSTR(" A_FACTOR: "), a_fac); + SERIAL_EOL(); + SERIAL_PROTOCOLPGM("Copy these values to Configuration.h"); + SERIAL_EOL(); + return true; } - } - static void forward_kinematics_probe_points(float mm_at_pt_axis[NPP + 1][ABC], float z_pt[NPP + 1]) { - const float r_quot = delta_calibration_radius / delta_radius; - - #define ZPP(N,I,A) ((1 / 3.0 + r_quot * (N) / 3.0 ) * mm_at_pt_axis[I][A]) - #define Z00(I, A) ZPP( 0, I, A) - #define Zp1(I, A) ZPP(+1, I, A) - #define Zm1(I, A) ZPP(-1, I, A) - #define Zp2(I, A) ZPP(+2, I, A) - #define Zm2(I, A) ZPP(-2, I, A) - - z_pt[CEN] = Z00(CEN, A_AXIS) + Z00(CEN, B_AXIS) + Z00(CEN, C_AXIS); - z_pt[__A] = Zp2(__A, A_AXIS) + Zm1(__A, B_AXIS) + Zm1(__A, C_AXIS); - z_pt[__B] = Zm1(__B, A_AXIS) + Zp2(__B, B_AXIS) + Zm1(__B, C_AXIS); - z_pt[__C] = Zm1(__C, A_AXIS) + Zm1(__C, B_AXIS) + Zp2(__C, C_AXIS); - z_pt[_BC] = Zm2(_BC, A_AXIS) + Zp1(_BC, B_AXIS) + Zp1(_BC, C_AXIS); - z_pt[_CA] = Zp1(_CA, A_AXIS) + Zm2(_CA, B_AXIS) + Zp1(_CA, C_AXIS); - z_pt[_AB] = Zp1(_AB, A_AXIS) + Zp1(_AB, B_AXIS) + Zm2(_AB, C_AXIS); - } - - static void calc_kinematics_diff_probe_points(float z_pt[NPP + 1], float delta_e[ABC], float delta_r, float delta_t[ABC]) { - const float z_center = z_pt[CEN]; - float diff_mm_at_pt_axis[NPP + 1][ABC], - new_mm_at_pt_axis[NPP + 1][ABC]; - - reverse_kinematics_probe_points(z_pt, diff_mm_at_pt_axis); - - delta_radius += delta_r; - LOOP_XYZ(axis) delta_tower_angle_trim[axis] += delta_t[axis]; - recalc_delta_settings(); - reverse_kinematics_probe_points(z_pt, new_mm_at_pt_axis); - - LOOP_XYZ(axis) LOOP_CAL_ALL(rad) diff_mm_at_pt_axis[rad][axis] -= new_mm_at_pt_axis[rad][axis] + delta_e[axis]; - forward_kinematics_probe_points(diff_mm_at_pt_axis, z_pt); - - LOOP_CAL_RAD(rad) z_pt[rad] -= z_pt[CEN] - z_center; - z_pt[CEN] = z_center; - - delta_radius -= delta_r; - LOOP_XYZ(axis) delta_tower_angle_trim[axis] -= delta_t[axis]; - recalc_delta_settings(); - } - - static float auto_tune_h() { - const float r_quot = delta_calibration_radius / delta_radius; - float h_fac = 0.0; - - h_fac = r_quot / (2.0 / 3.0); - h_fac = 1.0f / h_fac; // (2/3)/CR - return h_fac; - } - - static float auto_tune_r() { - const float diff = 0.01; - float r_fac = 0.0, - z_pt[NPP + 1] = { 0.0 }, - delta_e[ABC] = {0.0}, - delta_r = {0.0}, - delta_t[ABC] = {0.0}; - - delta_r = diff; - calc_kinematics_diff_probe_points(z_pt, delta_e, delta_r, delta_t); - r_fac = -(z_pt[__A] + z_pt[__B] + z_pt[__C] + z_pt[_BC] + z_pt[_CA] + z_pt[_AB]) / 6.0; - r_fac = diff / r_fac / 3.0; // 1/(3*delta_Z) - return r_fac; - } - - static float auto_tune_a() { - const float diff = 0.01; - float a_fac = 0.0, - z_pt[NPP + 1] = { 0.0 }, - delta_e[ABC] = {0.0}, - delta_r = {0.0}, - delta_t[ABC] = {0.0}; - - LOOP_XYZ(axis) { - LOOP_XYZ(axis_2) delta_t[axis_2] = 0.0; - delta_t[axis] = diff; - calc_kinematics_diff_probe_points(z_pt, delta_e, delta_r, delta_t); - a_fac += z_pt[uint8_t((axis * _4P_STEP) - _7P_STEP + NPP) % NPP + 1] / 6.0; - a_fac -= z_pt[uint8_t((axis * _4P_STEP) + 1 + _7P_STEP)] / 6.0; - } - a_fac = diff / a_fac / 3.0; // 1/(3*delta_Z) - return a_fac; - } + #endif // HAS_BED_PROBE /** * G33 - Delta '1-4-7-point' Auto-Calibration - * Calibrate height, z_offset, endstops, delta radius, and tower angles. + * Calibrate height, endstops, delta radius, and tower angles. * * Parameters: * - * S Setup mode; disables probe protection - * * Pn Number of probe points: - * P-1 Checks the z_offset with a center probe and paper test. - * P0 Normalizes calibration. - * P1 Calibrates height only with center probe. - * P2 Probe center and towers. Calibrate height, endstops and delta radius. - * P3 Probe all positions: center, towers and opposite towers. Calibrate all. - * P4-P10 Probe all positions at different intermediate locations and average them. + * P0 No probe. Normalize only. + * P1 Probe center and set height only. + * P2 Probe center and towers. Set height, endstops and delta radius. + * P3 Probe all positions: center, towers and opposite towers. Set all. + * P4-P10 Probe all positions + at different itermediate locations and average them. * * T Don't calibrate tower angle corrections * * Cn.nn Calibration precision; when omitted calibrates to maximum precision * - * Fn Force to run at least n iterations and take the best result + * Fn Force to run at least n iterations and takes the best result + * + * A Auto tune calibartion factors (set in Configuration.h) * * Vn Verbose level: * V0 Dry-run mode. Report settings and probe results. No calibration. @@ -6041,22 +5721,19 @@ void home_all_axes() { gcode_G28(true); } */ inline void gcode_G33() { - const bool set_up = - #if HAS_BED_PROBE - parser.seen('S'); - #else - false; - #endif - - const int8_t probe_points = set_up ? 2 : parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS); - if (!WITHIN(probe_points, -1, 10)) { - SERIAL_PROTOCOLLNPGM("?(P)oints is implausible (-1 - 10)."); + const int8_t probe_points = parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS); + if (!WITHIN(probe_points, 0, 10)) { + SERIAL_PROTOCOLLNPGM("?(P)oints is implausible (0-10)."); return; } - const bool towers_set = !parser.seen('T'); + const int8_t verbose_level = parser.byteval('V', 1); + if (!WITHIN(verbose_level, 0, 3)) { + SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-3)."); + return; + } - const float calibration_precision = set_up ? Z_CLEARANCE_BETWEEN_PROBES / 5.0 : parser.floatval('C', 0.0); + const float calibration_precision = parser.floatval('C', 0.0); if (calibration_precision < 0) { SERIAL_PROTOCOLLNPGM("?(C)alibration precision is implausible (>=0)."); return; @@ -6064,52 +5741,36 @@ void home_all_axes() { gcode_G28(true); } const int8_t force_iterations = parser.intval('F', 0); if (!WITHIN(force_iterations, 0, 30)) { - SERIAL_PROTOCOLLNPGM("?(F)orce iteration is implausible (0 - 30)."); + SERIAL_PROTOCOLLNPGM("?(F)orce iteration is implausible (0-30)."); return; } - const int8_t verbose_level = parser.byteval('V', 1); - if (!WITHIN(verbose_level, 0, 3)) { - SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0 - 3)."); - return; - } - - const bool stow_after_each = parser.seen('E'); - - if (set_up) { - delta_height = 999.99; - delta_radius = DELTA_PRINTABLE_RADIUS; - ZERO(delta_endstop_adj); - ZERO(delta_tower_angle_trim); - recalc_delta_settings(); - } - - const bool _0p_calibration = probe_points == 0, - _1p_calibration = probe_points == 1 || probe_points == -1, + const bool towers_set = !parser.boolval('T'), + auto_tune = parser.boolval('A'), + stow_after_each = parser.boolval('E'), + _0p_calibration = probe_points == 0, + _1p_calibration = probe_points == 1, _4p_calibration = probe_points == 2, - _4p_opposite_points = _4p_calibration && !towers_set, - _7p_9_center = probe_points >= 8, - _tower_results = (_4p_calibration && towers_set) || probe_points >= 3, - _opposite_results = (_4p_calibration && !towers_set) || probe_points >= 3, - _endstop_results = probe_points != 1 && probe_points != -1 && probe_points != 0, - _angle_results = probe_points >= 3 && towers_set; - static const char save_message[] PROGMEM = "Save with M500 and/or copy to Configuration.h"; + _7p_9_centre = probe_points >= 8, + _tower_results = (_4p_calibration && towers_set) + || probe_points >= 3 || probe_points == 0, + _opposite_results = (_4p_calibration && !towers_set) + || probe_points >= 3 || probe_points == 0, + _endstop_results = probe_points != 1, + _angle_results = (probe_points >= 3 || probe_points == 0) && towers_set; + const static char save_message[] PROGMEM = "Save with M500 and/or copy to Configuration.h"; int8_t iterations = 0; float test_precision, zero_std_dev = (verbose_level ? 999.0 : 0.0), // 0.0 in dry-run mode : forced end zero_std_dev_min = zero_std_dev, - zero_std_dev_old = zero_std_dev, - h_factor, - r_factor, - a_factor, e_old[ABC] = { delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS] }, - r_old = delta_radius, - h_old = delta_height, - a_old[ABC] = { + dr_old = delta_radius, + zh_old = delta_height, + ta_old[ABC] = { delta_tower_angle_trim[A_AXIS], delta_tower_angle_trim[B_AXIS], delta_tower_angle_trim[C_AXIS] @@ -6117,10 +5778,10 @@ void home_all_axes() { gcode_G28(true); } SERIAL_PROTOCOLLNPGM("G33 Auto Calibrate"); - if (!_1p_calibration && !_0p_calibration) { // test if the outer radius is reachable + if (!_1p_calibration && !_0p_calibration) { // test if the outer radius is reachable LOOP_CAL_RAD(axis) { const float a = RADIANS(210 + (360 / NPP) * (axis - 1)), - r = delta_calibration_radius; + r = delta_calibration_radius * (1 + (_7p_9_centre ? 0.1 : 0.0)); if (!position_is_reachable(cos(a) * r, sin(a) * r)) { SERIAL_PROTOCOLLNPGM("?(M665 B)ed radius is implausible."); return; @@ -6128,133 +5789,159 @@ void home_all_axes() { gcode_G28(true); } } } + stepper.synchronize(); + #if HAS_LEVELING + reset_bed_level(); // After calibration bed-level data is no longer valid + #endif + + #if HOTENDS > 1 + const uint8_t old_tool_index = active_extruder; + tool_change(0, 0, true); + #define G33_CLEANUP() G33_cleanup(old_tool_index) + #else + #define G33_CLEANUP() G33_cleanup() + #endif + + setup_for_endstop_or_probe_move(); + endstops.enable(true); + if (!_0p_calibration) { + if (!home_delta()) + return; + endstops.not_homing(); + } + + if (auto_tune) { + #if HAS_BED_PROBE + G33_auto_tune(); + #else + SERIAL_PROTOCOLLNPGM("A probe is needed for auto-tune"); + #endif + G33_CLEANUP(); + return; + } + // Report settings - const char *checkingac = PSTR("Checking... AC"); + + const char *checkingac = PSTR("Checking... AC"); // TODO: Make translatable string serialprintPGM(checkingac); if (verbose_level == 0) SERIAL_PROTOCOLPGM(" (DRY-RUN)"); - if (set_up) SERIAL_PROTOCOLPGM(" (SET-UP)"); SERIAL_EOL(); lcd_setstatusPGM(checkingac); - print_calibration_settings(_endstop_results, _angle_results); + print_G33_settings(_endstop_results, _angle_results); - ac_setup(!_0p_calibration && !_1p_calibration); - - if (!_0p_calibration) ac_home(); - - do { // start iterations + do { float z_at_pt[NPP + 1] = { 0.0 }; - test_precision = zero_std_dev_old != 999.0 ? (zero_std_dev + zero_std_dev_old) / 2 : zero_std_dev; + test_precision = zero_std_dev; + iterations++; // Probe the points - zero_std_dev_old = zero_std_dev; - if (!probe_calibration_points(z_at_pt, probe_points, towers_set, stow_after_each, set_up)) { - SERIAL_PROTOCOLLNPGM("Correct delta settings with M665 and M666"); - return AC_CLEANUP(); + + zero_std_dev = probe_G33_points(z_at_pt, probe_points, towers_set, stow_after_each); + if (isnan(zero_std_dev)) { + SERIAL_PROTOCOLPGM("Correct delta_radius with M665 R or end-stops with M666 X Y Z"); + SERIAL_EOL(); + return G33_CLEANUP(); } - zero_std_dev = std_dev_points(z_at_pt, _0p_calibration, _1p_calibration, _4p_calibration, _4p_opposite_points); // Solve matrices if ((zero_std_dev < test_precision || iterations <= force_iterations) && zero_std_dev > calibration_precision) { + if (zero_std_dev < zero_std_dev_min) { + COPY(e_old, delta_endstop_adj); + dr_old = delta_radius; + zh_old = delta_height; + COPY(ta_old, delta_tower_angle_trim); + } + + float e_delta[ABC] = { 0.0 }, r_delta = 0.0, t_delta[ABC] = { 0.0 }; + const float r_diff = delta_radius - delta_calibration_radius, + h_factor = 1 / 6.0 * + #ifdef H_FACTOR + (H_FACTOR), // Set in Configuration.h + #else + (1.00 + r_diff * 0.001), // 1.02 for r_diff = 20mm + #endif + r_factor = 1 / 6.0 * + #ifdef R_FACTOR + -(R_FACTOR), // Set in Configuration.h + #else + -(1.75 + 0.005 * r_diff + 0.001 * sq(r_diff)), // 2.25 for r_diff = 20mm + #endif + a_factor = 1 / 6.0 * + #ifdef A_FACTOR + (A_FACTOR); // Set in Configuration.h + #else + (66.66 / delta_calibration_radius); // 0.83 for cal_rd = 80mm + #endif + + #define ZP(N,I) ((N) * z_at_pt[I]) + #define Z6(I) ZP(6, I) + #define Z4(I) ZP(4, I) + #define Z2(I) ZP(2, I) + #define Z1(I) ZP(1, I) #if !HAS_BED_PROBE test_precision = 0.00; // forced end #endif - if (zero_std_dev < zero_std_dev_min) { - // set roll-back point - COPY(e_old, delta_endstop_adj); - r_old = delta_radius; - h_old = delta_height; - COPY(a_old, delta_tower_angle_trim); - } - - float e_delta[ABC] = { 0.0 }, - r_delta = 0.0, - t_delta[ABC] = { 0.0 }; - - /** - * convergence matrices: - * see https://github.com/LVD-AC/Marlin-AC/tree/1.1.x-AC/documentation for - * - definition of the matrix scaling parameters - * - matrices for 4 and 7 point calibration - */ - #define ZP(N,I) ((N) * z_at_pt[I] / 4.0) // 4.0 = divider to normalize to integers - #define Z12(I) ZP(12, I) - #define Z4(I) ZP(4, I) - #define Z2(I) ZP(2, I) - #define Z1(I) ZP(1, I) - #define Z0(I) ZP(0, I) - - // calculate factors - const float cr_old = delta_calibration_radius; - if (_7p_9_center) delta_calibration_radius *= 0.9; - h_factor = auto_tune_h(); - r_factor = auto_tune_r(); - a_factor = auto_tune_a(); - delta_calibration_radius = cr_old; - switch (probe_points) { - case -1: - #if HAS_BED_PROBE && ENABLED(ULTIPANEL) - zprobe_zoffset += probe_z_shift(z_at_pt[CEN]); - #endif - case 0: test_precision = 0.00; // forced end break; case 1: test_precision = 0.00; // forced end - LOOP_XYZ(axis) e_delta[axis] = +Z4(CEN); + LOOP_XYZ(axis) e_delta[axis] = Z1(CEN); break; case 2: - if (towers_set) { // see 4 point calibration (towers) matrix - e_delta[A_AXIS] = (+Z4(__A) -Z2(__B) -Z2(__C)) * h_factor +Z4(CEN); - e_delta[B_AXIS] = (-Z2(__A) +Z4(__B) -Z2(__C)) * h_factor +Z4(CEN); - e_delta[C_AXIS] = (-Z2(__A) -Z2(__B) +Z4(__C)) * h_factor +Z4(CEN); - r_delta = (+Z4(__A) +Z4(__B) +Z4(__C) -Z12(CEN)) * r_factor; + if (towers_set) { + e_delta[A_AXIS] = (Z6(CEN) +Z4(__A) -Z2(__B) -Z2(__C)) * h_factor; + e_delta[B_AXIS] = (Z6(CEN) -Z2(__A) +Z4(__B) -Z2(__C)) * h_factor; + e_delta[C_AXIS] = (Z6(CEN) -Z2(__A) -Z2(__B) +Z4(__C)) * h_factor; + r_delta = (Z6(CEN) -Z2(__A) -Z2(__B) -Z2(__C)) * r_factor; } - else { // see 4 point calibration (opposites) matrix - e_delta[A_AXIS] = (-Z4(_BC) +Z2(_CA) +Z2(_AB)) * h_factor +Z4(CEN); - e_delta[B_AXIS] = (+Z2(_BC) -Z4(_CA) +Z2(_AB)) * h_factor +Z4(CEN); - e_delta[C_AXIS] = (+Z2(_BC) +Z2(_CA) -Z4(_AB)) * h_factor +Z4(CEN); - r_delta = (+Z4(_BC) +Z4(_CA) +Z4(_AB) -Z12(CEN)) * r_factor; + else { + e_delta[A_AXIS] = (Z6(CEN) -Z4(_BC) +Z2(_CA) +Z2(_AB)) * h_factor; + e_delta[B_AXIS] = (Z6(CEN) +Z2(_BC) -Z4(_CA) +Z2(_AB)) * h_factor; + e_delta[C_AXIS] = (Z6(CEN) +Z2(_BC) +Z2(_CA) -Z4(_AB)) * h_factor; + r_delta = (Z6(CEN) -Z2(_BC) -Z2(_CA) -Z2(_AB)) * r_factor; } break; - default: // see 7 point calibration (towers & opposites) matrix - e_delta[A_AXIS] = (+Z2(__A) -Z1(__B) -Z1(__C) -Z2(_BC) +Z1(_CA) +Z1(_AB)) * h_factor +Z4(CEN); - e_delta[B_AXIS] = (-Z1(__A) +Z2(__B) -Z1(__C) +Z1(_BC) -Z2(_CA) +Z1(_AB)) * h_factor +Z4(CEN); - e_delta[C_AXIS] = (-Z1(__A) -Z1(__B) +Z2(__C) +Z1(_BC) +Z1(_CA) -Z2(_AB)) * h_factor +Z4(CEN); - r_delta = (+Z2(__A) +Z2(__B) +Z2(__C) +Z2(_BC) +Z2(_CA) +Z2(_AB) -Z12(CEN)) * r_factor; + default: + e_delta[A_AXIS] = (Z6(CEN) +Z2(__A) -Z1(__B) -Z1(__C) -Z2(_BC) +Z1(_CA) +Z1(_AB)) * h_factor; + e_delta[B_AXIS] = (Z6(CEN) -Z1(__A) +Z2(__B) -Z1(__C) +Z1(_BC) -Z2(_CA) +Z1(_AB)) * h_factor; + e_delta[C_AXIS] = (Z6(CEN) -Z1(__A) -Z1(__B) +Z2(__C) +Z1(_BC) +Z1(_CA) -Z2(_AB)) * h_factor; + r_delta = (Z6(CEN) -Z1(__A) -Z1(__B) -Z1(__C) -Z1(_BC) -Z1(_CA) -Z1(_AB)) * r_factor; - if (towers_set) { // see 7 point tower angle calibration (towers & opposites) matrix - t_delta[A_AXIS] = (+Z0(__A) -Z4(__B) +Z4(__C) +Z0(_BC) -Z4(_CA) +Z4(_AB) +Z0(CEN)) * a_factor; - t_delta[B_AXIS] = (+Z4(__A) +Z0(__B) -Z4(__C) +Z4(_BC) +Z0(_CA) -Z4(_AB) +Z0(CEN)) * a_factor; - t_delta[C_AXIS] = (-Z4(__A) +Z4(__B) +Z0(__C) -Z4(_BC) +Z4(_CA) +Z0(_AB) +Z0(CEN)) * a_factor; + if (towers_set) { + t_delta[A_AXIS] = ( -Z4(__B) +Z4(__C) -Z4(_CA) +Z4(_AB)) * a_factor; + t_delta[B_AXIS] = ( Z4(__A) -Z4(__C) +Z4(_BC) -Z4(_AB)) * a_factor; + t_delta[C_AXIS] = (-Z4(__A) +Z4(__B) -Z4(_BC) +Z4(_CA) ) * a_factor; + e_delta[A_AXIS] += (t_delta[B_AXIS] - t_delta[C_AXIS]) / 4.5; + e_delta[B_AXIS] += (t_delta[C_AXIS] - t_delta[A_AXIS]) / 4.5; + e_delta[C_AXIS] += (t_delta[A_AXIS] - t_delta[B_AXIS]) / 4.5; } break; } + LOOP_XYZ(axis) delta_endstop_adj[axis] += e_delta[axis]; delta_radius += r_delta; LOOP_XYZ(axis) delta_tower_angle_trim[axis] += t_delta[axis]; } - else if (zero_std_dev >= test_precision) { - // roll back + else if (zero_std_dev >= test_precision) { // step one back COPY(delta_endstop_adj, e_old); - delta_radius = r_old; - delta_height = h_old; - COPY(delta_tower_angle_trim, a_old); + delta_radius = dr_old; + delta_height = zh_old; + COPY(delta_tower_angle_trim, ta_old); } if (verbose_level != 0) { // !dry run - // normalise angles to least squares if (_angle_results) { float a_sum = 0.0; @@ -6272,15 +5959,15 @@ void home_all_axes() { gcode_G28(true); } // print report - if (verbose_level == 3) - print_calibration_results(z_at_pt, _tower_results, _opposite_results); + if (verbose_level > 2) + print_G33_results(z_at_pt, _tower_results, _opposite_results); - if (verbose_level != 0) { // !dry run - if ((zero_std_dev >= test_precision && iterations > force_iterations) || zero_std_dev <= calibration_precision) { // end iterations + if (verbose_level != 0) { // !dry run + if ((zero_std_dev >= test_precision && iterations > force_iterations) || zero_std_dev <= calibration_precision) { // end iterations SERIAL_PROTOCOLPGM("Calibration OK"); SERIAL_PROTOCOL_SP(32); #if HAS_BED_PROBE - if (zero_std_dev >= test_precision && !_1p_calibration && !_0p_calibration) + if (zero_std_dev >= test_precision && !_1p_calibration) SERIAL_PROTOCOLPGM("rolling back."); else #endif @@ -6292,18 +5979,18 @@ void home_all_axes() { gcode_G28(true); } char mess[21]; strcpy_P(mess, PSTR("Calibration sd:")); if (zero_std_dev_min < 1) - sprintf_P(&mess[15], PSTR("0.%03i"), int(LROUND(zero_std_dev_min * 1000.0))); + sprintf_P(&mess[15], PSTR("0.%03i"), (int)round(zero_std_dev_min * 1000.0)); else - sprintf_P(&mess[15], PSTR("%03i.x"), int(LROUND(zero_std_dev_min))); + sprintf_P(&mess[15], PSTR("%03i.x"), (int)round(zero_std_dev_min)); lcd_setstatus(mess); - print_calibration_settings(_endstop_results, _angle_results); + print_G33_settings(_endstop_results, _angle_results); serialprintPGM(save_message); SERIAL_EOL(); } - else { // !end iterations + else { // !end iterations char mess[15]; if (iterations < 31) - sprintf_P(mess, PSTR("Iteration : %02i"), int(iterations)); + sprintf_P(mess, PSTR("Iteration : %02i"), (int)iterations); else strcpy_P(mess, PSTR("No convergence")); SERIAL_PROTOCOL(mess); @@ -6313,10 +6000,10 @@ void home_all_axes() { gcode_G28(true); } SERIAL_EOL(); lcd_setstatus(mess); if (verbose_level > 1) - print_calibration_settings(_endstop_results, _angle_results); + print_G33_settings(_endstop_results, _angle_results); } } - else { // dry run + else { // dry run const char *enddryrun = PSTR("End DRY-RUN"); serialprintPGM(enddryrun); SERIAL_PROTOCOL_SP(35); @@ -6328,16 +6015,21 @@ void home_all_axes() { gcode_G28(true); } strcpy_P(mess, enddryrun); strcpy_P(&mess[11], PSTR(" sd:")); if (zero_std_dev < 1) - sprintf_P(&mess[15], PSTR("0.%03i"), int(LROUND(zero_std_dev * 1000.0))); + sprintf_P(&mess[15], PSTR("0.%03i"), (int)round(zero_std_dev * 1000.0)); else - sprintf_P(&mess[15], PSTR("%03i.x"), int(LROUND(zero_std_dev))); + sprintf_P(&mess[15], PSTR("%03i.x"), (int)round(zero_std_dev)); lcd_setstatus(mess); } - ac_home(); + + endstops.enable(true); + if (!home_delta()) + return; + endstops.not_homing(); + } while (((zero_std_dev < test_precision && iterations < 31) || iterations <= force_iterations) && zero_std_dev > calibration_precision); - AC_CLEANUP(); + G33_CLEANUP(); } #endif // DELTA_AUTO_CALIBRATION @@ -6353,17 +6045,18 @@ void home_all_axes() { gcode_G28(true); } float retract_mm[XYZ]; LOOP_XYZ(i) { float dist = destination[i] - current_position[i]; - retract_mm[i] = ABS(dist) < G38_MINIMUM_MOVE ? 0 : home_bump_mm((AxisEnum)i) * (dist > 0 ? -1 : 1); + retract_mm[i] = FABS(dist) < G38_MINIMUM_MOVE ? 0 : home_bump_mm((AxisEnum)i) * (dist > 0 ? -1 : 1); } #endif + stepper.synchronize(); // wait until the machine is idle + // Move until destination reached or target hit - planner.synchronize(); endstops.enable(true); G38_move = true; G38_endstop_hit = false; prepare_move_to_destination(); - planner.synchronize(); + stepper.synchronize(); G38_move = false; endstops.hit_on_purpose(); @@ -6380,17 +6073,17 @@ void home_all_axes() { gcode_G28(true); } LOOP_XYZ(i) destination[i] += retract_mm[i]; endstops.enable(false); prepare_move_to_destination(); + stepper.synchronize(); feedrate_mm_s /= 4; // Bump the target more slowly LOOP_XYZ(i) destination[i] -= retract_mm[i] * 2; - planner.synchronize(); endstops.enable(true); G38_move = true; prepare_move_to_destination(); - planner.synchronize(); + stepper.synchronize(); G38_move = false; set_current_from_steppers_for_axis(ALL_AXES); @@ -6417,7 +6110,7 @@ void home_all_axes() { gcode_G28(true); } // If any axis has enough movement, do the move LOOP_XYZ(i) - if (ABS(destination[i] - current_position[i]) >= G38_MINIMUM_MOVE) { + if (FABS(destination[i] - current_position[i]) >= G38_MINIMUM_MOVE) { if (!parser.seenval('F')) feedrate_mm_s = homing_feedrate((AxisEnum)i); // If G38.2 fails throw an error if (!G38_run_probe() && is_38_2) { @@ -6480,6 +6173,8 @@ void home_all_axes() { gcode_G28(true); } */ inline void gcode_G92() { + stepper.synchronize(); + #if ENABLED(CNC_COORDINATE_SYSTEMS) switch (parser.subcode) { case 1: @@ -6504,7 +6199,7 @@ inline void gcode_G92() { #endif bool didE = false; - #if IS_SCARA || !HAS_POSITION_SHIFT || ENABLED(HANGPRINTER) + #if IS_SCARA || !HAS_POSITION_SHIFT bool didXYZ = false; #else constexpr bool didXYZ = false; @@ -6513,20 +6208,16 @@ inline void gcode_G92() { if (IS_G92_0) LOOP_XYZE(i) { if (parser.seenval(axis_codes[i])) { const float l = parser.value_axis_units((AxisEnum)i), - v = i == E_CART ? l : LOGICAL_TO_NATIVE(l, i), + v = i == E_AXIS ? l : LOGICAL_TO_NATIVE(l, i), d = v - current_position[i]; - if (!NEAR_ZERO(d) - #if ENABLED(HANGPRINTER) - || true // Hangprinter needs to update its line lengths whether current_position changed or not - #endif - ) { - #if IS_SCARA || !HAS_POSITION_SHIFT || ENABLED(HANGPRINTER) - if (i == E_CART) didE = true; else didXYZ = true; + if (!NEAR_ZERO(d)) { + #if IS_SCARA || !HAS_POSITION_SHIFT + if (i == E_AXIS) didE = true; else didXYZ = true; current_position[i] = v; // Without workspaces revert to Marlin 1.0 behavior #elif HAS_POSITION_SHIFT - if (i == E_CART) { + if (i == E_AXIS) { didE = true; - current_position[E_CART] = v; // When using coordinate spaces, only E is set directly + current_position[E_AXIS] = v; // When using coordinate spaces, only E is set directly } else { position_shift[i] += d; // Other axes simply offset the coordinate space @@ -6543,191 +6234,14 @@ inline void gcode_G92() { COPY(coordinate_system[active_coordinate_system], position_shift); #endif - // Update planner/steppers only if the native coordinates changed - if (didXYZ) SYNC_PLAN_POSITION_KINEMATIC(); - else if (didE) sync_plan_position_e(); + if (didXYZ) + SYNC_PLAN_POSITION_KINEMATIC(); + else if (didE) + sync_plan_position_e(); report_current_position(); } -#if ENABLED(MECHADUINO_I2C_COMMANDS) - /** - * G95: Set torque mode - */ - inline void gcode_G95() { - i2cFloat torques[NUM_AXIS]; // Assumes 4-byte floats here and in Mechaduino firmware - LOOP_NUM_AXIS(i) - torques[i].fval = parser.floatval(RAW_AXIS_CODES(i), 999.9); // 999.9 chosen to satisfy fabs(999.9) > 255.0 - - // 0x5f == 95 - #define G95_SEND(LETTER) do { \ - if (fabs(torques[_AXIS(LETTER)].fval) < 255.0){ \ - torques[_AXIS(LETTER)].fval = -fabs(torques[_AXIS(LETTER)].fval); \ - if(!INVERT_##LETTER##_DIR) torques[_AXIS(LETTER)].fval = -torques[_AXIS(LETTER)].fval; \ - i2c.address(LETTER##_MOTOR_I2C_ADDR); \ - i2c.reset(); \ - i2c.addbyte(0x5f); \ - i2c.addbytes(torques[_AXIS(LETTER)].bval, sizeof(float)); \ - i2c.send(); \ - }} while(0) - - #if ENABLED(HANGPRINTER) - #if ENABLED(A_IS_MECHADUINO) - G95_SEND(A); - #endif - #if ENABLED(B_IS_MECHADUINO) - G95_SEND(B); - #endif - #if ENABLED(C_IS_MECHADUINO) - G95_SEND(C); - #endif - #if ENABLED(D_IS_MECHADUINO) - G95_SEND(D); - #endif - #else - #if ENABLED(X_IS_MECHADUINO) - G95_SEND(X); - #endif - #if ENABLED(Y_IS_MECHADUINO) - G95_SEND(Y); - #endif - #if ENABLED(Z_IS_MECHADUINO) - G95_SEND(Z); - #endif - #endif - #if ENABLED(E_IS_MECHADUINO) - G95_SEND(E); - #endif - } - - /** - * G96: Mark encoder reference point - */ - inline void gcode_G96() { - bool mark[NUM_AXIS] = { false }; - if (!parser.seen_any()) - LOOP_NUM_AXIS(i) - mark[i] = true; - else - LOOP_NUM_AXIS(i) - if (parser.seen(RAW_AXIS_CODES(i))) - mark[i] = true; - - // 0x60 == 96 - #define G96_SEND(LETTER) do {\ - if (mark[LETTER##_AXIS]){ \ - i2c.address(LETTER##_MOTOR_I2C_ADDR); \ - i2c.reset(); \ - i2c.addbyte(0x60); \ - i2c.send(); \ - }} while(0) - - #if ENABLED(HANGPRINTER) - #if ENABLED(A_IS_MECHADUINO) - G96_SEND(A); - #endif - #if ENABLED(B_IS_MECHADUINO) - G96_SEND(B); - #endif - #if ENABLED(C_IS_MECHADUINO) - G96_SEND(C); - #endif - #if ENABLED(D_IS_MECHADUINO) - G96_SEND(D); - #endif - #else - #if ENABLED(X_IS_MECHADUINO) - G96_SEND(X); - #endif - #if ENABLED(Y_IS_MECHADUINO) - G96_SEND(Y); - #endif - #if ENABLED(Z_IS_MECHADUINO) - G96_SEND(Z); - #endif - #endif - #if ENABLED(E_IS_MECHADUINO) - G96_SEND(E); // E ref point not used by any other commands (Feb 7, 2018) - #endif - } - - float ang_to_mm(float ang, const AxisEnum axis) { - const float abs_step_in_origin = - #if ENABLED(LINE_BUILDUP_COMPENSATION_FEATURE) - planner.k0[axis] * (SQRT(planner.k1[axis] + planner.k2[axis] * line_lengths_origin[axis]) - planner.sqrtk1[axis]) - #else - line_lengths_origin[axis] * planner.axis_steps_per_mm[axis] - #endif - ; - const float c = abs_step_in_origin + ang * float(STEPS_PER_MOTOR_REVOLUTION) / 360.0; // current step count - return - #if ENABLED(LINE_BUILDUP_COMPENSATION_FEATURE) - // Inverse function found in planner.cpp, where target[AXIS_A] is calculated - ((c / planner.k0[axis] + planner.sqrtk1[axis]) * (c / planner.k0[axis] + planner.sqrtk1[axis]) - planner.k1[axis]) / planner.k2[axis] - line_lengths_origin[axis] - #else - c / planner.axis_steps_per_mm[axis] - line_lengths_origin[axis] - #endif - ; - } - - void report_axis_position_from_encoder_data() { - i2cFloat ang; - - #define M114_S1_RECEIVE(LETTER) do { \ - i2c.address(LETTER##_MOTOR_I2C_ADDR); \ - i2c.request(sizeof(float)); \ - i2c.capture(ang.bval, sizeof(float)); \ - if(LETTER##_INVERT_REPORTED_ANGLE == INVERT_##LETTER##_DIR) ang.fval = -ang.fval; \ - SERIAL_PROTOCOL(ang_to_mm(ang.fval, LETTER##_AXIS)); \ - } while(0) - - SERIAL_CHAR('['); - #if ENABLED(HANGPRINTER) - #if ENABLED(A_IS_MECHADUINO) - M114_S1_RECEIVE(A); - #endif - #if ENABLED(B_IS_MECHADUINO) - SERIAL_PROTOCOLPGM(", "); - M114_S1_RECEIVE(B); - #endif - #if ENABLED(C_IS_MECHADUINO) - SERIAL_PROTOCOLPGM(", "); - M114_S1_RECEIVE(C); - #endif - #if ENABLED(D_IS_MECHADUINO) - SERIAL_PROTOCOLPGM(", "); - M114_S1_RECEIVE(D); - #endif - #else - #if ENABLED(X_IS_MECHADUINO) - M114_S1_RECEIVE(X); - #endif - #if ENABLED(Y_IS_MECHADUINO) - SERIAL_PROTOCOLPGM(", "); - M114_S1_RECEIVE(Y); - #endif - #if ENABLED(Z_IS_MECHADUINO) - SERIAL_PROTOCOLPGM(", "); - M114_S1_RECEIVE(Z); - #endif - #endif - SERIAL_CHAR(']'); - SERIAL_EOL(); - } - -#endif // MECHADUINO_I2C_COMMANDS - - -void report_xyz_from_stepper_position() { - get_cartesian_from_steppers(); // writes to cartes[XYZ] - SERIAL_CHAR('['); - SERIAL_PROTOCOL(cartes[X_AXIS]); - SERIAL_PROTOCOLPAIR(", ", cartes[Y_AXIS]); - SERIAL_PROTOCOLPAIR(", ", cartes[Z_AXIS]); - SERIAL_CHAR(']'); - SERIAL_EOL(); -} - #if HAS_RESUME_CONTINUE /** @@ -6748,13 +6262,9 @@ void report_xyz_from_stepper_position() { hasS = ms > 0; } - const bool has_message = !hasP && !hasS && args && *args; - - planner.synchronize(); - #if ENABLED(ULTIPANEL) - if (has_message) + if (!hasP && !hasS && args && *args) lcd_setstatus(args, true); else { LCD_MESSAGEPGM(MSG_USERWAIT); @@ -6765,7 +6275,7 @@ void report_xyz_from_stepper_position() { #else - if (has_message) { + if (!hasP && !hasS && args && *args) { SERIAL_ECHO_START(); SERIAL_ECHOLN(args); } @@ -6775,22 +6285,23 @@ void report_xyz_from_stepper_position() { KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = true; + stepper.synchronize(); + refresh_cmd_timeout(); + if (ms > 0) { - ms += millis(); // wait until this time for a click + ms += previous_cmd_ms; // wait until this time for a click while (PENDING(millis(), ms) && wait_for_user) idle(); } - else - while (wait_for_user) idle(); - - - #if ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT) - if (lights_off_after_print) { - leds.set_off(); - lights_off_after_print = false; - } - #endif - - lcd_reset_status(); + else { + #if ENABLED(ULTIPANEL) + if (lcd_detected()) { + while (wait_for_user) idle(); + print_job_timer.isPaused() ? LCD_MESSAGEPGM(WELCOME_MSG) : LCD_MESSAGEPGM(MSG_RESUMING); + } + #else + while (wait_for_user) idle(); + #endif + } wait_for_user = false; KEEPALIVE_STATE(IN_HANDLER); @@ -6851,7 +6362,7 @@ void report_xyz_from_stepper_position() { inline void gcode_M3_M4(bool is_M3) { - planner.synchronize(); // wait until previous movement commands (G0/G0/G2/G3) have completed before playing with the spindle + stepper.synchronize(); // wait until previous movement commands (G0/G0/G2/G3) have completed before playing with the spindle #if SPINDLE_DIR_CHANGE const bool rotation_dir = (is_M3 && !SPINDLE_INVERT_DIR || !is_M3 && SPINDLE_INVERT_DIR) ? HIGH : LOW; if (SPINDLE_STOP_ON_DIR_CHANGE \ @@ -6879,12 +6390,12 @@ void report_xyz_from_stepper_position() { delay_for_power_down(); } else { - int16_t ocr_val = (spindle_laser_power - (SPEED_POWER_INTERCEPT)) * (1.0f / (SPEED_POWER_SLOPE)); // convert RPM to PWM duty cycle + int16_t ocr_val = (spindle_laser_power - (SPEED_POWER_INTERCEPT)) * (1.0 / (SPEED_POWER_SLOPE)); // convert RPM to PWM duty cycle NOMORE(ocr_val, 255); // limit to max the Atmel PWM will support if (spindle_laser_power <= SPEED_POWER_MIN) - ocr_val = (SPEED_POWER_MIN - (SPEED_POWER_INTERCEPT)) * (1.0f / (SPEED_POWER_SLOPE)); // minimum setting + ocr_val = (SPEED_POWER_MIN - (SPEED_POWER_INTERCEPT)) * (1.0 / (SPEED_POWER_SLOPE)); // minimum setting if (spindle_laser_power >= SPEED_POWER_MAX) - ocr_val = (SPEED_POWER_MAX - (SPEED_POWER_INTERCEPT)) * (1.0f / (SPEED_POWER_SLOPE)); // limit to max RPM + ocr_val = (SPEED_POWER_MAX - (SPEED_POWER_INTERCEPT)) * (1.0 / (SPEED_POWER_SLOPE)); // limit to max RPM if (SPINDLE_LASER_PWM_INVERT) ocr_val = 255 - ocr_val; WRITE(SPINDLE_LASER_ENABLE_PIN, SPINDLE_LASER_ENABLE_INVERT); // turn spindle on (active low) analogWrite(SPINDLE_LASER_PWM_PIN, ocr_val & 0xFF); // only write low byte @@ -6901,11 +6412,8 @@ void report_xyz_from_stepper_position() { * M5 turn off spindle */ inline void gcode_M5() { - planner.synchronize(); + stepper.synchronize(); WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); - #if ENABLED(SPINDLE_LASER_PWM) - analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); - #endif delay_for_power_down(); } @@ -6921,346 +6429,154 @@ inline void gcode_M17() { #if ENABLED(ADVANCED_PAUSE_FEATURE) - void do_pause_e_move(const float &length, const float &fr) { - set_destination_from_current(); - destination[E_CART] += length / planner.e_factor[active_extruder]; - planner.buffer_line_kinematic(destination, fr, active_extruder); - set_current_from_destination(); - planner.synchronize(); - } - static float resume_position[XYZE]; - int8_t did_pause_print = 0; - - #if HAS_BUZZER - static void filament_change_beep(const int8_t max_beep_count, const bool init=false) { - static millis_t next_buzz = 0; - static int8_t runout_beep = 0; - - if (init) next_buzz = runout_beep = 0; - - const millis_t ms = millis(); - if (ELAPSED(ms, next_buzz)) { - if (max_beep_count < 0 || runout_beep < max_beep_count + 5) { // Only beep as long as we're supposed to - next_buzz = ms + ((max_beep_count < 0 || runout_beep < max_beep_count) ? 1000 : 500); - BUZZ(50, 880 - (runout_beep & 1) * 220); - runout_beep++; - } - } - } + static bool move_away_flag = false; + #if ENABLED(SDSUPPORT) + static bool sd_print_paused = false; #endif - /** - * Ensure a safe temperature for extrusion - * - * - Fail if the TARGET temperature is too low - * - Display LCD placard with temperature status - * - Return when heating is done or aborted - * - * Returns 'true' if heating was completed, 'false' for abort - */ - static bool ensure_safe_temperature(const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT) { + static void filament_change_beep(const int8_t max_beep_count, const bool init=false) { + static millis_t next_buzz = 0; + static int8_t runout_beep = 0; - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD); - return false; + if (init) next_buzz = runout_beep = 0; + + const millis_t ms = millis(); + if (ELAPSED(ms, next_buzz)) { + if (max_beep_count < 0 || runout_beep < max_beep_count + 5) { // Only beep as long as we're supposed to + next_buzz = ms + ((max_beep_count < 0 || runout_beep < max_beep_count) ? 2500 : 400); + BUZZ(300, 2000); + runout_beep++; } - #endif - - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT, mode); - #else - UNUSED(mode); - #endif - - wait_for_heatup = true; // M108 will clear this - while (wait_for_heatup && thermalManager.wait_for_heating(active_extruder)) idle(); - const bool status = wait_for_heatup; - wait_for_heatup = false; - - return status; + } } - /** - * Load filament into the hotend - * - * - Fail if the a safe temperature was not reached - * - If pausing for confirmation, wait for a click or M108 - * - Show "wait for load" placard - * - Load and purge filament - * - Show "Purge more" / "Continue" menu - * - Return when "Continue" is selected - * - * Returns 'true' if load was completed, 'false' for abort - */ - static bool load_filament(const float &slow_load_length=0, const float &fast_load_length=0, const float &purge_length=0, const int8_t max_beep_count=0, - const bool show_lcd=false, const bool pause_for_user=false, - const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT - ) { - #if DISABLED(ULTIPANEL) - UNUSED(show_lcd); - #endif + static void ensure_safe_temperature() { + bool heaters_heating = true; - if (!ensure_safe_temperature(mode)) { - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show status screen - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - - return false; - } - - if (pause_for_user) { - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show "insert filament" - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT, mode); - #endif - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT); - - #if HAS_BUZZER - filament_change_beep(max_beep_count, true); - #else - UNUSED(max_beep_count); - #endif - - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; // LCD click or M108 will clear this - while (wait_for_user) { - #if HAS_BUZZER - filament_change_beep(max_beep_count); - #endif - idle(true); - } - KEEPALIVE_STATE(IN_HANDLER); - } - - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show "wait for load" message - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, mode); - #endif - - // Slow Load filament - if (slow_load_length) do_pause_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE); - - // Fast Load Filament - if (fast_load_length) { - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - const float saved_acceleration = planner.retract_acceleration; - planner.retract_acceleration = FILAMENT_CHANGE_FAST_LOAD_ACCEL; - #endif - - do_pause_e_move(fast_load_length, FILAMENT_CHANGE_FAST_LOAD_FEEDRATE); - - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - planner.retract_acceleration = saved_acceleration; - #endif - } - - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - - #if ENABLED(ULTIPANEL) - if (show_lcd) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE); - #endif - - wait_for_user = true; - for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count) - do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE); - wait_for_user = false; - - #else - - do { - if (purge_length > 0) { - // "Wait for filament purge" + wait_for_heatup = true; // M108 will clear this + while (wait_for_heatup && heaters_heating) { + idle(); + heaters_heating = false; + HOTEND_LOOP() { + if (thermalManager.degTargetHotend(e) && abs(thermalManager.degHotend(e) - thermalManager.degTargetHotend(e)) > TEMP_HYSTERESIS) { + heaters_heating = true; #if ENABLED(ULTIPANEL) - if (show_lcd) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_PURGE, mode); + lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT); #endif - - // Extrude filament to get into hotend - do_pause_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE); + break; } - - // Show "Purge More" / "Resume" menu and wait for reply - #if ENABLED(ULTIPANEL) - if (show_lcd) { - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = false; - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_OPTION, mode); - while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_WAIT_FOR) idle(true); - KEEPALIVE_STATE(IN_HANDLER); - } - #endif - - // Keep looping if "Purge More" was selected - } while ( - #if ENABLED(ULTIPANEL) - show_lcd && advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE - #else - 0 - #endif - ); - - #endif - - return true; - } - - /** - * Unload filament from the hotend - * - * - Fail if the a safe temperature was not reached - * - Show "wait for unload" placard - * - Retract, pause, then unload filament - * - Disable E stepper (on most machines) - * - * Returns 'true' if unload was completed, 'false' for abort - */ - static bool unload_filament(const float &unload_length, const bool show_lcd=false, - const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT - ) { - if (!ensure_safe_temperature(mode)) { - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show status screen - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - - return false; + } } - - #if DISABLED(ULTIPANEL) - UNUSED(show_lcd); - #else - if (show_lcd) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, mode); - #endif - - // Retract filament - do_pause_e_move(-FILAMENT_UNLOAD_RETRACT_LENGTH, PAUSE_PARK_RETRACT_FEEDRATE); - - // Wait for filament to cool - safe_delay(FILAMENT_UNLOAD_DELAY); - - // Quickly purge - do_pause_e_move(FILAMENT_UNLOAD_RETRACT_LENGTH + FILAMENT_UNLOAD_PURGE_LENGTH, planner.max_feedrate_mm_s[E_AXIS]); - - // Unload filament - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - const float saved_acceleration = planner.retract_acceleration; - planner.retract_acceleration = FILAMENT_CHANGE_UNLOAD_ACCEL; - #endif - - do_pause_e_move(unload_length, FILAMENT_CHANGE_UNLOAD_FEEDRATE); - - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - planner.retract_acceleration = saved_acceleration; - #endif - - // Disable extruders steppers for manual filament changing (only on boards that have separate ENABLE_PINS) - #if E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN - disable_e_stepper(active_extruder); - safe_delay(100); - #endif - - return true; } - /** - * Pause procedure - * - * - Abort if already paused - * - Send host action for pause, if configured - * - Abort if TARGET temperature is too low - * - Display "wait for start of filament change" (if a length was specified) - * - Initial retract, if current temperature is hot enough - * - Park the nozzle at the given position - * - Call unload_filament (if a length was specified) - * - * Returns 'true' if pause was completed, 'false' for abort - */ - static bool pause_print(const float &retract, const point_t &park_point, const float &unload_length=0, const bool show_lcd=false) { - if (did_pause_print) return false; // already paused + #if IS_KINEMATIC + #define RUNPLAN(RATE_MM_S) planner.buffer_line_kinematic(destination, RATE_MM_S, active_extruder) + #else + #define RUNPLAN(RATE_MM_S) buffer_line_to_destination(RATE_MM_S) + #endif + + void do_pause_e_move(const float &length, const float fr) { + current_position[E_AXIS] += length / planner.e_factor[active_extruder]; + set_destination_from_current(); + RUNPLAN(fr); + stepper.synchronize(); + } + + static bool pause_print(const float &retract, const point_t &park_point, const float &unload_length = 0, + const int8_t max_beep_count = 0, const bool show_lcd = false + ) { + if (move_away_flag) return false; // already paused #ifdef ACTION_ON_PAUSE SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE); #endif - if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD); - - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show status screen - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - LCD_MESSAGEPGM(MSG_M600_TOO_COLD); + if (!DEBUGGING(DRYRUN) && unload_length != 0) { + #if ENABLED(PREVENT_COLD_EXTRUSION) + if (!thermalManager.allow_cold_extrude && + thermalManager.degTargetHotend(active_extruder) < thermalManager.extrude_min_temp) { + SERIAL_ERROR_START(); + SERIAL_ERRORLNPGM(MSG_TOO_COLD_FOR_M600); + return false; + } #endif - return false; // unable to reach safe temperature + ensure_safe_temperature(); // wait for extruder to heat up before unloading } // Indicate that the printer is paused - ++did_pause_print; + move_away_flag = true; // Pause the print job and timer #if ENABLED(SDSUPPORT) if (card.sdprinting) { card.pauseSDPrint(); - ++did_pause_print; // Indicate SD pause also + sd_print_paused = true; } #endif print_job_timer.pause(); + // Show initial message and wait for synchronize steppers + if (show_lcd) { + #if ENABLED(ULTIPANEL) + lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT); + #endif + } + // Save current position + stepper.synchronize(); COPY(resume_position, current_position); - // Wait for synchronize steppers - planner.synchronize(); - // Initial retract before move to filament change position - if (retract && thermalManager.hotEnoughToExtrude(active_extruder)) + if (retract && !thermalManager.tooColdToExtrude(active_extruder)) do_pause_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE); // Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos) - if (!axis_unhomed_error()) - Nozzle::park(2, park_point); + Nozzle::park(2, park_point); - // Unload the filament - if (unload_length) - unload_filament(unload_length, show_lcd); + if (unload_length != 0) { + if (show_lcd) { + #if ENABLED(ULTIPANEL) + lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD); + idle(); + #endif + } - return true; - } + // Unload filament + do_pause_e_move(unload_length, FILAMENT_CHANGE_UNLOAD_FEEDRATE); + } - /** - * - Show "Insert filament and press button to continue" - * - Wait for a click before returning - * - Heaters can time out, reheated before accepting a click - * - * Used by M125 and M600 - */ - static void wait_for_filament_reload(const int8_t max_beep_count=0) { - bool nozzle_timed_out = false; - - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT); - #endif - SERIAL_ECHO_START(); - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_INSERT); + if (show_lcd) { + #if ENABLED(ULTIPANEL) + lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT); + #endif + } #if HAS_BUZZER filament_change_beep(max_beep_count, true); #endif + idle(); + + // Disable extruders steppers for manual filament changing (only on boards that have separate ENABLE_PINS) + #if E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN + disable_e_steppers(); + safe_delay(100); + #endif + // Start the heater idle timers const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL; HOTEND_LOOP() thermalManager.start_heater_idle_timer(e, nozzle_timeout); + return true; + } + + static void wait_for_filament_reload(const int8_t max_beep_count = 0) { + bool nozzle_timed_out = false; + // Wait for filament insert by user and press button KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = true; // LCD click or M108 will clear this @@ -7279,14 +6595,6 @@ inline void gcode_M17() { #if ENABLED(ULTIPANEL) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE); #endif - SERIAL_ECHO_START(); - #if ENABLED(ULTIPANEL) && ENABLED(EMERGENCY_PARSER) - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_HEAT); - #elif ENABLED(EMERGENCY_PARSER) - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_HEAT_M108); - #else - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_HEAT_LCD); - #endif // Wait for LCD click or M108 while (wait_for_user) idle(true); @@ -7300,14 +6608,6 @@ inline void gcode_M17() { #if ENABLED(ULTIPANEL) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT); #endif - SERIAL_ECHO_START(); - #if ENABLED(ULTIPANEL) && ENABLED(EMERGENCY_PARSER) - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_INSERT); - #elif ENABLED(EMERGENCY_PARSER) - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_INSERT_M108); - #else - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_INSERT_LCD); - #endif // Start the heater idle timers const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL; @@ -7315,7 +6615,7 @@ inline void gcode_M17() { HOTEND_LOOP() thermalManager.start_heater_idle_timer(e, nozzle_timeout); - wait_for_user = true; // Wait for user to load filament + wait_for_user = true; /* Wait for user to load filament */ nozzle_timed_out = false; #if HAS_BUZZER @@ -7328,66 +6628,95 @@ inline void gcode_M17() { KEEPALIVE_STATE(IN_HANDLER); } - /** - * Resume or Start print procedure - * - * - Abort if not paused - * - Reset heater idle timers - * - Load filament if specified, but only if: - * - a nozzle timed out, or - * - the nozzle is already heated. - * - Display "wait for print to resume" - * - Re-prime the nozzle... - * - FWRETRACT: Recover/prime from the prior G10. - * - !FWRETRACT: Retract by resume_position[E], if negative. - * Not sure how this logic comes into use. - * - Move the nozzle back to resume_position - * - Sync the planner E to resume_position[E] - * - Send host action for resume, if configured - * - Resume the current SD print job, if any - */ - static void resume_print(const float &slow_load_length=0, const float &fast_load_length=0, const float &purge_length=ADVANCED_PAUSE_PURGE_LENGTH, const int8_t max_beep_count=0) { - if (!did_pause_print) return; + static void resume_print(const float &load_length = 0, const float &initial_extrude_length = 0, const int8_t max_beep_count = 0) { + bool nozzle_timed_out = false; + + if (!move_away_flag) return; // Re-enable the heaters if they timed out - bool nozzle_timed_out = false; HOTEND_LOOP() { nozzle_timed_out |= thermalManager.is_heater_idle(e); thermalManager.reset_heater_idle_timer(e); } - if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) { - // Load the new filament - load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out); + if (nozzle_timed_out) ensure_safe_temperature(); + + #if HAS_BUZZER + filament_change_beep(max_beep_count, true); + #endif + + set_destination_from_current(); + + if (load_length != 0) { + #if ENABLED(ULTIPANEL) + // Show "insert filament" + if (nozzle_timed_out) + lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT); + #endif + + KEEPALIVE_STATE(PAUSED_FOR_USER); + wait_for_user = true; // LCD click or M108 will clear this + while (wait_for_user && nozzle_timed_out) { + #if HAS_BUZZER + filament_change_beep(max_beep_count); + #endif + idle(true); + } + KEEPALIVE_STATE(IN_HANDLER); + + #if ENABLED(ULTIPANEL) + // Show "load" message + lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD); + #endif + + // Load filament + do_pause_e_move(load_length, FILAMENT_CHANGE_LOAD_FEEDRATE); } + #if ENABLED(ULTIPANEL) && ADVANCED_PAUSE_EXTRUDE_LENGTH > 0 + + if (!thermalManager.tooColdToExtrude(active_extruder)) { + float extrude_length = initial_extrude_length; + + do { + if (extrude_length > 0) { + // "Wait for filament extrude" + lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_EXTRUDE); + + // Extrude filament to get into hotend + do_pause_e_move(extrude_length, ADVANCED_PAUSE_EXTRUDE_FEEDRATE); + } + + // Show "Extrude More" / "Resume" menu and wait for reply + KEEPALIVE_STATE(PAUSED_FOR_USER); + wait_for_user = false; + lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_OPTION); + while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_WAIT_FOR) idle(true); + KEEPALIVE_STATE(IN_HANDLER); + + extrude_length = ADVANCED_PAUSE_EXTRUDE_LENGTH; + + // Keep looping if "Extrude More" was selected + } while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE); + } + + #endif + #if ENABLED(ULTIPANEL) // "Wait for print to resume" lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_RESUME); #endif - // Intelligent resuming - #if ENABLED(FWRETRACT) - // If retracted before goto pause - if (fwretract.retracted[active_extruder]) - do_pause_e_move(-fwretract.retract_length, fwretract.retract_feedrate_mm_s); - #endif - - // If resume_position is negative - if (resume_position[E_CART] < 0) do_pause_e_move(resume_position[E_CART], PAUSE_PARK_RETRACT_FEEDRATE); + // Set extruder to saved position + destination[E_AXIS] = current_position[E_AXIS] = resume_position[E_AXIS]; + planner.set_e_position_mm(current_position[E_AXIS]); // Move XY to starting position, then Z do_blocking_move_to_xy(resume_position[X_AXIS], resume_position[Y_AXIS], NOZZLE_PARK_XY_FEEDRATE); - - // Set Z_AXIS to saved position do_blocking_move_to_z(resume_position[Z_AXIS], NOZZLE_PARK_Z_FEEDRATE); - // Now all extrusion positions are resumed and ready to be confirmed - // Set extruder to saved position - planner.set_e_position_mm((destination[E_CART] = current_position[E_CART] = resume_position[E_CART])); - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - runout.reset(); + filament_ran_out = false; #endif #if ENABLED(ULTIPANEL) @@ -7399,16 +6728,15 @@ inline void gcode_M17() { SERIAL_ECHOLNPGM("//action:" ACTION_ON_RESUME); #endif - --did_pause_print; - #if ENABLED(SDSUPPORT) - if (did_pause_print) { + if (sd_print_paused) { card.startFileprint(); - --did_pause_print; + sd_print_paused = false; } #endif - } + move_away_flag = false; + } #endif // ADVANCED_PAUSE_FEATURE #if ENABLED(SDSUPPORT) @@ -7436,9 +6764,6 @@ inline void gcode_M17() { * M23: Open a file */ inline void gcode_M23() { - #if ENABLED(POWER_LOSS_RECOVERY) - card.removeJobRecoveryFile(); - #endif // Simplify3D includes the size, so zero out all spaces (#7227) for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0'; card.openFile(parser.string_arg, true); @@ -7452,18 +6777,8 @@ inline void gcode_M17() { resume_print(); #endif - #if ENABLED(POWER_LOSS_RECOVERY) - if (parser.seenval('S')) card.setIndex(parser.value_long()); - #endif - card.startFileprint(); - - #if ENABLED(POWER_LOSS_RECOVERY) - if (parser.seenval('T')) - print_job_timer.resume(parser.value_long()); - else - #endif - print_job_timer.start(); + print_job_timer.start(); } /** @@ -7488,23 +6803,8 @@ inline void gcode_M17() { /** * M27: Get SD Card status - * OR, with 'S' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS) - * OR, with 'C' get the current filename. */ - inline void gcode_M27() { - if (parser.seen('C')) { - SERIAL_ECHOPGM("Current file: "); - card.printFilename(); - } - - #if ENABLED(AUTO_REPORT_SD_STATUS) - else if (parser.seenval('S')) - card.set_auto_report_interval(parser.value_byte()); - #endif - - else - card.getStatus(); - } + inline void gcode_M27() { card.getStatus(); } /** * M28: Start SD Write @@ -7557,7 +6857,7 @@ inline void gcode_M31() { * */ inline void gcode_M32() { - if (card.sdprinting) planner.synchronize(); + if (card.sdprinting) stepper.synchronize(); if (card.cardOK) { const bool call_procedure = parser.boolval('P'); @@ -7619,33 +6919,31 @@ inline void gcode_M31() { /** * Sensitive pin test for M42, M226 */ -static bool pin_is_protected(const pin_t pin) { - static const pin_t sensitive_pins[] PROGMEM = SENSITIVE_PINS; +static bool pin_is_protected(const int8_t pin) { + static const int8_t sensitive_pins[] PROGMEM = SENSITIVE_PINS; for (uint8_t i = 0; i < COUNT(sensitive_pins); i++) - if (pin == (pin_t)pgm_read_byte(&sensitive_pins[i])) return true; + if (pin == (int8_t)pgm_read_byte(&sensitive_pins[i])) return true; return false; } -inline void protected_pin_err() { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_PROTECTED_PIN); -} - /** * M42: Change pin status via GCode * * P Pin number (LED if omitted) * S Pin status from 0 - 255 - * I Flag to ignore Marlin's pin protection */ inline void gcode_M42() { if (!parser.seenval('S')) return; const byte pin_status = parser.value_byte(); - const pin_t pin_number = parser.byteval('P', LED_PIN); + const int pin_number = parser.intval('P', LED_PIN); if (pin_number < 0) return; - if (!parser.boolval('I') && pin_is_protected(pin_number)) return protected_pin_err(); + if (pin_is_protected(pin_number)) { + SERIAL_ERROR_START(); + SERIAL_ERRORLNPGM(MSG_ERR_PROTECTED_PIN); + return; + } pinMode(pin_number, OUTPUT); digitalWrite(pin_number, pin_status); @@ -7671,21 +6969,21 @@ inline void gcode_M42() { #include "pinsDebug.h" inline void toggle_pins() { - const bool ignore_protection = parser.boolval('I'); + const bool I_flag = parser.boolval('I'); const int repeat = parser.intval('R', 1), start = parser.intval('S'), end = parser.intval('L', NUM_DIGITAL_PINS - 1), wait = parser.intval('W', 500); for (uint8_t pin = start; pin <= end; pin++) { - //report_pin_state_extended(pin, ignore_protection, false); + //report_pin_state_extended(pin, I_flag, false); - if (!ignore_protection && pin_is_protected(pin)) { - report_pin_state_extended(pin, ignore_protection, true, "Untouched "); + if (!I_flag && pin_is_protected(pin)) { + report_pin_state_extended(pin, I_flag, true, "Untouched "); SERIAL_EOL(); } else { - report_pin_state_extended(pin, ignore_protection, true, "Pulsing "); + report_pin_state_extended(pin, I_flag, true, "Pulsing "); #if AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO if (pin == TEENSY_E2) { SET_OUTPUT(TEENSY_E2); @@ -7727,14 +7025,14 @@ inline void gcode_M42() { SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("SERVO not setup"); - #elif !HAS_Z_SERVO_PROBE + #elif !HAS_Z_SERVO_ENDSTOP SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Z_PROBE_SERVO_NR not setup"); + SERIAL_ERRORLNPGM("Z_ENDSTOP_SERVO_NR not setup"); - #else // HAS_Z_SERVO_PROBE + #else // HAS_Z_SERVO_ENDSTOP - const uint8_t probe_index = parser.byteval('P', Z_PROBE_SERVO_NR); + const uint8_t probe_index = parser.byteval('P', Z_ENDSTOP_SERVO_NR); SERIAL_PROTOCOLLNPGM("Servo probe test"); SERIAL_PROTOCOLLNPAIR(". using index: ", probe_index); @@ -7789,6 +7087,8 @@ inline void gcode_M42() { } if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards"); + refresh_cmd_timeout(); + if (deploy_state != stow_state) { SERIAL_PROTOCOLLNPGM("BLTouch clone detected"); if (deploy_state) { @@ -7815,7 +7115,8 @@ inline void gcode_M42() { safe_delay(2); - if (0 == j % (500 * 1)) reset_stepper_timeout(); // Keep steppers powered + if (0 == j % (500 * 1)) // keep cmd_timeout happy + refresh_cmd_timeout(); if (deploy_state != READ(PROBE_TEST_PIN)) { // probe triggered @@ -7879,9 +7180,9 @@ inline void gcode_M42() { // Enable or disable endstop monitoring if (parser.seen('E')) { - endstops.monitor_flag = parser.value_bool(); + endstop_monitor_flag = parser.value_bool(); SERIAL_PROTOCOLPGM("endstop monitor "); - serialprintPGM(endstops.monitor_flag ? PSTR("en") : PSTR("dis")); + serialprintPGM(endstop_monitor_flag ? PSTR("en") : PSTR("dis")); SERIAL_PROTOCOLLNPGM("abled"); return; } @@ -7892,8 +7193,8 @@ inline void gcode_M42() { } // Get the range of pins to test or watch - const pin_t first_pin = parser.byteval('P'), - last_pin = parser.seenval('P') ? first_pin : NUM_DIGITAL_PINS - 1; + const uint8_t first_pin = parser.byteval('P'), + last_pin = parser.seenval('P') ? first_pin : NUM_DIGITAL_PINS - 1; if (first_pin > last_pin) return; @@ -7903,8 +7204,8 @@ inline void gcode_M42() { if (parser.boolval('W')) { SERIAL_PROTOCOLLNPGM("Watching pins"); byte pin_state[last_pin - first_pin + 1]; - for (pin_t pin = first_pin; pin <= last_pin; pin++) { - if (!ignore_protection && pin_is_protected(pin)) continue; + for (int8_t pin = first_pin; pin <= last_pin; pin++) { + if (pin_is_protected(pin) && !ignore_protection) continue; pinMode(pin, INPUT_PULLUP); delay(1); /* @@ -7921,8 +7222,8 @@ inline void gcode_M42() { #endif for (;;) { - for (pin_t pin = first_pin; pin <= last_pin; pin++) { - if (!ignore_protection && pin_is_protected(pin)) continue; + for (int8_t pin = first_pin; pin <= last_pin; pin++) { + if (pin_is_protected(pin) && !ignore_protection) continue; const byte val = /* IS_ANALOG(pin) @@ -7949,7 +7250,7 @@ inline void gcode_M42() { } // Report current state of selected pin(s) - for (pin_t pin = first_pin; pin <= last_pin; pin++) + for (uint8_t pin = first_pin; pin <= last_pin; pin++) report_pin_state_extended(pin, ignore_protection, true); } @@ -7961,7 +7262,7 @@ inline void gcode_M42() { * M48: Z probe repeatability measurement function. * * Usage: - * M48 + * M48 * P = Number of sampled points (4-50, default 10) * X = Sample X position * Y = Sample Y position @@ -7991,7 +7292,7 @@ inline void gcode_M42() { return; } - const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; + const bool stow_probe_after_each = parser.boolval('E'); float X_current = current_position[X_AXIS], Y_current = current_position[Y_AXIS]; @@ -7999,10 +7300,21 @@ inline void gcode_M42() { const float X_probe_location = parser.linearval('X', X_current + X_PROBE_OFFSET_FROM_EXTRUDER), Y_probe_location = parser.linearval('Y', Y_current + Y_PROBE_OFFSET_FROM_EXTRUDER); - if (!position_is_reachable_by_probe(X_probe_location, Y_probe_location)) { - SERIAL_PROTOCOLLNPGM("? (X,Y) out of bounds."); - return; - } + #if DISABLED(DELTA) + if (!WITHIN(X_probe_location, MIN_PROBE_X, MAX_PROBE_X)) { + out_of_range_error(PSTR("X")); + return; + } + if (!WITHIN(Y_probe_location, MIN_PROBE_Y, MAX_PROBE_Y)) { + out_of_range_error(PSTR("Y")); + return; + } + #else + if (!position_is_reachable_by_probe(X_probe_location, Y_probe_location)) { + SERIAL_PROTOCOLLNPGM("? (X,Y) location outside of probeable radius."); + return; + } + #endif bool seen_L = parser.seen('L'); uint8_t n_legs = seen_L ? parser.value_byte() : 0; @@ -8032,10 +7344,10 @@ inline void gcode_M42() { setup_for_endstop_or_probe_move(); - float mean = 0.0, sigma = 0.0, min = 99999.9, max = -99999.9, sample_set[n_samples]; + double mean = 0.0, sigma = 0.0, min = 99999.9, max = -99999.9, sample_set[n_samples]; // Move to the first point, deploy, and probe - const float t = probe_pt(X_probe_location, Y_probe_location, raise_after, verbose_level); + const float t = probe_pt(X_probe_location, Y_probe_location, stow_probe_after_each, verbose_level); bool probing_good = !isnan(t); if (probing_good) { @@ -8047,10 +7359,10 @@ inline void gcode_M42() { float angle = random(0.0, 360.0); const float radius = random( #if ENABLED(DELTA) - 0.1250000000 * (DELTA_PRINTABLE_RADIUS), - 0.3333333333 * (DELTA_PRINTABLE_RADIUS) + 0.1250000000 * (DELTA_PROBEABLE_RADIUS), + 0.3333333333 * (DELTA_PROBEABLE_RADIUS) #else - 5.0, 0.125 * MIN(X_BED_SIZE, Y_BED_SIZE) + 5.0, 0.125 * min(X_BED_SIZE, Y_BED_SIZE) #endif ); @@ -8063,7 +7375,7 @@ inline void gcode_M42() { } for (uint8_t l = 0; l < n_legs - 1; l++) { - float delta_angle; + double delta_angle; if (schizoid_flag) // The points of a 5 point star are 72 degrees apart. We need to @@ -8111,7 +7423,7 @@ inline void gcode_M42() { } // n_legs // Probe a single point - sample_set[n] = probe_pt(X_probe_location, Y_probe_location, raise_after); + sample_set[n] = probe_pt(X_probe_location, Y_probe_location, stow_probe_after_each, 0); // Break the loop if the probe fails probing_good = !isnan(sample_set[n]); @@ -8120,7 +7432,7 @@ inline void gcode_M42() { /** * Get the current mean for the data points we have so far */ - float sum = 0.0; + double sum = 0.0; for (uint8_t j = 0; j <= n; j++) sum += sample_set[j]; mean = sum / (n + 1); @@ -8140,7 +7452,7 @@ inline void gcode_M42() { if (verbose_level > 1) { SERIAL_PROTOCOL(n + 1); SERIAL_PROTOCOLPGM(" of "); - SERIAL_PROTOCOL(int(n_samples)); + SERIAL_PROTOCOL((int)n_samples); SERIAL_PROTOCOLPGM(": z: "); SERIAL_PROTOCOL_F(sample_set[n], 3); if (verbose_level > 2) { @@ -8192,10 +7504,6 @@ inline void gcode_M42() { set_bed_leveling_enabled(was_enabled); #endif - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - report_current_position(); } @@ -8222,7 +7530,7 @@ inline void gcode_M42() { * This has no effect during an SD print job */ inline void gcode_M73() { - if (!IS_SD_PRINTING() && parser.seen('P')) { + if (!IS_SD_PRINTING && parser.seen('P')) { progress_bar_percent = parser.value_byte(); NOMORE(progress_bar_percent, 100); } @@ -8286,9 +7594,12 @@ inline void gcode_M104() { */ if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) { print_job_timer.stop(); - lcd_reset_status(); + LCD_MESSAGEPGM(WELCOME_MSG); } #endif + + if (parser.value_celsius() > thermalManager.degHotend(target_extruder)) + lcd_status_printf_P(0, PSTR("E%i %s"), target_extruder + 1, MSG_HEATING); } #if ENABLED(AUTOTEMP) @@ -8302,10 +7613,10 @@ inline void gcode_M104() { inline void gcode_M105() { if (get_target_extruder_from_command(105)) return; - #if HAS_TEMP_SENSOR + #if HAS_TEMP_HOTEND || HAS_TEMP_BED SERIAL_PROTOCOLPGM(MSG_OK); thermalManager.print_heaterstates(); - #else // !HAS_TEMP_SENSOR + #else // !HAS_TEMP_HOTEND && !HAS_TEMP_BED SERIAL_ERROR_START(); SERIAL_ERRORLNPGM(MSG_ERR_NO_THERMISTORS); #endif @@ -8313,7 +7624,7 @@ inline void gcode_M105() { SERIAL_EOL(); } -#if ENABLED(AUTO_REPORT_TEMPERATURES) +#if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED) /** * M155: Set temperature auto-report interval. M155 S @@ -8355,14 +7666,14 @@ inline void gcode_M105() { fanSpeeds[p] = new_fanSpeeds[p]; break; default: - new_fanSpeeds[p] = MIN(t, 255); + new_fanSpeeds[p] = min(t, 255); break; } return; } #endif // EXTRA_FAN_SPEED const uint16_t s = parser.ushortval('S', 255); - fanSpeeds[p] = MIN(s, 255U); + fanSpeeds[p] = min(s, 255); } } @@ -8421,9 +7732,8 @@ inline void gcode_M109() { if (target_extruder != active_extruder) return; #endif - const bool no_wait_for_cooling = parser.seenval('S'), - set_temp = no_wait_for_cooling || parser.seenval('R'); - if (set_temp) { + const bool no_wait_for_cooling = parser.seenval('S'); + if (no_wait_for_cooling || parser.seenval('R')) { const int16_t temp = parser.value_celsius(); thermalManager.setTargetHotend(temp, target_extruder); @@ -8440,22 +7750,15 @@ inline void gcode_M109() { */ if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) { print_job_timer.stop(); - lcd_reset_status(); + LCD_MESSAGEPGM(WELCOME_MSG); } else print_job_timer.start(); #endif - #if ENABLED(ULTRA_LCD) - const bool heating = thermalManager.isHeatingHotend(target_extruder); - if (heating || !no_wait_for_cooling) - #if HOTENDS > 1 - lcd_status_printf_P(0, heating ? PSTR("E%i " MSG_HEATING) : PSTR("E%i " MSG_COOLING), target_extruder + 1); - #else - lcd_setstatusPGM(heating ? PSTR("E " MSG_HEATING) : PSTR("E " MSG_COOLING)); - #endif - #endif + if (thermalManager.isHeatingHotend(target_extruder)) lcd_status_printf_P(0, PSTR("E%i %s"), target_extruder + 1, MSG_HEATING); } + else return; #ifdef ANYCUBIC_TFT_MODEL AnycubicTFT.HeatingStart(); @@ -8465,8 +7768,6 @@ inline void gcode_M109() { planner.autotemp_M104_M109(); #endif - if (!set_temp) return; - #if TEMP_RESIDENCY_TIME > 0 millis_t residency_start_ms = 0; // Loop until the temperature has stabilized @@ -8476,7 +7777,7 @@ inline void gcode_M109() { #define TEMP_CONDITIONS (wants_to_cool ? thermalManager.isCoolingHotend(target_extruder) : thermalManager.isHeatingHotend(target_extruder)) #endif - float target_temp = -1, old_temp = 9999; + float target_temp = -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; @@ -8515,7 +7816,7 @@ inline void gcode_M109() { } idle(); - reset_stepper_timeout(); // Keep steppers powered + refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out const float temp = thermalManager.degHotend(target_extruder); @@ -8541,7 +7842,7 @@ inline void gcode_M109() { #if TEMP_RESIDENCY_TIME > 0 - const float temp_diff = ABS(target_temp - temp); + const float temp_diff = FABS(target_temp - temp); if (!residency_start_ms) { // Start the TEMP_RESIDENCY_TIME timer when we reach target temp for the first time. @@ -8559,7 +7860,7 @@ inline void gcode_M109() { // 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 < float(MIN_COOLING_SLOPE_DEG)) break; + if (old_temp - temp < MIN_COOLING_SLOPE_DEG) break; next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME; old_temp = temp; } @@ -8568,7 +7869,7 @@ inline void gcode_M109() { } while (wait_for_heatup && TEMP_CONDITIONS); if (wait_for_heatup) { - lcd_reset_status(); + LCD_MESSAGEPGM(MSG_HEATING_COMPLETE); #if ENABLED(PRINTER_EVENT_LEDS) leds.set_white(); #endif @@ -8583,15 +7884,7 @@ inline void gcode_M109() { #endif } -#if HAS_HEATED_BED - - /** - * M140: Set bed temperature - */ - inline void gcode_M140() { - if (DEBUGGING(DRYRUN)) return; - if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius()); - } +#if HAS_TEMP_BED #ifndef MIN_COOLING_SLOPE_DEG_BED #define MIN_COOLING_SLOPE_DEG_BED 1.50 @@ -8607,6 +7900,7 @@ inline void gcode_M109() { inline void gcode_M190() { if (DEBUGGING(DRYRUN)) return; + LCD_MESSAGEPGM(MSG_BED_HEATING); const bool no_wait_for_cooling = parser.seenval('S'); if (no_wait_for_cooling || parser.seenval('R')) { thermalManager.setTargetBed(parser.value_celsius()); @@ -8620,7 +7914,6 @@ inline void gcode_M109() { #ifdef ANYCUBIC_TFT_MODEL AnycubicTFT.BedHeatingStart(); #endif - lcd_setstatusPGM(thermalManager.isHeatingBed() ? PSTR(MSG_BED_HEATING) : PSTR(MSG_BED_COOLING)); #if TEMP_BED_RESIDENCY_TIME > 0 millis_t residency_start_ms = 0; @@ -8644,7 +7937,7 @@ inline void gcode_M109() { #if ENABLED(PRINTER_EVENT_LEDS) const float start_temp = thermalManager.degBed(); - uint8_t old_red = 127; + uint8_t old_red = 255; #endif do { @@ -8672,7 +7965,7 @@ inline void gcode_M109() { } idle(); - reset_stepper_timeout(); // Keep steppers powered + refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out const float temp = thermalManager.degBed(); @@ -8698,7 +7991,7 @@ inline void gcode_M109() { #if TEMP_BED_RESIDENCY_TIME > 0 - const float temp_diff = ABS(target_temp - temp); + const float temp_diff = FABS(target_temp - temp); if (!residency_start_ms) { // Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time. @@ -8716,25 +8009,25 @@ inline void gcode_M109() { // 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 < float(MIN_COOLING_SLOPE_DEG_BED)) break; + 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); - + #ifdef ANYCUBIC_TFT_MODEL AnycubicTFT.BedHeatingDone(); #endif - if (wait_for_heatup) lcd_reset_status(); + if (wait_for_heatup) LCD_MESSAGEPGM(MSG_BED_DONE); #if DISABLED(BUSY_WHILE_HEATING) KEEPALIVE_STATE(IN_HANDLER); #endif } -#endif // HAS_HEATED_BED +#endif // HAS_TEMP_BED /** * M110: Set Current Line Number @@ -8749,7 +8042,7 @@ inline void gcode_M110() { inline void gcode_M111() { if (parser.seen('S')) marlin_debug_flags = parser.byteval('S'); - static const char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO, + const static char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO, str_debug_2[] PROGMEM = MSG_DEBUG_INFO, str_debug_4[] PROGMEM = MSG_DEBUG_ERRORS, str_debug_8[] PROGMEM = MSG_DEBUG_DRYRUN, @@ -8759,7 +8052,7 @@ inline void gcode_M111() { #endif ; - static const char* const debug_strings[] PROGMEM = { + const static char* const debug_strings[] PROGMEM = { str_debug_1, str_debug_2, str_debug_4, str_debug_8, str_debug_16 #if ENABLED(DEBUG_LEVELING_FEATURE) , str_debug_32 @@ -8773,29 +8066,12 @@ inline void gcode_M111() { for (uint8_t i = 0; i < COUNT(debug_strings); i++) { if (TEST(marlin_debug_flags, i)) { if (comma++) SERIAL_CHAR(','); - serialprintPGM((char*)pgm_read_ptr(&debug_strings[i])); + serialprintPGM((char*)pgm_read_word(&debug_strings[i])); } } } else { SERIAL_ECHOPGM(MSG_DEBUG_OFF); - #if !defined(__AVR__) || !defined(USBCON) - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - SERIAL_ECHOPAIR("\nBuffer Overruns: ", customizedSerial.buffer_overruns()); - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - SERIAL_ECHOPAIR("\nFraming Errors: ", customizedSerial.framing_errors()); - #endif - - #if ENABLED(SERIAL_STATS_DROPPED_RX) - SERIAL_ECHOPAIR("\nDropped bytes: ", customizedSerial.dropped()); - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - SERIAL_ECHOPAIR("\nMax RX Queue Size: ", customizedSerial.rxMaxEnqueued()); - #endif - #endif // !__AVR__ || !USBCON } SERIAL_EOL(); } @@ -8846,6 +8122,14 @@ inline void gcode_M111() { #endif // BARICUDA +/** + * M140: Set bed temperature + */ +inline void gcode_M140() { + if (DEBUGGING(DRYRUN)) return; + if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius()); +} + #if ENABLED(ULTIPANEL) /** @@ -8908,7 +8192,7 @@ inline void gcode_M111() { return; } - PSU_ON(); + OUT_WRITE(PS_ON_PIN, PS_ON_AWAKE); // GND /** * If you have a switch on suicide pin, this is useful @@ -8919,18 +8203,25 @@ inline void gcode_M111() { OUT_WRITE(SUICIDE_PIN, HIGH); #endif - #if DISABLED(AUTO_POWER_CONTROL) - delay(100); // Wait for power to settle - restore_stepper_drivers(); + #if ENABLED(HAVE_TMC2130) + delay(100); + tmc2130_init(); // Settings only stick when the driver has power #endif + powersupply_on = true; + #if ENABLED(ULTIPANEL) - lcd_reset_status(); + LCD_MESSAGEPGM(WELCOME_MSG); #endif #ifdef ANYCUBIC_TFT_MODEL AnycubicTFT.CommandScan(); #endif + + #if ENABLED(HAVE_TMC2208) + delay(100); + tmc2208_init(); + #endif } #endif // HAS_POWER_SWITCH @@ -8942,7 +8233,7 @@ inline void gcode_M111() { */ inline void gcode_M81() { thermalManager.disable_all_heaters(); - planner.finish_and_disable(); + stepper.finish_and_disable(); #if FAN_COUNT > 0 for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; @@ -8955,9 +8246,11 @@ inline void gcode_M81() { safe_delay(1000); // Wait 1 second before switching off #if HAS_SUICIDE + stepper.synchronize(); suicide(); #elif HAS_POWER_SWITCH - PSU_OFF(); + OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); + powersupply_on = false; #endif #if ENABLED(ULTIPANEL) @@ -8972,12 +8265,12 @@ inline void gcode_M81() { /** * M82: Set E codes absolute (default) */ -inline void gcode_M82() { axis_relative_modes[E_CART] = false; } +inline void gcode_M82() { axis_relative_modes[E_AXIS] = false; } /** * M83: Set E codes relative while in Absolute Coordinates (G90) mode */ -inline void gcode_M83() { axis_relative_modes[E_CART] = true; } +inline void gcode_M83() { axis_relative_modes[E_AXIS] = true; } /** * M18, M84: Disable stepper motors @@ -8987,22 +8280,22 @@ inline void gcode_M18_M84() { stepper_inactive_time = parser.value_millis_from_seconds(); } else { - bool all_axis = !(parser.seen('X') || parser.seen('Y') || parser.seen('Z') || parser.seen('E')); + bool all_axis = !((parser.seen('X')) || (parser.seen('Y')) || (parser.seen('Z')) || (parser.seen('E'))); if (all_axis) { - planner.finish_and_disable(); + stepper.finish_and_disable(); } else { - planner.synchronize(); + stepper.synchronize(); if (parser.seen('X')) disable_X(); if (parser.seen('Y')) disable_Y(); if (parser.seen('Z')) disable_Z(); - #if E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN // Only disable on boards that have separate ENABLE_PINS + #if E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN // Only enable on boards that have separate ENABLE_PINS if (parser.seen('E')) disable_e_steppers(); #endif } #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL) // Only needed with an LCD - if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false; + ubl.lcd_map_control = defer_return_to_status = false; #endif } } @@ -9027,34 +8320,27 @@ inline void gcode_M85() { /** * M92: Set axis steps-per-unit for one or more axes, X, Y, Z, and E. - * (for Hangprinter: A, B, C, D, and E) * (Follows the same syntax as G92) * * With multiple extruders use T to specify which one. */ inline void gcode_M92() { + GET_TARGET_EXTRUDER(92); - LOOP_NUM_AXIS(i) { - if (parser.seen(RAW_AXIS_CODES(i))) { + LOOP_XYZE(i) { + if (parser.seen(axis_codes[i])) { if (i == E_AXIS) { const float value = parser.value_per_axis_unit((AxisEnum)(E_AXIS + TARGET_EXTRUDER)); - if (value < 20) { - const float factor = planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] / value; // increase e constants if M92 E14 is given for netfab. - #if DISABLED(JUNCTION_DEVIATION) - planner.max_jerk[E_AXIS] *= factor; - #endif + if (value < 20.0) { + float factor = planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] / value; // increase e constants if M92 E14 is given for netfab. + planner.max_jerk[E_AXIS] *= factor; planner.max_feedrate_mm_s[E_AXIS + TARGET_EXTRUDER] *= factor; planner.max_acceleration_steps_per_s2[E_AXIS + TARGET_EXTRUDER] *= factor; } planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] = value; } else { - #if ENABLED(LINE_BUILDUP_COMPENSATION_FEATURE) - SERIAL_ECHOLNPGM("Warning: " - "M92 A, B, C, and D only affect acceleration planning " - "when BUILDUP_COMPENSATION_FEATURE is enabled."); - #endif planner.axis_steps_per_mm[i] = parser.value_per_axis_unit((AxisEnum)i); } } @@ -9066,24 +8352,20 @@ inline void gcode_M92() { * Output the current position to serial */ void report_current_position() { - SERIAL_PROTOCOLPAIR("X:", LOGICAL_X_POSITION(current_position[X_AXIS])); - SERIAL_PROTOCOLPAIR(" Y:", LOGICAL_Y_POSITION(current_position[Y_AXIS])); - SERIAL_PROTOCOLPAIR(" Z:", LOGICAL_Z_POSITION(current_position[Z_AXIS])); - SERIAL_PROTOCOLPAIR(" E:", current_position[E_CART]); - - #if ENABLED(HANGPRINTER) - SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("A:", line_lengths[A_AXIS]); - SERIAL_PROTOCOLPAIR(" B:", line_lengths[B_AXIS]); - SERIAL_PROTOCOLPAIR(" C:", line_lengths[C_AXIS]); - SERIAL_PROTOCOLLNPAIR(" D:", line_lengths[D_AXIS]); - #endif + SERIAL_PROTOCOLPGM("X:"); + SERIAL_PROTOCOL(LOGICAL_X_POSITION(current_position[X_AXIS])); + SERIAL_PROTOCOLPGM(" Y:"); + SERIAL_PROTOCOL(LOGICAL_Y_POSITION(current_position[Y_AXIS])); + SERIAL_PROTOCOLPGM(" Z:"); + SERIAL_PROTOCOL(LOGICAL_Z_POSITION(current_position[Z_AXIS])); + SERIAL_PROTOCOLPGM(" E:"); + SERIAL_PROTOCOL(current_position[E_AXIS]); stepper.report_positions(); #if IS_SCARA - SERIAL_PROTOCOLPAIR("SCARA Theta:", planner.get_axis_position_degrees(A_AXIS)); - SERIAL_PROTOCOLLNPAIR(" Psi+Theta:", planner.get_axis_position_degrees(B_AXIS)); + SERIAL_PROTOCOLPAIR("SCARA Theta:", stepper.get_axis_position_degrees(A_AXIS)); + SERIAL_PROTOCOLLNPAIR(" Psi+Theta:", stepper.get_axis_position_degrees(B_AXIS)); SERIAL_EOL(); #endif } @@ -9105,13 +8387,15 @@ void report_current_position() { void report_current_position_detail() { + stepper.synchronize(); + SERIAL_PROTOCOLPGM("\nLogical:"); const float logical[XYZ] = { LOGICAL_X_POSITION(current_position[X_AXIS]), LOGICAL_Y_POSITION(current_position[Y_AXIS]), LOGICAL_Z_POSITION(current_position[Z_AXIS]) }; - report_xyz(logical); + report_xyze(logical); SERIAL_PROTOCOLPGM("Raw: "); report_xyz(current_position); @@ -9139,12 +8423,10 @@ void report_current_position() { report_xyz(delta); #endif - planner.synchronize(); - SERIAL_PROTOCOLPGM("Stepper:"); - LOOP_NUM_AXIS(i) { + LOOP_XYZE(i) { SERIAL_CHAR(' '); - SERIAL_CHAR(RAW_AXIS_CODES(i)); + SERIAL_CHAR(axis_codes[i]); SERIAL_CHAR(':'); SERIAL_PROTOCOL(stepper.position((AxisEnum)i)); } @@ -9152,8 +8434,8 @@ void report_current_position() { #if IS_SCARA const float deg[XYZ] = { - planner.get_axis_position_degrees(A_AXIS), - planner.get_axis_position_degrees(B_AXIS) + stepper.get_axis_position_degrees(A_AXIS), + stepper.get_axis_position_degrees(B_AXIS) }; SERIAL_PROTOCOLPGM("Degrees:"); report_xyze(deg, 2); @@ -9161,14 +8443,14 @@ void report_current_position() { SERIAL_PROTOCOLPGM("FromStp:"); get_cartesian_from_steppers(); // writes cartes[XYZ] (with forward kinematics) - const float from_steppers[XYZE] = { cartes[X_AXIS], cartes[Y_AXIS], cartes[Z_AXIS], planner.get_axis_position_mm(E_AXIS) }; + const float from_steppers[XYZE] = { cartes[X_AXIS], cartes[Y_AXIS], cartes[Z_AXIS], stepper.get_axis_position_mm(E_AXIS) }; report_xyze(from_steppers); const float diff[XYZE] = { from_steppers[X_AXIS] - leveled[X_AXIS], from_steppers[Y_AXIS] - leveled[Y_AXIS], from_steppers[Z_AXIS] - leveled[Z_AXIS], - from_steppers[E_CART] - current_position[E_CART] + from_steppers[E_AXIS] - current_position[E_AXIS] }; SERIAL_PROTOCOLPGM("Differ: "); report_xyze(diff); @@ -9181,19 +8463,13 @@ void report_current_position() { inline void gcode_M114() { #ifdef M114_DETAIL - if (parser.seen('D')) return report_current_position_detail(); + if (parser.seen('D')) { + report_current_position_detail(); + return; + } #endif - planner.synchronize(); - - const uint16_t sval = parser.ushortval('S'); - - #if ENABLED(MECHADUINO_I2C_COMMANDS) - if (sval == 1) return report_axis_position_from_encoder_data(); - #endif - - if (sval == 2) return report_xyz_from_stepper_position(); - + stepper.synchronize(); report_current_position(); } @@ -9205,7 +8481,6 @@ inline void gcode_M114() { static void cap_line(const char * const name, bool ena=false) { SERIAL_PROTOCOLPGM("Cap:"); serialprintPGM(name); - SERIAL_PROTOCOLPGM(":"); SERIAL_PROTOCOLLN(int(ena ? 1 : 0)); } #endif @@ -9303,52 +8578,24 @@ inline void gcode_M115() { #endif ); - // AUTOREPORT_SD_STATUS (M27 extension) - cap_line(PSTR("AUTOREPORT_SD_STATUS") - #if ENABLED(AUTO_REPORT_SD_STATUS) - , true - #endif - ); - - // THERMAL_PROTECTION - cap_line(PSTR("THERMAL_PROTECTION") - #if ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(THERMAL_PROTECTION_BED) - , true - #endif - ); - #endif // EXTENDED_CAPABILITIES_REPORT } /** * M117: Set LCD Status Message */ -inline void gcode_M117() { - if (parser.string_arg[0]) - lcd_setstatus(parser.string_arg); - else - lcd_reset_status(); -} +inline void gcode_M117() { lcd_setstatus(parser.string_arg); } /** * M118: Display a message in the host console. * - * A1 Prepend '// ' for an action command, as in OctoPrint + * A1 Append '// ' for an action command, as in OctoPrint * E1 Have the host 'echo:' the text */ inline void gcode_M118() { - bool hasE = false, hasA = false; - char *p = parser.string_arg; - for (uint8_t i = 2; i--;) - if ((p[0] == 'A' || p[0] == 'E') && p[1] == '1') { - if (p[0] == 'A') hasA = true; - if (p[0] == 'E') hasE = true; - p += 2; - while (*p == ' ') ++p; - } - if (hasE) SERIAL_ECHO_START(); - if (hasA) SERIAL_ECHOPGM("// "); - SERIAL_ECHOLN(p); + if (parser.boolval('E')) SERIAL_ECHO_START(); + if (parser.boolval('A')) SERIAL_ECHOPGM("// "); + SERIAL_ECHOLN(parser.string_arg); } /** @@ -9386,11 +8633,11 @@ inline void gcode_M121() { endstops.enable_globally(false); } inline void gcode_M125() { // Initial retract before move to filament change position - const float retract = -ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : 0 + const float retract = parser.seen('L') ? parser.value_axis_units(E_AXIS) : 0 #ifdef PAUSE_PARK_RETRACT_LENGTH - + (PAUSE_PARK_RETRACT_LENGTH) + - (PAUSE_PARK_RETRACT_LENGTH) #endif - ); + ; point_t park_point = NOZZLE_PARK_POINT; @@ -9401,7 +8648,7 @@ inline void gcode_M121() { endstops.enable_globally(false); } // Lift Z axis if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - #if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE) && DISABLED(DELTA) + #if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE) park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0); park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0); #endif @@ -9472,7 +8719,7 @@ inline void gcode_M121() { endstops.enable_globally(false); } // 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 - if ( (parser.volumetric_enabled = (parser.value_linear_units() != 0)) ) + if ( (parser.volumetric_enabled = (parser.value_linear_units() != 0.0)) ) planner.set_filament_size(target_extruder, parser.value_linear_units()); } planner.calculate_volumetric_multipliers(); @@ -9489,8 +8736,8 @@ inline void gcode_M201() { GET_TARGET_EXTRUDER(201); - LOOP_NUM_AXIS(i) { - if (parser.seen(RAW_AXIS_CODES(i))) { + LOOP_XYZE(i) { + if (parser.seen(axis_codes[i])) { const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0); planner.max_acceleration_mm_per_s2[a] = parser.value_axis_units((AxisEnum)a); } @@ -9517,8 +8764,8 @@ inline void gcode_M203() { GET_TARGET_EXTRUDER(203); - LOOP_NUM_AXIS(i) - if (parser.seen(RAW_AXIS_CODES(i))) { + LOOP_XYZE(i) + if (parser.seen(axis_codes[i])) { const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0); planner.max_feedrate_mm_s[a] = parser.value_axis_units((AxisEnum)a); } @@ -9530,79 +8777,47 @@ inline void gcode_M203() { * P = Printing moves * R = Retract only (no X, Y, Z) moves * T = Travel (non printing) moves + * + * Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate */ inline void gcode_M204() { - bool report = true; - if (parser.seenval('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments. + if (parser.seen('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments. planner.travel_acceleration = planner.acceleration = parser.value_linear_units(); - report = false; + SERIAL_ECHOLNPAIR("Setting Print and Travel Acceleration: ", planner.acceleration); } - if (parser.seenval('P')) { + if (parser.seen('P')) { planner.acceleration = parser.value_linear_units(); - report = false; + SERIAL_ECHOLNPAIR("Setting Print Acceleration: ", planner.acceleration); } - if (parser.seenval('R')) { + if (parser.seen('R')) { planner.retract_acceleration = parser.value_linear_units(); - report = false; + SERIAL_ECHOLNPAIR("Setting Retract Acceleration: ", planner.retract_acceleration); } - if (parser.seenval('T')) { + if (parser.seen('T')) { planner.travel_acceleration = parser.value_linear_units(); - report = false; - } - if (report) { - SERIAL_ECHOPAIR("Acceleration: P", planner.acceleration); - SERIAL_ECHOPAIR(" R", planner.retract_acceleration); - SERIAL_ECHOLNPAIR(" T", planner.travel_acceleration); + SERIAL_ECHOLNPAIR("Setting Travel Acceleration: ", planner.travel_acceleration); } } /** * M205: Set Advanced Settings * - * Q = Min Segment Time (µs) * S = Min Feed Rate (units/s) * T = Min Travel Feed Rate (units/s) + * B = Min Segment Time (µs) * X = Max X Jerk (units/sec^2) * Y = Max Y Jerk (units/sec^2) * Z = Max Z Jerk (units/sec^2) * E = Max E Jerk (units/sec^2) - * J = Junction Deviation (mm) (Requires JUNCTION_DEVIATION) */ inline void gcode_M205() { - if (parser.seen('Q')) planner.min_segment_time_us = parser.value_ulong(); if (parser.seen('S')) planner.min_feedrate_mm_s = parser.value_linear_units(); if (parser.seen('T')) planner.min_travel_feedrate_mm_s = parser.value_linear_units(); - #if ENABLED(JUNCTION_DEVIATION) - if (parser.seen('J')) { - const float junc_dev = parser.value_linear_units(); - if (WITHIN(junc_dev, 0.01f, 0.3f)) { - planner.junction_deviation_mm = junc_dev; - planner.recalculate_max_e_jerk(); - } - else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("?J out of range (0.01 to 0.3)"); - } - } - #else - #if ENABLED(HANGPRINTER) - if (parser.seen('A')) planner.max_jerk[A_AXIS] = parser.value_linear_units(); - if (parser.seen('B')) planner.max_jerk[B_AXIS] = parser.value_linear_units(); - if (parser.seen('C')) planner.max_jerk[C_AXIS] = parser.value_linear_units(); - if (parser.seen('D')) planner.max_jerk[D_AXIS] = parser.value_linear_units(); - #else - if (parser.seen('X')) planner.max_jerk[X_AXIS] = parser.value_linear_units(); - if (parser.seen('Y')) planner.max_jerk[Y_AXIS] = parser.value_linear_units(); - if (parser.seen('Z')) { - planner.max_jerk[Z_AXIS] = parser.value_linear_units(); - #if HAS_MESH - if (planner.max_jerk[Z_AXIS] <= 0.1f) - SERIAL_ECHOLNPGM("WARNING! Low Z Jerk may lead to unwanted pauses."); - #endif - } - #endif - if (parser.seen('E')) planner.max_jerk[E_AXIS] = parser.value_linear_units(); - #endif + if (parser.seen('B')) planner.min_segment_time_us = parser.value_ulong(); + if (parser.seen('X')) planner.max_jerk[X_AXIS] = parser.value_linear_units(); + if (parser.seen('Y')) planner.max_jerk[Y_AXIS] = parser.value_linear_units(); + if (parser.seen('Z')) planner.max_jerk[Z_AXIS] = parser.value_linear_units(); + if (parser.seen('E')) planner.max_jerk[E_AXIS] = parser.value_linear_units(); } #if HAS_M206_COMMAND @@ -9640,7 +8855,7 @@ inline void gcode_M205() { * B = delta calibration radius * X = Alpha (Tower 1) angle trim * Y = Beta (Tower 2) angle trim - * Z = Gamma (Tower 3) angle trim + * Z = Rotate A and B by this angle */ inline void gcode_M665() { if (parser.seen('H')) delta_height = parser.value_linear_units(); @@ -9719,84 +8934,31 @@ inline void gcode_M205() { } } -#elif ENABLED(HANGPRINTER) - /** - * M665: Set HANGPRINTER settings - * - * Parameters: - * - * W[anchor_A_y] - A-anchor's y coordinate (see note) - * E[anchor_A_z] - A-anchor's z coordinate (see note) - * R[anchor_B_x] - B-anchor's x coordinate (see note) - * T[anchor_B_y] - B-anchor's y coordinate (see note) - * Y[anchor_B_z] - B-anchor's z coordinate (see note) - * U[anchor_C_x] - C-anchor's x coordinate (see note) - * I[anchor_C_y] - C-anchor's y coordinate (see note) - * O[anchor_C_z] - C-anchor's z coordinate (see note) - * P[anchor_D_z] - D-anchor's z coordinate (see note) - * S[segments-per-second] - Segments-per-second - * - * Note: All xyz coordinates are measured relative to the line's pivot point in the mover, - * when it is at its home position (nozzle in (0,0,0), and lines tight). - * The y-axis is defined to be horizontal right above/below the A-lines when mover is at home. - * The z-axis is along the vertical direction. - */ - inline void gcode_M665() { - if (parser.seen('W')) anchor_A_y = parser.value_float(); - if (parser.seen('E')) anchor_A_z = parser.value_float(); - if (parser.seen('R')) anchor_B_x = parser.value_float(); - if (parser.seen('T')) anchor_B_y = parser.value_float(); - if (parser.seen('Y')) anchor_B_z = parser.value_float(); - if (parser.seen('U')) anchor_C_x = parser.value_float(); - if (parser.seen('I')) anchor_C_y = parser.value_float(); - if (parser.seen('O')) anchor_C_z = parser.value_float(); - if (parser.seen('P')) anchor_D_z = parser.value_float(); - if (parser.seen('S')) delta_segments_per_second = parser.value_float(); - recalc_hangprinter_settings(); - } + #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) /** - * M666: Set Dual Endstops offsets for X, Y, and/or Z. - * With no parameters report current offsets. + * M666: For Z Dual Endstop setup, set z axis offset to the z2 axis. */ inline void gcode_M666() { - bool report = true; + SERIAL_ECHOPGM("Dual Endstop Adjustment (mm): "); #if ENABLED(X_DUAL_ENDSTOPS) - if (parser.seenval('X')) { - endstops.x_endstop_adj = parser.value_linear_units(); - report = false; - } + if (parser.seen('X')) x_endstop_adj = parser.value_linear_units(); + SERIAL_ECHOPAIR(" X", x_endstop_adj); #endif #if ENABLED(Y_DUAL_ENDSTOPS) - if (parser.seenval('Y')) { - endstops.y_endstop_adj = parser.value_linear_units(); - report = false; - } + if (parser.seen('Y')) y_endstop_adj = parser.value_linear_units(); + SERIAL_ECHOPAIR(" Y", y_endstop_adj); #endif #if ENABLED(Z_DUAL_ENDSTOPS) - if (parser.seenval('Z')) { - endstops.z_endstop_adj = parser.value_linear_units(); - report = false; - } + if (parser.seen('Z')) z_endstop_adj = parser.value_linear_units(); + SERIAL_ECHOPAIR(" Z", z_endstop_adj); #endif - if (report) { - SERIAL_ECHOPGM("Dual Endstop Adjustment (mm): "); - #if ENABLED(X_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" X", endstops.x_endstop_adj); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Y", endstops.y_endstop_adj); - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Z", endstops.z_endstop_adj); - #endif - SERIAL_EOL(); - } + SERIAL_EOL(); } -#endif // X_DUAL_ENDSTOPS || Y_DUAL_ENDSTOPS || Z_DUAL_ENDSTOPS +#endif // !DELTA && Z_DUAL_ENDSTOPS #if ENABLED(FWRETRACT) @@ -9809,10 +8971,10 @@ inline void gcode_M205() { * Z[units] retract_zlift */ inline void gcode_M207() { - if (parser.seen('S')) fwretract.retract_length = parser.value_axis_units(E_AXIS); - if (parser.seen('F')) fwretract.retract_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); - if (parser.seen('Z')) fwretract.retract_zlift = parser.value_linear_units(); - if (parser.seen('W')) fwretract.swap_retract_length = parser.value_axis_units(E_AXIS); + if (parser.seen('S')) retract_length = parser.value_axis_units(E_AXIS); + if (parser.seen('F')) retract_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); + if (parser.seen('Z')) retract_zlift = parser.value_linear_units(); + if (parser.seen('W')) swap_retract_length = parser.value_axis_units(E_AXIS); } /** @@ -9824,10 +8986,10 @@ inline void gcode_M205() { * R[units/min] swap_retract_recover_feedrate_mm_s */ inline void gcode_M208() { - if (parser.seen('S')) fwretract.retract_recover_length = parser.value_axis_units(E_AXIS); - if (parser.seen('F')) fwretract.retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); - if (parser.seen('R')) fwretract.swap_retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); - if (parser.seen('W')) fwretract.swap_retract_recover_length = parser.value_axis_units(E_AXIS); + if (parser.seen('S')) retract_recover_length = parser.value_axis_units(E_AXIS); + if (parser.seen('F')) retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); + if (parser.seen('R')) swap_retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); + if (parser.seen('W')) swap_retract_recover_length = parser.value_axis_units(E_AXIS); } /** @@ -9838,8 +9000,8 @@ inline void gcode_M205() { inline void gcode_M209() { if (MIN_AUTORETRACT <= MAX_AUTORETRACT) { if (parser.seen('S')) { - fwretract.autoretract_enabled = parser.value_bool(); - for (uint8_t i = 0; i < EXTRUDERS; i++) fwretract.retracted[i] = false; + autoretract_enabled = parser.value_bool(); + for (uint8_t i = 0; i < EXTRUDERS; i++) retracted[i] = false; } } } @@ -9874,53 +9036,36 @@ inline void gcode_M211() { #if HOTENDS > 1 /** - * M218 - Set/get hotend offset (in linear units) + * M218 - set hotend offset (in linear units) * * T * X * Y - * Z - Available with DUAL_X_CARRIAGE, SWITCHING_NOZZLE, and PARKING_EXTRUDER + * Z - Available with DUAL_X_CARRIAGE and SWITCHING_NOZZLE */ inline void gcode_M218() { if (get_target_extruder_from_command(218) || target_extruder == 0) return; - bool report = true; - if (parser.seenval('X')) { - hotend_offset[X_AXIS][target_extruder] = parser.value_linear_units(); - report = false; - } - if (parser.seenval('Y')) { - hotend_offset[Y_AXIS][target_extruder] = parser.value_linear_units(); - report = false; - } + if (parser.seenval('X')) hotend_offset[X_AXIS][target_extruder] = parser.value_linear_units(); + if (parser.seenval('Y')) hotend_offset[Y_AXIS][target_extruder] = parser.value_linear_units(); - #if HAS_HOTEND_OFFSET_Z - if (parser.seenval('Z')) { - hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units(); - report = false; - } + #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER) + if (parser.seenval('Z')) hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units(); #endif - if (report) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); - HOTEND_LOOP() { - SERIAL_CHAR(' '); - SERIAL_ECHO(hotend_offset[X_AXIS][e]); + SERIAL_ECHO_START(); + SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); + HOTEND_LOOP() { + SERIAL_CHAR(' '); + SERIAL_ECHO(hotend_offset[X_AXIS][e]); + SERIAL_CHAR(','); + SERIAL_ECHO(hotend_offset[Y_AXIS][e]); + #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER) SERIAL_CHAR(','); - SERIAL_ECHO(hotend_offset[Y_AXIS][e]); - #if HAS_HOTEND_OFFSET_Z - SERIAL_CHAR(','); - SERIAL_ECHO(hotend_offset[Z_AXIS][e]); - #endif - } - SERIAL_EOL(); + SERIAL_ECHO(hotend_offset[Z_AXIS][e]); + #endif } - - #if ENABLED(DELTA) - if (target_extruder == active_extruder) - do_blocking_move_to_xy(current_position[X_AXIS], current_position[Y_AXIS], planner.max_feedrate_mm_s[X_AXIS]); - #endif + SERIAL_EOL(); } #endif // HOTENDS > 1 @@ -9941,14 +9086,6 @@ inline void gcode_M221() { planner.flow_percentage[target_extruder] = parser.value_int(); planner.refresh_e_factor(target_extruder); } - else { - SERIAL_ECHO_START(); - SERIAL_CHAR('E'); - SERIAL_CHAR('0' + target_extruder); - SERIAL_ECHOPAIR(" Flow: ", planner.flow_percentage[target_extruder]); - SERIAL_CHAR('%'); - SERIAL_EOL(); - } } /** @@ -9956,22 +9093,31 @@ inline void gcode_M221() { */ inline void gcode_M226() { if (parser.seen('P')) { - const int pin = parser.value_int(), pin_state = parser.intval('S', -1); - if (WITHIN(pin_state, -1, 1) && pin > -1) { - if (pin_is_protected(pin)) - protected_pin_err(); - else { - int target = LOW; - planner.synchronize(); - pinMode(pin, INPUT); - switch (pin_state) { - case 1: target = HIGH; break; - case 0: target = LOW; break; - case -1: target = !digitalRead(pin); break; - } - while (digitalRead(pin) != target) idle(); + const int pin_number = parser.value_int(), + pin_state = parser.intval('S', -1); // required pin state - default is inverted + + if (WITHIN(pin_state, -1, 1) && pin_number > -1 && !pin_is_protected(pin_number)) { + + int target = LOW; + + stepper.synchronize(); + + pinMode(pin_number, INPUT); + switch (pin_state) { + case 1: + target = HIGH; + break; + case 0: + target = LOW; + break; + case -1: + target = !digitalRead(pin_number); + break; } - } // pin_state -1 0 1 && pin > -1 + + while (digitalRead(pin_number) != target) idle(); + + } // pin_state -1 0 1 && pin_number > -1 } // parser.seen('P') } @@ -10022,7 +9168,7 @@ inline void gcode_M226() { } else { SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Bad i2c request"); + SERIAL_ERRORLN("Bad i2c request"); } } @@ -10119,7 +9265,7 @@ inline void gcode_M226() { * With PID_EXTRUSION_SCALING: * * C[float] Kc term - * L[int] LPQ length + * L[float] LPQ length */ inline void gcode_M301() { @@ -10133,9 +9279,8 @@ inline void gcode_M226() { if (parser.seen('D')) PID_PARAM(Kd, e) = scalePID_d(parser.value_float()); #if ENABLED(PID_EXTRUSION_SCALING) if (parser.seen('C')) PID_PARAM(Kc, e) = parser.value_float(); - if (parser.seen('L')) thermalManager.lpq_len = parser.value_float(); - NOMORE(thermalManager.lpq_len, LPQ_MAX_LEN); - NOLESS(thermalManager.lpq_len, 0); + if (parser.seen('L')) lpq_len = parser.value_float(); + NOMORE(lpq_len, LPQ_MAX_LEN); #endif thermalManager.updatePID(); @@ -10154,7 +9299,7 @@ inline void gcode_M226() { } else { SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER); + SERIAL_ERRORLN(MSG_INVALID_EXTRUDER); } } @@ -10265,7 +9410,7 @@ inline void gcode_M226() { /** * M303: PID relay autotune * - * S sets the target temperature. (default 150C / 70C) + * S sets the target temperature. (default 150C) * E (-1 for the bed) (default 0) * C * U with a non-zero value will apply the result to current settings @@ -10418,28 +9563,19 @@ inline void gcode_M303() { /** * M400: Finish all moves */ -inline void gcode_M400() { planner.synchronize(); } +inline void gcode_M400() { stepper.synchronize(); } #if HAS_BED_PROBE /** - * M401: Deploy and activate the Z probe + * M401: Engage Z Servo endstop if available */ - inline void gcode_M401() { - DEPLOY_PROBE(); - report_current_position(); - } + inline void gcode_M401() { DEPLOY_PROBE(); } /** - * M402: Deactivate and stow the Z probe + * M402: Retract Z Servo endstop if enabled */ - inline void gcode_M402() { - STOW_PROBE(); - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - report_current_position(); - } + inline void gcode_M402() { STOW_PROBE(); } #endif // HAS_BED_PROBE @@ -10501,16 +9637,13 @@ inline void gcode_M400() { planner.synchronize(); } #endif // FILAMENT_WIDTH_SENSOR void quickstop_stepper() { - planner.quick_stop(); - planner.synchronize(); + stepper.quick_stop(); + stepper.synchronize(); set_current_from_steppers_for_axis(ALL_AXES); SYNC_PLAN_POSITION_KINEMATIC(); } #if HAS_LEVELING - - //#define M420_C_USE_MEAN - /** * M420: Enable/Disable Bed Leveling and/or set the Z fade height. * @@ -10521,19 +9654,8 @@ void quickstop_stepper() { * With AUTO_BED_LEVELING_UBL only: * * L[index] Load UBL mesh from index (0 is default) - * T[map] 0:Human-readable 1:CSV 2:"LCD" 4:Compact - * - * With mesh-based leveling only: - * - * C Center mesh on the mean of the lowest and highest */ inline void gcode_M420() { - const bool seen_S = parser.seen('S'); - bool to_enable = seen_S ? parser.value_bool() : planner.leveling_active; - - // If disabling leveling do it right away - // (Don't disable for just M420 or M420 V) - if (seen_S && !to_enable) set_bed_leveling_enabled(false); const float oldpos[] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; @@ -10542,8 +9664,6 @@ void quickstop_stepper() { // L to load a mesh from the EEPROM if (parser.seen('L')) { - set_bed_leveling_enabled(false); - #if ENABLED(EEPROM_SETTINGS) const int8_t storage_slot = parser.has_value() ? parser.value_int() : ubl.storage_slot; const int16_t a = settings.calc_num_meshes(); @@ -10570,75 +9690,15 @@ void quickstop_stepper() { #endif } - // L or V display the map info + // L to load a mesh from the EEPROM if (parser.seen('L') || parser.seen('V')) { - ubl.display_map(parser.byteval('T')); - SERIAL_ECHOPGM("Mesh is "); - if (!ubl.mesh_is_valid()) SERIAL_ECHOPGM("in"); - SERIAL_ECHOLNPAIR("valid\nStorage slot: ", ubl.storage_slot); + ubl.display_map(0); // Currently only supports one map type + SERIAL_ECHOLNPAIR("ubl.mesh_is_valid = ", ubl.mesh_is_valid()); + SERIAL_ECHOLNPAIR("ubl.storage_slot = ", ubl.storage_slot); } #endif // AUTO_BED_LEVELING_UBL - #if HAS_MESH - - #if ENABLED(MESH_BED_LEVELING) - #define Z_VALUES(X,Y) mbl.z_values[X][Y] - #else - #define Z_VALUES(X,Y) z_values[X][Y] - #endif - - // Subtract the given value or the mean from all mesh values - if (leveling_is_valid() && parser.seen('C')) { - const float cval = parser.value_float(); - #if ENABLED(AUTO_BED_LEVELING_UBL) - - set_bed_leveling_enabled(false); - ubl.adjust_mesh_to_mean(true, cval); - - #else - - #if ENABLED(M420_C_USE_MEAN) - - // Get the sum and average of all mesh values - float mesh_sum = 0; - for (uint8_t x = GRID_MAX_POINTS_X; x--;) - for (uint8_t y = GRID_MAX_POINTS_Y; y--;) - mesh_sum += Z_VALUES(x, y); - const float zmean = mesh_sum / float(GRID_MAX_POINTS); - - #else - - // Find the low and high mesh values - float lo_val = 100, hi_val = -100; - for (uint8_t x = GRID_MAX_POINTS_X; x--;) - for (uint8_t y = GRID_MAX_POINTS_Y; y--;) { - const float z = Z_VALUES(x, y); - NOMORE(lo_val, z); - NOLESS(hi_val, z); - } - // Take the mean of the lowest and highest - const float zmean = (lo_val + hi_val) / 2.0 + cval; - - #endif - - // If not very close to 0, adjust the mesh - if (!NEAR_ZERO(zmean)) { - set_bed_leveling_enabled(false); - // Subtract the mean from all values - for (uint8_t x = GRID_MAX_POINTS_X; x--;) - for (uint8_t y = GRID_MAX_POINTS_Y; y--;) - Z_VALUES(x, y) -= zmean; - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif - } - - #endif - } - - #endif // HAS_MESH - // V to print the matrix or mesh if (parser.seen('V')) { #if ABL_PLANAR @@ -10652,7 +9712,7 @@ void quickstop_stepper() { #endif #elif ENABLED(MESH_BED_LEVELING) SERIAL_ECHOLNPGM("Mesh Bed Level data:"); - mbl.report_mesh(); + mbl_mesh_report(); #endif } #endif @@ -10662,17 +9722,21 @@ void quickstop_stepper() { if (parser.seen('Z')) set_z_fade_height(parser.value_linear_units(), false); #endif - // Enable leveling if specified, or if previously active - set_bed_leveling_enabled(to_enable); + bool to_enable = false; + if (parser.seen('S')) { + to_enable = parser.value_bool(); + set_bed_leveling_enabled(to_enable); + } - // Error if leveling failed to enable or reenable - if (to_enable && !planner.leveling_active) { + const bool new_status = planner.leveling_active; + + if (to_enable && !new_status) { SERIAL_ERROR_START(); SERIAL_ERRORLNPGM(MSG_ERR_M420_FAILED); } SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Bed Leveling ", planner.leveling_active ? MSG_ON : MSG_OFF); + SERIAL_ECHOLNPAIR("Bed Leveling ", new_status ? MSG_ON : MSG_OFF); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) SERIAL_ECHO_START(); @@ -10687,8 +9751,7 @@ void quickstop_stepper() { if (memcmp(oldpos, current_position, sizeof(oldpos))) report_current_position(); } - -#endif // HAS_LEVELING +#endif #if ENABLED(MESH_BED_LEVELING) @@ -10760,7 +9823,6 @@ void quickstop_stepper() { * Usage: * M421 I J Z * M421 I J Q - * M421 I J N * M421 C Z * M421 C Q */ @@ -10769,7 +9831,6 @@ void quickstop_stepper() { const bool hasI = ix >= 0, hasJ = iy >= 0, hasC = parser.seen('C'), - hasN = parser.seen('N'), hasZ = parser.seen('Z'), hasQ = !hasZ && parser.seen('Q'); @@ -10779,7 +9840,7 @@ void quickstop_stepper() { iy = location.y_index; } - if (int(hasC) + int(hasI && hasJ) != 1 || !(hasZ || hasQ || hasN)) { + if (int(hasC) + int(hasI && hasJ) != 1 || !(hasZ || hasQ)) { SERIAL_ERROR_START(); SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS); } @@ -10788,7 +9849,7 @@ void quickstop_stepper() { SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY); } else - ubl.z_values[ix][iy] = hasN ? NAN : parser.value_linear_units() + (hasQ ? ubl.z_values[ix][iy] : 0); + ubl.z_values[ix][iy] = parser.value_linear_units() + (hasQ ? ubl.z_values[ix][iy] : 0); } #endif // AUTO_BED_LEVELING_UBL @@ -10862,36 +9923,13 @@ inline void gcode_M502() { } #endif -#if ENABLED(EEPROM_SETTINGS) - /** - * M504: Validate EEPROM Contents - */ - inline void gcode_M504() { - if (settings.validate()) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("EEPROM OK"); - } - } -#endif - -#if ENABLED(SDSUPPORT) - - /** - * M524: Abort the current SD print job (started with M24) - */ - inline void gcode_M524() { - if (IS_SD_PRINTING()) card.abort_sd_printing = true; - } - -#endif // SDSUPPORT - #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) /** * M540: Set whether SD card print should abort on endstop hit (M540 S<0|1>) */ inline void gcode_M540() { - if (parser.seen('S')) planner.abort_on_endstop_hit = parser.value_bool(); + if (parser.seen('S')) stepper.abort_on_endstop_hit = parser.value_bool(); } #endif // ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED @@ -10899,18 +9937,16 @@ inline void gcode_M502() { #if HAS_BED_PROBE inline void gcode_M851() { - if (parser.seenval('Z')) { - const float value = parser.value_linear_units(); - if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) - zprobe_zoffset = value; - else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("?Z out of range (" STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " to " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX) ")"); - } - return; - } SERIAL_ECHO_START(); SERIAL_ECHOPGM(MSG_PROBE_Z_OFFSET); + if (parser.seen('Z')) { + const float value = parser.value_linear_units(); + if (!WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + SERIAL_ECHOLNPGM(" " MSG_Z_MIN " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " " MSG_Z_MAX " " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX)); + return; + } + zprobe_zoffset = value; + } SERIAL_ECHOLNPAIR(": ", zprobe_zoffset); } @@ -10984,9 +10020,7 @@ inline void gcode_M502() { if (!ijk) { SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SKEW_FACTOR " XY: "); - SERIAL_ECHO_F(planner.xy_skew_factor, 6); - SERIAL_EOL(); + SERIAL_ECHOPAIR(MSG_SKEW_FACTOR " XY: ", planner.xy_skew_factor); #if ENABLED(SKEW_CORRECTION_FOR_Z) SERIAL_ECHOPAIR(" XZ: ", planner.xz_skew_factor); SERIAL_ECHOLNPAIR(" YZ: ", planner.yz_skew_factor); @@ -11003,72 +10037,65 @@ inline void gcode_M502() { /** * M600: Pause for filament change * - * E[distance] - Retract the filament this far + * E[distance] - Retract the filament this far (negative value) * Z[distance] - Move the Z axis by this distance * X[position] - Move to this X position, with Y * Y[position] - Move to this Y position, with X - * U[distance] - Retract distance for removal (manual reload) - * L[distance] - Extrude distance for insertion (manual reload) + * U[distance] - Retract distance for removal (negative value) (manual reload) + * L[distance] - Extrude distance for insertion (positive value) (manual reload) * B[count] - Number of times to beep, -1 for indefinite (if equipped with a buzzer) - * T[toolhead] - Select extruder for filament change * * Default values are used for omitted arguments. + * */ inline void gcode_M600() { point_t park_point = NOZZLE_PARK_POINT; - if (get_target_extruder_from_command(600)) return; - - // Show initial message - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT, ADVANCED_PAUSE_MODE_PAUSE_PRINT, target_extruder); - #endif - #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE) // Don't allow filament change without homing first if (axis_unhomed_error()) home_all_axes(); #endif - #if EXTRUDERS > 1 - // Change toolhead if specified - uint8_t active_extruder_before_filament_change = active_extruder; - if (active_extruder != target_extruder) - tool_change(target_extruder, 0, true); - #endif - // Initial retract before move to filament change position - const float retract = -ABS(parser.seen('E') ? parser.value_axis_units(E_AXIS) : 0 + const float retract = parser.seen('E') ? parser.value_axis_units(E_AXIS) : 0 #ifdef PAUSE_PARK_RETRACT_LENGTH - + (PAUSE_PARK_RETRACT_LENGTH) + - (PAUSE_PARK_RETRACT_LENGTH) #endif - ); + ; // Lift Z axis - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); + if (parser.seenval('Z')) + park_point.z = parser.linearval('Z'); // Move XY axes to filament change position or given position - if (parser.seenval('X')) park_point.x = parser.linearval('X'); - if (parser.seenval('Y')) park_point.y = parser.linearval('Y'); + if (parser.seenval('X')) + park_point.x = parser.linearval('X'); - #if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE) && DISABLED(DELTA) + if (parser.seenval('Y')) + park_point.y = parser.linearval('Y'); + + #if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE) park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0); park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0); #endif // Unload filament - const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) : - filament_change_unload_length[active_extruder]); + const float unload_length = parser.seen('U') ? parser.value_axis_units(E_AXIS) : 0 + #if defined(FILAMENT_CHANGE_UNLOAD_LENGTH) && FILAMENT_CHANGE_UNLOAD_LENGTH > 0 + - (FILAMENT_CHANGE_UNLOAD_LENGTH) + #endif + ; - // Slow load filament - constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; - - // Fast load filament - const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : - filament_change_load_length[active_extruder]); + // Load filament + const float load_length = parser.seen('L') ? parser.value_axis_units(E_AXIS) : 0 + #ifdef FILAMENT_CHANGE_LOAD_LENGTH + + FILAMENT_CHANGE_LOAD_LENGTH + #endif + ; const int beep_count = parser.intval('B', - #ifdef FILAMENT_CHANGE_ALERT_BEEPS - FILAMENT_CHANGE_ALERT_BEEPS + #ifdef FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS + FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS #else -1 #endif @@ -11076,56 +10103,21 @@ inline void gcode_M502() { const bool job_running = print_job_timer.isRunning(); - if (pause_print(retract, park_point, unload_length, true)) { + if (pause_print(retract, park_point, unload_length, beep_count, true)) { wait_for_filament_reload(beep_count); - resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count); + resume_print(load_length, ADVANCED_PAUSE_EXTRUDE_LENGTH, beep_count); } - #if EXTRUDERS > 1 - // Restore toolhead if it was changed - if (active_extruder_before_filament_change != active_extruder) - tool_change(active_extruder_before_filament_change, 0, true); - #endif - // Resume the print job timer if it was running if (job_running) print_job_timer.start(); } - /** - * M603: Configure filament change - * - * T[toolhead] - Select extruder to configure, active extruder if not specified - * U[distance] - Retract distance for removal, for the specified extruder - * L[distance] - Extrude distance for insertion, for the specified extruder - * - */ - inline void gcode_M603() { - - if (get_target_extruder_from_command(603)) return; - - // Unload length - if (parser.seen('U')) { - filament_change_unload_length[target_extruder] = ABS(parser.value_axis_units(E_AXIS)); - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - NOMORE(filament_change_unload_length[target_extruder], EXTRUDE_MAXLENGTH); - #endif - } - - // Load length - if (parser.seen('L')) { - filament_change_load_length[target_extruder] = ABS(parser.value_axis_units(E_AXIS)); - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - NOMORE(filament_change_load_length[target_extruder], EXTRUDE_MAXLENGTH); - #endif - } - } - #endif // ADVANCED_PAUSE_FEATURE #if ENABLED(MK2_MULTIPLEXER) inline void select_multiplexed_stepper(const uint8_t e) { - planner.synchronize(); + stepper.synchronize(); disable_e_steppers(); WRITE(E_MUX0_PIN, TEST(e, 0) ? HIGH : LOW); WRITE(E_MUX1_PIN, TEST(e, 1) ? HIGH : LOW); @@ -11133,6 +10125,26 @@ inline void gcode_M502() { safe_delay(100); } + /** + * M702: Unload all extruders + */ + inline void gcode_M702() { + for (uint8_t s = 0; s < E_STEPPERS; s++) { + select_multiplexed_stepper(e); + // TODO: standard unload filament function + // MK2 firmware behavior: + // - Make sure temperature is high enough + // - Raise Z to at least 15 to make room + // - Extrude 1cm of filament in 1 second + // - Under 230C quickly purge ~12mm, over 230C purge ~10mm + // - Change E max feedrate to 80, eject the filament from the tube. Sync. + // - Restore E max feedrate to 50 + } + // Go back to the last active extruder + select_multiplexed_stepper(active_extruder); + disable_e_steppers(); + } + #endif // MK2_MULTIPLEXER #if ENABLED(DUAL_X_CARRIAGE) @@ -11150,14 +10162,14 @@ inline void gcode_M502() { * Note: the X axis should be homed after changing dual x-carriage mode. */ inline void gcode_M605() { - planner.synchronize(); + stepper.synchronize(); if (parser.seen('S')) dual_x_carriage_mode = (DualXMode)parser.value_byte(); switch (dual_x_carriage_mode) { case DXC_FULL_CONTROL_MODE: case DXC_AUTO_PARK_MODE: break; case DXC_DUPLICATION_MODE: - if (parser.seen('X')) duplicate_extruder_x_offset = MAX(parser.value_linear_units(), X2_MIN_POS - x_home_pos(0)); + if (parser.seen('X')) duplicate_extruder_x_offset = max(parser.value_linear_units(), X2_MIN_POS - x_home_pos(0)); if (parser.seen('R')) duplicate_extruder_temp_offset = parser.value_celsius_diff(); SERIAL_ECHO_START(); SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); @@ -11182,502 +10194,520 @@ inline void gcode_M502() { #elif ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) inline void gcode_M605() { - planner.synchronize(); - extruder_duplication_enabled = parser.intval('S') == int(DXC_DUPLICATION_MODE); + stepper.synchronize(); + extruder_duplication_enabled = parser.intval('S') == (int)DXC_DUPLICATION_MODE; SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(MSG_DUPLICATION_MODE, extruder_duplication_enabled ? MSG_ON : MSG_OFF); } #endif // DUAL_NOZZLE_DUPLICATION_MODE -#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - - /** - * M701: Load filament - * - * T - Optional extruder number. Current extruder if omitted. - * Z - Move the Z axis by this distance - * L - Extrude distance for insertion (positive value) (manual reload) - * - * Default values are used for omitted arguments. - */ - inline void gcode_M701() { - point_t park_point = NOZZLE_PARK_POINT; - - #if ENABLED(NO_MOTION_BEFORE_HOMING) - // Only raise Z if the machine is homed - if (axis_unhomed_error()) park_point.z = 0; - #endif - - if (get_target_extruder_from_command(701)) return; - - // Z axis lift - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - // Show initial "wait for load" message - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, ADVANCED_PAUSE_MODE_LOAD_FILAMENT, target_extruder); - #endif - - #if EXTRUDERS > 1 - // Change toolhead if specified - uint8_t active_extruder_before_filament_change = active_extruder; - if (active_extruder != target_extruder) - tool_change(target_extruder, 0, true); - #endif - - // Lift Z axis - if (park_point.z > 0) - do_blocking_move_to_z(MIN(current_position[Z_AXIS] + park_point.z, Z_MAX_POS), NOZZLE_PARK_Z_FEEDRATE); - - constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; - const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : filament_change_load_length[active_extruder]); - load_filament(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, FILAMENT_CHANGE_ALERT_BEEPS, - true, thermalManager.wait_for_heating(target_extruder), ADVANCED_PAUSE_MODE_LOAD_FILAMENT); - - // Restore Z axis - if (park_point.z > 0) - do_blocking_move_to_z(MAX(current_position[Z_AXIS] - park_point.z, 0), NOZZLE_PARK_Z_FEEDRATE); - - #if EXTRUDERS > 1 - // Restore toolhead if it was changed - if (active_extruder_before_filament_change != active_extruder) - tool_change(active_extruder_before_filament_change, 0, true); - #endif - - // Show status screen - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - } - - /** - * M702: Unload filament - * - * T - Optional extruder number. If omitted, current extruder - * (or ALL extruders with FILAMENT_UNLOAD_ALL_EXTRUDERS). - * Z - Move the Z axis by this distance - * U - Retract distance for removal (manual reload) - * - * Default values are used for omitted arguments. - */ - inline void gcode_M702() { - point_t park_point = NOZZLE_PARK_POINT; - - #if ENABLED(NO_MOTION_BEFORE_HOMING) - // Only raise Z if the machine is homed - if (axis_unhomed_error()) park_point.z = 0; - #endif - - if (get_target_extruder_from_command(702)) return; - - // Z axis lift - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - // Show initial message - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, target_extruder); - #endif - - #if EXTRUDERS > 1 - // Change toolhead if specified - uint8_t active_extruder_before_filament_change = active_extruder; - if (active_extruder != target_extruder) - tool_change(target_extruder, 0, true); - #endif - - // Lift Z axis - if (park_point.z > 0) - do_blocking_move_to_z(MIN(current_position[Z_AXIS] + park_point.z, Z_MAX_POS), NOZZLE_PARK_Z_FEEDRATE); - - // Unload filament - #if EXTRUDERS > 1 && ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - if (!parser.seenval('T')) { - HOTEND_LOOP() { - if (e != active_extruder) tool_change(e, 0, true); - unload_filament(-filament_change_unload_length[e], true, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT); - } - } - else - #endif - { - // Unload length - const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) : - filament_change_unload_length[target_extruder]); - - unload_filament(unload_length, true, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT); - } - - // Restore Z axis - if (park_point.z > 0) - do_blocking_move_to_z(MAX(current_position[Z_AXIS] - park_point.z, 0), NOZZLE_PARK_Z_FEEDRATE); - - #if EXTRUDERS > 1 - // Restore toolhead if it was changed - if (active_extruder_before_filament_change != active_extruder) - tool_change(active_extruder_before_filament_change, 0, true); - #endif - - // Show status screen - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - } - -#endif // FILAMENT_LOAD_UNLOAD_GCODES - -#if ENABLED(MAX7219_GCODE) - /** - * M7219: Control the Max7219 LED matrix - * - * I - Initialize (clear) the matrix - * F - Fill the matrix (set all bits) - * P - Dump the LEDs[] array values - * C - Set a column to the 8-bit value V - * R - Set a row to the 8-bit value V - * X - X position of an LED to set or toggle - * Y - Y position of an LED to set or toggle - * V - The potentially 32-bit value or on/off state to set - * (for example: a chain of 4 Max7219 devices can have 32 bit - * rows or columns depending upon rotation) - */ - inline void gcode_M7219() { - if (parser.seen('I')) { - max7219.register_setup(); - max7219.clear(); - } - - if (parser.seen('F')) max7219.fill(); - - const uint32_t v = parser.ulongval('V'); - - if (parser.seenval('R')) { - const uint8_t r = parser.value_byte(); - max7219.set_row(r, v); - } - else if (parser.seenval('C')) { - const uint8_t c = parser.value_byte(); - max7219.set_column(c, v); - } - else if (parser.seenval('X') || parser.seenval('Y')) { - const uint8_t x = parser.byteval('X'), y = parser.byteval('Y'); - if (parser.seenval('V')) - max7219.led_set(x, y, parser.boolval('V')); - else - max7219.led_toggle(x, y); - } - else if (parser.seen('D')) { - const uint8_t line = parser.byteval('D') + (parser.byteval('U') << 3); - if (line < MAX7219_LINES) { - max7219.led_line[line] = v; - return max7219.refresh_line(line); - } - } - - if (parser.seen('P')) { - for (uint8_t r = 0; r < MAX7219_LINES; r++) { - SERIAL_ECHOPGM("led_line["); - if (r < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(int(r)); - SERIAL_ECHOPGM("]="); - for (uint8_t b = 8; b--;) SERIAL_CHAR('0' + TEST(max7219.led_line[r], b)); - SERIAL_EOL(); - } - } - } -#endif // MAX7219_GCODE - #if ENABLED(LIN_ADVANCE) /** - * M900: Get or Set Linear Advance K-factor + * M900: Set and/or Get advance K factor and WH/D ratio * - * K Set advance K factor + * K Set advance K factor + * R Set ratio directly (overrides WH/D) + * W H D Set ratio from WH/D */ inline void gcode_M900() { - if (parser.seenval('K')) { - const float newK = parser.floatval('K'); - if (WITHIN(newK, 0, 10)) { - planner.synchronize(); - planner.extruder_advance_K = newK; - } - else - SERIAL_PROTOCOLLNPGM("?K value out of range (0-10)."); - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Advance K=", planner.extruder_advance_K); + stepper.synchronize(); + + const float newK = parser.floatval('K', -1); + if (newK >= 0) planner.extruder_advance_k = newK; + + float newR = parser.floatval('R', -1); + if (newR < 0) { + const float newD = parser.floatval('D', -1), + newW = parser.floatval('W', -1), + newH = parser.floatval('H', -1); + if (newD >= 0 && newW >= 0 && newH >= 0) + newR = newD ? (newW * newH) / (sq(newD * 0.5) * M_PI) : 0; } + if (newR >= 0) planner.advance_ed_ratio = newR; + + SERIAL_ECHO_START(); + SERIAL_ECHOPAIR("Advance K=", planner.extruder_advance_k); + SERIAL_ECHOPGM(" E/D="); + const float ratio = planner.advance_ed_ratio; + if (ratio) SERIAL_ECHO(ratio); else SERIAL_ECHOPGM("Auto"); + SERIAL_EOL(); } #endif // LIN_ADVANCE #if HAS_TRINAMIC + static bool report_tmc_status = false; + const char extended_axis_codes[11][3] = { "X", "X2", "Y", "Y2", "Z", "Z2", "E0", "E1", "E2", "E3", "E4" }; + enum TMC_AxisEnum { + TMC_X, + TMC_X2, + TMC_Y, + TMC_Y2, + TMC_Z, + TMC_Z2, + TMC_E0, + TMC_E1, + TMC_E2, + TMC_E3, + TMC_E4 + }; #if ENABLED(TMC_DEBUG) - inline void gcode_M122() { - if (parser.seen('S')) - tmc_set_report_status(parser.value_bool()); - else - tmc_report_all(); + enum TMC_debug_enum { + TMC_CODES, + TMC_ENABLED, + TMC_CURRENT, + TMC_RMS_CURRENT, + TMC_MAX_CURRENT, + TMC_IRUN, + TMC_IHOLD, + TMC_CS_ACTUAL, + TMC_PWM_SCALE, + TMC_VSENSE, + TMC_STEALTHCHOP, + TMC_MICROSTEPS, + TMC_TSTEP, + TMC_TPWMTHRS, + TMC_TPWMTHRS_MMS, + TMC_OTPW, + TMC_OTPW_TRIGGERED, + TMC_TOFF, + TMC_TBL, + TMC_HEND, + TMC_HSTRT, + TMC_SGT + }; + enum TMC_drv_status_enum { + TMC_DRV_CODES, + TMC_STST, + TMC_OLB, + TMC_OLA, + TMC_S2GB, + TMC_S2GA, + TMC_DRV_OTPW, + TMC_OT, + TMC_STALLGUARD, + TMC_DRV_CS_ACTUAL, + TMC_FSACTIVE, + TMC_SG_RESULT, + TMC_DRV_STATUS_HEX, + TMC_T157, + TMC_T150, + TMC_T143, + TMC_T120, + TMC_STEALTH, + TMC_S2VSB, + TMC_S2VSA + }; + static void drv_status_print_hex(const char name[], const uint32_t drv_status) { + SERIAL_ECHO(name); + SERIAL_ECHOPGM(" = 0x"); + for(int B=24; B>=8; B-=8){ + MYSERIAL.print((drv_status>>(B+4))&0xF, HEX); + MYSERIAL.print((drv_status>>B)&0xF, HEX); + MYSERIAL.print(':'); + } + MYSERIAL.print((drv_status>>4)&0xF, HEX); + MYSERIAL.print((drv_status)&0xF, HEX); + SERIAL_EOL(); } - #endif // TMC_DEBUG - /** - * M906: Set motor current in milliamps using axis codes X, Y, Z, E - * Uses axis codes A, B, C, D, E for Hangprinter - * Report driver currents when no axis specified - */ - inline void gcode_M906() { - #define TMC_SAY_CURRENT(Q) tmc_get_current(stepper##Q, TMC_##Q) - #define TMC_SET_CURRENT(Q) tmc_set_current(stepper##Q, value) + #if ENABLED(HAVE_TMC2130) + static void tmc_status(TMC2130Stepper &st, const TMC_debug_enum i) { + switch(i) { + case TMC_PWM_SCALE: MYSERIAL.print(st.PWM_SCALE(), DEC); break; + case TMC_TSTEP: SERIAL_ECHO(st.TSTEP()); break; + case TMC_SGT: MYSERIAL.print(st.sgt(), DEC); break; + case TMC_STEALTHCHOP: serialprintPGM(st.stealthChop() ? PSTR("true") : PSTR("false")); break; + default: break; + } + } + static void tmc_parse_drv_status(TMC2130Stepper &st, const TMC_drv_status_enum i) { + switch(i) { + case TMC_STALLGUARD: if (st.stallguard()) SERIAL_ECHOPGM("X"); break; + case TMC_SG_RESULT: MYSERIAL.print(st.sg_result(), DEC); break; + case TMC_FSACTIVE: if (st.fsactive()) SERIAL_ECHOPGM("X"); break; + default: break; + } + } + #endif + #if ENABLED(HAVE_TMC2208) + static void tmc_status(TMC2208Stepper &st, const TMC_debug_enum i) { + switch(i) { + case TMC_TSTEP: + { + uint32_t data = 0; + st.TSTEP(&data); + MYSERIAL.print(data); + break; + } + case TMC_PWM_SCALE: MYSERIAL.print(st.pwm_scale_sum(), DEC); break; + case TMC_STEALTHCHOP: serialprintPGM(st.stealth() ? PSTR("true") : PSTR("false")); break; + case TMC_S2VSA: if (st.s2vsa()) SERIAL_ECHOPGM("X"); break; + case TMC_S2VSB: if (st.s2vsb()) SERIAL_ECHOPGM("X"); break; + default: break; + } + } + static void tmc_parse_drv_status(TMC2208Stepper &st, const TMC_drv_status_enum i) { + switch(i) { + case TMC_T157: if (st.t157()) SERIAL_ECHOPGM("X"); break; + case TMC_T150: if (st.t150()) SERIAL_ECHOPGM("X"); break; + case TMC_T143: if (st.t143()) SERIAL_ECHOPGM("X"); break; + case TMC_T120: if (st.t120()) SERIAL_ECHOPGM("X"); break; + default: break; + } + } + #endif + template + static void tmc_status(TMC &st, TMC_AxisEnum axis, const TMC_debug_enum i, const float spmm) { + SERIAL_ECHO('\t'); + switch(i) { + case TMC_CODES: SERIAL_ECHO(extended_axis_codes[axis]); break; + case TMC_ENABLED: serialprintPGM(st.isEnabled() ? PSTR("true") : PSTR("false")); break; + case TMC_CURRENT: SERIAL_ECHO(st.getCurrent()); break; + case TMC_RMS_CURRENT: MYSERIAL.print(st.rms_current()); break; + case TMC_MAX_CURRENT: MYSERIAL.print((float)st.rms_current()*1.41, 0); break; + case TMC_IRUN: + MYSERIAL.print(st.irun(), DEC); + SERIAL_ECHOPGM("/31"); + break; + case TMC_IHOLD: + MYSERIAL.print(st.ihold(), DEC); + SERIAL_ECHOPGM("/31"); + break; + case TMC_CS_ACTUAL: + MYSERIAL.print(st.cs_actual(), DEC); + SERIAL_ECHOPGM("/31"); + break; - bool report = true; - const uint8_t index = parser.byteval('I'); - LOOP_NUM_AXIS(i) if (uint16_t value = parser.intval(RAW_AXIS_CODES(i))) { + case TMC_VSENSE: serialprintPGM(st.vsense() ? PSTR("1=.18") : PSTR("0=.325")); break; - report = false; - switch (i) { - // Assumes {A_AXIS, B_AXIS, C_AXIS} == {X_AXIS, Y_AXIS, Z_AXIS} - case X_AXIS: - #if AXIS_IS_TMC(X) - if (index < 2) TMC_SET_CURRENT(X); - #endif - #if AXIS_IS_TMC(X2) - if (!(index & 1)) TMC_SET_CURRENT(X2); - #endif - break; - case Y_AXIS: - #if AXIS_IS_TMC(Y) - if (index < 2) TMC_SET_CURRENT(Y); - #endif - #if AXIS_IS_TMC(Y2) - if (!(index & 1)) TMC_SET_CURRENT(Y2); - #endif - break; - case Z_AXIS: - #if AXIS_IS_TMC(Z) - if (index < 2) TMC_SET_CURRENT(Z); - #endif - #if AXIS_IS_TMC(Z2) - if (!(index & 1)) TMC_SET_CURRENT(Z2); - #endif - break; - case E_AXIS: { - if (get_target_extruder_from_command(906)) return; - switch (target_extruder) { - #if AXIS_IS_TMC(E0) - case 0: TMC_SET_CURRENT(E0); break; - #endif - #if ENABLED(HANGPRINTER) - // Avoid setting the D-current - #if AXIS_IS_TMC(E1) && EXTRUDERS > 1 - case 1: TMC_SET_CURRENT(E1); break; - #endif - #if AXIS_IS_TMC(E2) && EXTRUDERS > 2 - case 2: TMC_SET_CURRENT(E2); break; - #endif - #if AXIS_IS_TMC(E3) && EXTRUDERS > 3 - case 3: TMC_SET_CURRENT(E3); break; - #endif - #if AXIS_IS_TMC(E4) && EXTRUDERS > 4 - case 4: TMC_SET_CURRENT(E4); break; - #endif - #else - #if AXIS_IS_TMC(E1) - case 1: TMC_SET_CURRENT(E1); break; - #endif - #if AXIS_IS_TMC(E2) - case 2: TMC_SET_CURRENT(E2); break; - #endif - #if AXIS_IS_TMC(E3) - case 3: TMC_SET_CURRENT(E3); break; - #endif - #if AXIS_IS_TMC(E4) - case 4: TMC_SET_CURRENT(E4); break; - #endif - #endif + case TMC_MICROSTEPS: SERIAL_ECHO(st.microsteps()); break; + case TMC_TPWMTHRS: + { + uint32_t tpwmthrs_val = st.TPWMTHRS(); + SERIAL_ECHO(tpwmthrs_val); } - } break; - #if ENABLED(HANGPRINTER) - case D_AXIS: - // D is connected on the first of E1, E2, E3, E4 output that is not an extruder - #if AXIS_IS_TMC(E1) && EXTRUDERS == 1 - TMC_SET_CURRENT(E1); break; - #endif - #if AXIS_IS_TMC(E2) && EXTRUDERS == 2 - TMC_SET_CURRENT(E2); break; - #endif - #if AXIS_IS_TMC(E3) && EXTRUDERS == 3 - TMC_SET_CURRENT(E3); break; - #endif - #if AXIS_IS_TMC(E4) && EXTRUDERS == 4 - TMC_SET_CURRENT(E4); break; - #endif - #endif + break; + case TMC_TPWMTHRS_MMS: + { + uint32_t tpwmthrs_val = st.TPWMTHRS(); + tpwmthrs_val ? SERIAL_ECHO(12650000UL * st.microsteps() / (256 * tpwmthrs_val * spmm)) : SERIAL_ECHO('-'); + } + break; + case TMC_OTPW: serialprintPGM(st.otpw() ? PSTR("true") : PSTR("false")); break; + case TMC_OTPW_TRIGGERED: serialprintPGM(st.getOTPW() ? PSTR("true") : PSTR("false")); break; + case TMC_TOFF: MYSERIAL.print(st.toff(), DEC); break; + case TMC_TBL: MYSERIAL.print(st.blank_time(), DEC); break; + case TMC_HEND: MYSERIAL.print(st.hysterisis_end(), DEC); break; + case TMC_HSTRT: MYSERIAL.print(st.hysterisis_start(), DEC); break; + default: tmc_status(st, i); break; + } + } + template + static void tmc_parse_drv_status(TMC &st, TMC_AxisEnum axis, const TMC_drv_status_enum i) { + SERIAL_ECHOPGM("\t"); + switch(i) { + case TMC_DRV_CODES: SERIAL_ECHO(extended_axis_codes[axis]); break; + case TMC_STST: if (st.stst()) SERIAL_ECHOPGM("X"); break; + case TMC_OLB: if (st.olb()) SERIAL_ECHOPGM("X"); break; + case TMC_OLA: if (st.ola()) SERIAL_ECHOPGM("X"); break; + case TMC_S2GB: if (st.s2gb()) SERIAL_ECHOPGM("X"); break; + case TMC_S2GA: if (st.s2ga()) SERIAL_ECHOPGM("X"); break; + case TMC_DRV_OTPW: if (st.otpw()) SERIAL_ECHOPGM("X"); break; + case TMC_OT: if (st.ot()) SERIAL_ECHOPGM("X"); break; + case TMC_DRV_CS_ACTUAL: MYSERIAL.print(st.cs_actual(), DEC); break; + case TMC_DRV_STATUS_HEX:drv_status_print_hex(extended_axis_codes[axis], st.DRV_STATUS()); break; + default: tmc_parse_drv_status(st, i); break; } } - if (report) { - #if AXIS_IS_TMC(X) - TMC_SAY_CURRENT(X); + static void tmc_debug_loop(const TMC_debug_enum i) { + #if X_IS_TRINAMIC + tmc_status(stepperX, TMC_X, i, planner.axis_steps_per_mm[X_AXIS]); #endif - #if AXIS_IS_TMC(X2) - TMC_SAY_CURRENT(X2); + #if X2_IS_TRINAMIC + tmc_status(stepperX2, TMC_X2, i, planner.axis_steps_per_mm[X_AXIS]); #endif - #if AXIS_IS_TMC(Y) - TMC_SAY_CURRENT(Y); + + #if Y_IS_TRINAMIC + tmc_status(stepperY, TMC_Y, i, planner.axis_steps_per_mm[Y_AXIS]); #endif - #if AXIS_IS_TMC(Y2) - TMC_SAY_CURRENT(Y2); + #if Y2_IS_TRINAMIC + tmc_status(stepperY2, TMC_Y2, i, planner.axis_steps_per_mm[Y_AXIS]); #endif - #if AXIS_IS_TMC(Z) - TMC_SAY_CURRENT(Z); + + #if Z_IS_TRINAMIC + tmc_status(stepperZ, TMC_Z, i, planner.axis_steps_per_mm[Z_AXIS]); #endif - #if AXIS_IS_TMC(Z2) - TMC_SAY_CURRENT(Z2); + #if Z2_IS_TRINAMIC + tmc_status(stepperZ2, TMC_Z2, i, planner.axis_steps_per_mm[Z_AXIS]); #endif - #if AXIS_IS_TMC(E0) - TMC_SAY_CURRENT(E0); + + #if E0_IS_TRINAMIC + tmc_status(stepperE0, TMC_E0, i, planner.axis_steps_per_mm[E_AXIS]); #endif - #if ENABLED(HANGPRINTER) - // D is connected on the first of E1, E2, E3, E4 output that is not an extruder - #if AXIS_IS_TMC(E1) && EXTRUDERS == 1 - TMC_SAY_CURRENT(E1); - #endif - #if AXIS_IS_TMC(E2) && EXTRUDERS == 2 - TMC_SAY_CURRENT(E2); - #endif - #if AXIS_IS_TMC(E3) && EXTRUDERS == 3 - TMC_SAY_CURRENT(E3); - #endif - #if AXIS_IS_TMC(E4) && EXTRUDERS == 4 - TMC_SAY_CURRENT(E4); - #endif - #else - #if AXIS_IS_TMC(E1) - TMC_SAY_CURRENT(E1); - #endif - #if AXIS_IS_TMC(E2) - TMC_SAY_CURRENT(E2); - #endif - #if AXIS_IS_TMC(E3) - TMC_SAY_CURRENT(E3); - #endif - #if AXIS_IS_TMC(E4) - TMC_SAY_CURRENT(E4); - #endif + #if E1_IS_TRINAMIC + tmc_status(stepperE1, TMC_E1, i, planner.axis_steps_per_mm[E_AXIS+1]); #endif + #if E2_IS_TRINAMIC + tmc_status(stepperE2, TMC_E2, i, planner.axis_steps_per_mm[E_AXIS+2]); + #endif + #if E3_IS_TRINAMIC + tmc_status(stepperE3, TMC_E3, i, planner.axis_steps_per_mm[E_AXIS+3]); + #endif + #if E4_IS_TRINAMIC + tmc_status(stepperE4, TMC_E4, i, planner.axis_steps_per_mm[E_AXIS+4]); + #endif + + SERIAL_EOL(); } + + static void drv_status_loop(const TMC_drv_status_enum i) { + #if X_IS_TRINAMIC + tmc_parse_drv_status(stepperX, TMC_X, i); + #endif + #if X2_IS_TRINAMIC + tmc_parse_drv_status(stepperX2, TMC_X2, i); + #endif + + #if Y_IS_TRINAMIC + tmc_parse_drv_status(stepperY, TMC_Y, i); + #endif + #if Y2_IS_TRINAMIC + tmc_parse_drv_status(stepperY2, TMC_Y2, i); + #endif + + #if Z_IS_TRINAMIC + tmc_parse_drv_status(stepperZ, TMC_Z, i); + #endif + #if Z2_IS_TRINAMIC + tmc_parse_drv_status(stepperZ2, TMC_Z2, i); + #endif + + #if E0_IS_TRINAMIC + tmc_parse_drv_status(stepperE0, TMC_E0, i); + #endif + #if E1_IS_TRINAMIC + tmc_parse_drv_status(stepperE1, TMC_E1, i); + #endif + #if E2_IS_TRINAMIC + tmc_parse_drv_status(stepperE2, TMC_E2, i); + #endif + #if E3_IS_TRINAMIC + tmc_parse_drv_status(stepperE3, TMC_E3, i); + #endif + #if E4_IS_TRINAMIC + tmc_parse_drv_status(stepperE4, TMC_E4, i); + #endif + + SERIAL_EOL(); + } + + inline void gcode_M122() { + if (parser.seen('S')) { + if (parser.value_bool()) { + SERIAL_ECHOLNPGM("axis:pwm_scale |status_response|"); + report_tmc_status = true; + } else + report_tmc_status = false; + } else { + SERIAL_ECHOPGM("\t"); tmc_debug_loop(TMC_CODES); + SERIAL_ECHOPGM("Enabled\t"); tmc_debug_loop(TMC_ENABLED); + SERIAL_ECHOPGM("Set current"); tmc_debug_loop(TMC_CURRENT); + SERIAL_ECHOPGM("RMS current"); tmc_debug_loop(TMC_RMS_CURRENT); + SERIAL_ECHOPGM("MAX current"); tmc_debug_loop(TMC_MAX_CURRENT); + SERIAL_ECHOPGM("Run current"); tmc_debug_loop(TMC_IRUN); + SERIAL_ECHOPGM("Hold current"); tmc_debug_loop(TMC_IHOLD); + SERIAL_ECHOPGM("CS actual\t"); tmc_debug_loop(TMC_CS_ACTUAL); + SERIAL_ECHOPGM("PWM scale"); tmc_debug_loop(TMC_PWM_SCALE); + SERIAL_ECHOPGM("vsense\t"); tmc_debug_loop(TMC_VSENSE); + SERIAL_ECHOPGM("stealthChop"); tmc_debug_loop(TMC_STEALTHCHOP); + SERIAL_ECHOPGM("msteps\t"); tmc_debug_loop(TMC_MICROSTEPS); + SERIAL_ECHOPGM("tstep\t"); tmc_debug_loop(TMC_TSTEP); + SERIAL_ECHOPGM("pwm\nthreshold\t"); tmc_debug_loop(TMC_TPWMTHRS); + SERIAL_ECHOPGM("[mm/s]\t"); tmc_debug_loop(TMC_TPWMTHRS_MMS); + SERIAL_ECHOPGM("OT prewarn"); tmc_debug_loop(TMC_OTPW); + SERIAL_ECHOPGM("OT prewarn has\nbeen triggered"); tmc_debug_loop(TMC_OTPW_TRIGGERED); + SERIAL_ECHOPGM("off time\t"); tmc_debug_loop(TMC_TOFF); + SERIAL_ECHOPGM("blank time"); tmc_debug_loop(TMC_TBL); + SERIAL_ECHOPGM("hysterisis\n-end\t"); tmc_debug_loop(TMC_HEND); + SERIAL_ECHOPGM("-start\t"); tmc_debug_loop(TMC_HSTRT); + SERIAL_ECHOPGM("Stallguard thrs"); tmc_debug_loop(TMC_SGT); + + SERIAL_ECHOPGM("DRVSTATUS"); drv_status_loop(TMC_DRV_CODES); + #if ENABLED(HAVE_TMC2130) + SERIAL_ECHOPGM("stallguard\t"); drv_status_loop(TMC_STALLGUARD); + SERIAL_ECHOPGM("sg_result\t"); drv_status_loop(TMC_SG_RESULT); + SERIAL_ECHOPGM("fsactive\t"); drv_status_loop(TMC_FSACTIVE); + #endif + SERIAL_ECHOPGM("stst\t"); drv_status_loop(TMC_STST); + SERIAL_ECHOPGM("olb\t"); drv_status_loop(TMC_OLB); + SERIAL_ECHOPGM("ola\t"); drv_status_loop(TMC_OLA); + SERIAL_ECHOPGM("s2gb\t"); drv_status_loop(TMC_S2GB); + SERIAL_ECHOPGM("s2ga\t"); drv_status_loop(TMC_S2GA); + SERIAL_ECHOPGM("otpw\t"); drv_status_loop(TMC_DRV_OTPW); + SERIAL_ECHOPGM("ot\t"); drv_status_loop(TMC_OT); + #if ENABLED(HAVE_TMC2208) + SERIAL_ECHOPGM("157C\t"); drv_status_loop(TMC_T157); + SERIAL_ECHOPGM("150C\t"); drv_status_loop(TMC_T150); + SERIAL_ECHOPGM("143C\t"); drv_status_loop(TMC_T143); + SERIAL_ECHOPGM("120C\t"); drv_status_loop(TMC_T120); + SERIAL_ECHOPGM("s2vsa\t"); drv_status_loop(TMC_S2VSA); + SERIAL_ECHOPGM("s2vsb\t"); drv_status_loop(TMC_S2VSB); + #endif + SERIAL_ECHOLNPGM("Driver registers:");drv_status_loop(TMC_DRV_STATUS_HEX); + } + } + #endif + + template + static void tmc_get_current(TMC &st, const char name[]) { + SERIAL_ECHO(name); + SERIAL_ECHOPGM(" axis driver current: "); + SERIAL_ECHOLN(st.getCurrent()); + } + template + static void tmc_set_current(TMC &st, const char name[], const int mA) { + st.setCurrent(mA, R_SENSE, HOLD_MULTIPLIER); + tmc_get_current(st, name); } - #define M91x_USE(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) || (AXIS_DRIVER_TYPE(ST, TMC2208) && PIN_EXISTS(ST##_SERIAL_RX))) - #define M91x_USE_E(N) (E_STEPPERS > N && M91x_USE(E##N)) + template + static void tmc_report_otpw(TMC &st, const char name[]) { + SERIAL_ECHO(name); + SERIAL_ECHOPGM(" axis temperature prewarn triggered: "); + serialprintPGM(st.getOTPW() ? PSTR("true") : PSTR("false")); + SERIAL_EOL(); + } + template + static void tmc_clear_otpw(TMC &st, const char name[]) { + st.clear_otpw(); + SERIAL_ECHO(name); + SERIAL_ECHOLNPGM(" prewarn flag cleared"); + } + + template + static void tmc_get_pwmthrs(TMC &st, const char name[], const uint16_t spmm) { + SERIAL_ECHO(name); + SERIAL_ECHOPGM(" stealthChop max speed set to "); + SERIAL_ECHOLN(12650000UL * st.microsteps() / (256 * st.TPWMTHRS() * spmm)); + } + template + static void tmc_set_pwmthrs(TMC &st, const char name[], const int32_t thrs, const uint32_t spmm) { + st.TPWMTHRS(12650000UL * st.microsteps() / (256 * thrs * spmm)); + tmc_get_pwmthrs(st, name, spmm); + } + + template + static void tmc_get_sgt(TMC &st, const char name[]) { + SERIAL_ECHO(name); + SERIAL_ECHOPGM(" driver homing sensitivity set to "); + MYSERIAL.println(st.sgt(), DEC); + } + template + static void tmc_set_sgt(TMC &st, const char name[], const int8_t sgt_val) { + st.sgt(sgt_val); + tmc_get_sgt(st, name); + } + + /** + * M906: Set motor current in milliamps using axis codes X, Y, Z, E + * Report driver currents when no axis specified + */ + inline void gcode_M906() { + uint16_t values[XYZE]; + LOOP_XYZE(i) + values[i] = parser.intval(axis_codes[i]); + + #if X_IS_TRINAMIC + if (values[X_AXIS]) tmc_set_current(stepperX, extended_axis_codes[TMC_X], values[X_AXIS]); + else tmc_get_current(stepperX, extended_axis_codes[TMC_X]); + #endif + #if X2_IS_TRINAMIC + if (values[X_AXIS]) tmc_set_current(stepperX2, extended_axis_codes[TMC_X2], values[X_AXIS]); + else tmc_get_current(stepperX2, extended_axis_codes[TMC_X2]); + #endif + #if Y_IS_TRINAMIC + if (values[Y_AXIS]) tmc_set_current(stepperY, extended_axis_codes[TMC_Y], values[Y_AXIS]); + else tmc_get_current(stepperY, extended_axis_codes[TMC_Y]); + #endif + #if Y2_IS_TRINAMIC + if (values[Y_AXIS]) tmc_set_current(stepperY2, extended_axis_codes[TMC_Y2], values[Y_AXIS]); + else tmc_get_current(stepperY2, extended_axis_codes[TMC_Y2]); + #endif + #if Z_IS_TRINAMIC + if (values[Z_AXIS]) tmc_set_current(stepperZ, extended_axis_codes[TMC_Z], values[Z_AXIS]); + else tmc_get_current(stepperZ, extended_axis_codes[TMC_Z]); + #endif + #if Z2_IS_TRINAMIC + if (values[Z_AXIS]) tmc_set_current(stepperZ2, extended_axis_codes[TMC_Z2], values[Z_AXIS]); + else tmc_get_current(stepperZ2, extended_axis_codes[TMC_Z2]); + #endif + #if E0_IS_TRINAMIC + if (values[E_AXIS]) tmc_set_current(stepperE0, extended_axis_codes[TMC_E0], values[E_AXIS]); + else tmc_get_current(stepperE0, extended_axis_codes[TMC_E0]); + #endif + #if E1_IS_TRINAMIC + if (values[E_AXIS]) tmc_set_current(stepperE1, extended_axis_codes[TMC_E1], values[E_AXIS]); + else tmc_get_current(stepperE1, extended_axis_codes[TMC_E1]); + #endif + #if E2_IS_TRINAMIC + if (values[E_AXIS]) tmc_set_current(stepperE2, extended_axis_codes[TMC_E2], values[E_AXIS]); + else tmc_get_current(stepperE2, extended_axis_codes[TMC_E2]); + #endif + #if E3_IS_TRINAMIC + if (values[E_AXIS]) tmc_set_current(stepperE3, extended_axis_codes[TMC_E3], values[E_AXIS]); + else tmc_get_current(stepperE3, extended_axis_codes[TMC_E3]); + #endif + #if E4_IS_TRINAMIC + if (values[E_AXIS]) tmc_set_current(stepperE4, extended_axis_codes[TMC_E4], values[E_AXIS]); + else tmc_get_current(stepperE4, extended_axis_codes[TMC_E4]); + #endif + + } /** * M911: Report TMC stepper driver overtemperature pre-warn flag - * This flag is held by the library, persisting until cleared by M912 + * The flag is held by the library and persist until manually cleared by M912 */ inline void gcode_M911() { - #if M91x_USE(X) - tmc_report_otpw(stepperX, TMC_X); + #if ENABLED(X_IS_TMC2130) || (ENABLED(X_IS_TMC2208) && PIN_EXISTS(X_SERIAL_RX)) || ENABLED(IS_TRAMS) + tmc_report_otpw(stepperX, extended_axis_codes[TMC_X]); #endif - #if M91x_USE(X2) - tmc_report_otpw(stepperX2, TMC_X2); + #if ENABLED(Y_IS_TMC2130) || (ENABLED(Y_IS_TMC2208) && PIN_EXISTS(Y_SERIAL_RX)) || ENABLED(IS_TRAMS) + tmc_report_otpw(stepperY, extended_axis_codes[TMC_Y]); #endif - #if M91x_USE(Y) - tmc_report_otpw(stepperY, TMC_Y); + #if ENABLED(Z_IS_TMC2130) || (ENABLED(Z_IS_TMC2208) && PIN_EXISTS(Z_SERIAL_RX)) || ENABLED(IS_TRAMS) + tmc_report_otpw(stepperZ, extended_axis_codes[TMC_Z]); #endif - #if M91x_USE(Y2) - tmc_report_otpw(stepperY2, TMC_Y2); - #endif - #if M91x_USE(Z) - tmc_report_otpw(stepperZ, TMC_Z); - #endif - #if M91x_USE(Z2) - tmc_report_otpw(stepperZ2, TMC_Z2); - #endif - #if M91x_USE_E(0) - tmc_report_otpw(stepperE0, TMC_E0); - #endif - #if M91x_USE_E(1) - tmc_report_otpw(stepperE1, TMC_E1); - #endif - #if M91x_USE_E(2) - tmc_report_otpw(stepperE2, TMC_E2); - #endif - #if M91x_USE_E(3) - tmc_report_otpw(stepperE3, TMC_E3); - #endif - #if M91x_USE_E(4) - tmc_report_otpw(stepperE4, TMC_E4); + #if ENABLED(E0_IS_TMC2130) || (ENABLED(E0_IS_TMC2208) && PIN_EXISTS(E0_SERIAL_RX)) || ENABLED(IS_TRAMS) + tmc_report_otpw(stepperE0, extended_axis_codes[TMC_E0]); #endif } /** * M912: Clear TMC stepper driver overtemperature pre-warn flag held by the library - * Specify one or more axes with X, Y, Z, X1, Y1, Z1, X2, Y2, Z2, and E[index]. - * If no axes are given, clear all. - * - * Examples: - * M912 X ; clear X and X2 - * M912 X1 ; clear X1 only - * M912 X2 ; clear X2 only - * M912 X E ; clear X, X2, and all E - * M912 E1 ; clear E1 only */ inline void gcode_M912() { - const bool hasX = parser.seen(axis_codes[X_AXIS]), - hasY = parser.seen(axis_codes[Y_AXIS]), - hasZ = parser.seen(axis_codes[Z_AXIS]), - hasE = parser.seen(axis_codes[E_CART]), - hasNone = !hasX && !hasY && !hasZ && !hasE; - - #if M91x_USE(X) || M91x_USE(X2) - const uint8_t xval = parser.byteval(axis_codes[X_AXIS], 10); - #if M91x_USE(X) - if (hasNone || xval == 1 || (hasX && xval == 10)) tmc_clear_otpw(stepperX, TMC_X); - #endif - #if M91x_USE(X2) - if (hasNone || xval == 2 || (hasX && xval == 10)) tmc_clear_otpw(stepperX2, TMC_X2); - #endif + const bool clearX = parser.seen(axis_codes[X_AXIS]), clearY = parser.seen(axis_codes[Y_AXIS]), clearZ = parser.seen(axis_codes[Z_AXIS]), clearE = parser.seen(axis_codes[E_AXIS]), + clearAll = (!clearX && !clearY && !clearZ && !clearE) || (clearX && clearY && clearZ && clearE); + #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) || (ENABLED(X_IS_TMC2208) && PIN_EXISTS(X_SERIAL_RX)) + if (clearX || clearAll) tmc_clear_otpw(stepperX, extended_axis_codes[TMC_X]); + #endif + #if ENABLED(X2_IS_TMC2130) || (ENABLED(X2_IS_TMC2208) && PIN_EXISTS(X_SERIAL_RX)) + if (clearX || clearAll) tmc_clear_otpw(stepperX, extended_axis_codes[TMC_X]); #endif - #if M91x_USE(Y) || M91x_USE(Y2) - const uint8_t yval = parser.byteval(axis_codes[Y_AXIS], 10); - #if M91x_USE(Y) - if (hasNone || yval == 1 || (hasY && yval == 10)) tmc_clear_otpw(stepperY, TMC_Y); - #endif - #if M91x_USE(Y2) - if (hasNone || yval == 2 || (hasY && yval == 10)) tmc_clear_otpw(stepperY2, TMC_Y2); - #endif + #if ENABLED(Y_IS_TMC2130) || (ENABLED(Y_IS_TMC2208) && PIN_EXISTS(Y_SERIAL_RX)) + if (clearY || clearAll) tmc_clear_otpw(stepperY, extended_axis_codes[TMC_Y]); #endif - #if M91x_USE(Z) || M91x_USE(Z2) - const uint8_t zval = parser.byteval(axis_codes[Z_AXIS], 10); - #if M91x_USE(Z) - if (hasNone || zval == 1 || (hasZ && zval == 10)) tmc_clear_otpw(stepperZ, TMC_Z); - #endif - #if M91x_USE(Z2) - if (hasNone || zval == 2 || (hasZ && zval == 10)) tmc_clear_otpw(stepperZ2, TMC_Z2); - #endif + #if ENABLED(Z_IS_TMC2130) || (ENABLED(Z_IS_TMC2208) && PIN_EXISTS(Z_SERIAL_RX)) + if (clearZ || clearAll) tmc_clear_otpw(stepperZ, extended_axis_codes[TMC_Z]); #endif - // TODO: If this is a Hangprinter, E_AXIS will not correspond to E0, E1, etc in this way - #if M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) - const uint8_t eval = parser.byteval(axis_codes[E_AXIS], 10); - #if M91x_USE_E(0) - if (hasNone || eval == 0 || (hasE && eval == 10)) tmc_clear_otpw(stepperE0, TMC_E0); - #endif - #if M91x_USE_E(1) - if (hasNone || eval == 1 || (hasE && eval == 10)) tmc_clear_otpw(stepperE1, TMC_E1); - #endif - #if M91x_USE_E(2) - if (hasNone || eval == 2 || (hasE && eval == 10)) tmc_clear_otpw(stepperE2, TMC_E2); - #endif - #if M91x_USE_E(3) - if (hasNone || eval == 3 || (hasE && eval == 10)) tmc_clear_otpw(stepperE3, TMC_E3); - #endif - #if M91x_USE_E(4) - if (hasNone || eval == 4 || (hasE && eval == 10)) tmc_clear_otpw(stepperE4, TMC_E4); - #endif + #if ENABLED(E0_IS_TMC2130) || (ENABLED(E0_IS_TMC2208) && PIN_EXISTS(E0_SERIAL_RX)) + if (clearE || clearAll) tmc_clear_otpw(stepperE0, extended_axis_codes[TMC_E0]); #endif } @@ -11686,98 +10716,57 @@ inline void gcode_M502() { */ #if ENABLED(HYBRID_THRESHOLD) inline void gcode_M913() { - #define TMC_SAY_PWMTHRS(A,Q) tmc_get_pwmthrs(stepper##Q, TMC_##Q, planner.axis_steps_per_mm[_AXIS(A)]) - #define TMC_SET_PWMTHRS(A,Q) tmc_set_pwmthrs(stepper##Q, value, planner.axis_steps_per_mm[_AXIS(A)]) - #define TMC_SAY_PWMTHRS_E(E) do{ const uint8_t extruder = E; tmc_get_pwmthrs(stepperE##E, TMC_E##E, planner.axis_steps_per_mm[E_AXIS_N]); }while(0) - #define TMC_SET_PWMTHRS_E(E) do{ const uint8_t extruder = E; tmc_set_pwmthrs(stepperE##E, value, planner.axis_steps_per_mm[E_AXIS_N]); }while(0) + uint16_t values[XYZE]; + LOOP_XYZE(i) + values[i] = parser.intval(axis_codes[i]); - bool report = true; - const uint8_t index = parser.byteval('I'); - LOOP_XYZE(i) if (int32_t value = parser.longval(axis_codes[i])) { - report = false; - switch (i) { - case X_AXIS: - #if AXIS_HAS_STEALTHCHOP(X) - if (index < 2) TMC_SET_PWMTHRS(X,X); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - if (!(index & 1)) TMC_SET_PWMTHRS(X,X2); - #endif - break; - case Y_AXIS: - #if AXIS_HAS_STEALTHCHOP(Y) - if (index < 2) TMC_SET_PWMTHRS(Y,Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2); - #endif - break; - case Z_AXIS: - #if AXIS_HAS_STEALTHCHOP(Z) - if (index < 2) TMC_SET_PWMTHRS(Z,Z); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - if (!(index & 1)) TMC_SET_PWMTHRS(Z,Z2); - #endif - break; - case E_CART: { - if (get_target_extruder_from_command(913)) return; - switch (target_extruder) { - #if AXIS_HAS_STEALTHCHOP(E0) - case 0: TMC_SET_PWMTHRS_E(0); break; - #endif - #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1) - case 1: TMC_SET_PWMTHRS_E(1); break; - #endif - #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2) - case 2: TMC_SET_PWMTHRS_E(2); break; - #endif - #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3) - case 3: TMC_SET_PWMTHRS_E(3); break; - #endif - #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4) - case 4: TMC_SET_PWMTHRS_E(4); break; - #endif - } - } break; - } - } + #if X_IS_TRINAMIC + if (values[X_AXIS]) tmc_set_pwmthrs(stepperX, extended_axis_codes[TMC_X], values[X_AXIS], planner.axis_steps_per_mm[X_AXIS]); + else tmc_get_pwmthrs(stepperX, extended_axis_codes[TMC_X], planner.axis_steps_per_mm[X_AXIS]); + #endif + #if X2_IS_TRINAMIC + if (values[X_AXIS]) tmc_set_pwmthrs(stepperX2, extended_axis_codes[TMC_X2], values[X_AXIS], planner.axis_steps_per_mm[X_AXIS]); + else tmc_get_pwmthrs(stepperX, extended_axis_codes[TMC_X2], planner.axis_steps_per_mm[X_AXIS]); + #endif - if (report) { - #if AXIS_HAS_STEALTHCHOP(X) - TMC_SAY_PWMTHRS(X,X); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - TMC_SAY_PWMTHRS(X,X2); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - TMC_SAY_PWMTHRS(Y,Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_SAY_PWMTHRS(Y,Y2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - TMC_SAY_PWMTHRS(Z,Z); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_SAY_PWMTHRS(Z,Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - TMC_SAY_PWMTHRS_E(0); - #endif - #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1) - TMC_SAY_PWMTHRS_E(1); - #endif - #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2) - TMC_SAY_PWMTHRS_E(2); - #endif - #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3) - TMC_SAY_PWMTHRS_E(3); - #endif - #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4) - TMC_SAY_PWMTHRS_E(4); - #endif - } + #if Y_IS_TRINAMIC + if (values[Y_AXIS]) tmc_set_pwmthrs(stepperY, extended_axis_codes[TMC_Y], values[Y_AXIS], planner.axis_steps_per_mm[Y_AXIS]); + else tmc_get_pwmthrs(stepperY, extended_axis_codes[TMC_Y], planner.axis_steps_per_mm[Y_AXIS]); + #endif + #if Y2_IS_TRINAMIC + if (values[Y_AXIS]) tmc_set_pwmthrs(stepperY2, extended_axis_codes[TMC_Y2], values[Y_AXIS], planner.axis_steps_per_mm[Y_AXIS]); + else tmc_get_pwmthrs(stepperY, extended_axis_codes[TMC_Y2], planner.axis_steps_per_mm[Y_AXIS]); + #endif + + #if Z_IS_TRINAMIC + if (values[Z_AXIS]) tmc_set_pwmthrs(stepperZ, extended_axis_codes[TMC_Z], values[Z_AXIS], planner.axis_steps_per_mm[Z_AXIS]); + else tmc_get_pwmthrs(stepperZ, extended_axis_codes[TMC_Z], planner.axis_steps_per_mm[Z_AXIS]); + #endif + #if Z2_IS_TRINAMIC + if (values[Z_AXIS]) tmc_set_pwmthrs(stepperZ2, extended_axis_codes[TMC_Z2], values[Z_AXIS], planner.axis_steps_per_mm[Z_AXIS]); + else tmc_get_pwmthrs(stepperZ, extended_axis_codes[TMC_Z2], planner.axis_steps_per_mm[Z_AXIS]); + #endif + + #if E0_IS_TRINAMIC + if (values[E_AXIS]) tmc_set_pwmthrs(stepperE0, extended_axis_codes[TMC_E0], values[E_AXIS], planner.axis_steps_per_mm[E_AXIS]); + else tmc_get_pwmthrs(stepperE0, extended_axis_codes[TMC_E0], planner.axis_steps_per_mm[E_AXIS]); + #endif + #if E1_IS_TRINAMIC + if (values[E_AXIS]) tmc_set_pwmthrs(stepperE1, extended_axis_codes[TMC_E1], values[E_AXIS], planner.axis_steps_per_mm[E_AXIS]); + else tmc_get_pwmthrs(stepperE1, extended_axis_codes[TMC_E1], planner.axis_steps_per_mm[E_AXIS]); + #endif + #if E2_IS_TRINAMIC + if (values[E_AXIS]) tmc_set_pwmthrs(stepperE2, extended_axis_codes[TMC_E2], values[E_AXIS], planner.axis_steps_per_mm[E_AXIS]); + else tmc_get_pwmthrs(stepperE2, extended_axis_codes[TMC_E2], planner.axis_steps_per_mm[E_AXIS]); + #endif + #if E3_IS_TRINAMIC + if (values[E_AXIS]) tmc_set_pwmthrs(stepperE3, extended_axis_codes[TMC_E3], values[E_AXIS], planner.axis_steps_per_mm[E_AXIS]); + else tmc_get_pwmthrs(stepperE3, extended_axis_codes[TMC_E3], planner.axis_steps_per_mm[E_AXIS]); + #endif + #if E4_IS_TRINAMIC + if (values[E_AXIS]) tmc_set_pwmthrs(stepperE4, extended_axis_codes[TMC_E4], values[E_AXIS], planner.axis_steps_per_mm[E_AXIS]); + else tmc_get_pwmthrs(stepperE4, extended_axis_codes[TMC_E4], planner.axis_steps_per_mm[E_AXIS]); + #endif } #endif // HYBRID_THRESHOLD @@ -11786,117 +10775,57 @@ inline void gcode_M502() { */ #if ENABLED(SENSORLESS_HOMING) inline void gcode_M914() { - #define TMC_SAY_SGT(Q) tmc_get_sgt(stepper##Q, TMC_##Q) - #define TMC_SET_SGT(Q) tmc_set_sgt(stepper##Q, value) - - bool report = true; - const uint8_t index = parser.byteval('I'); - LOOP_XYZ(i) if (parser.seen(axis_codes[i])) { - const int8_t value = (int8_t)constrain(parser.value_int(), -64, 63); - report = false; - switch (i) { - #if X_SENSORLESS - case X_AXIS: - #if AXIS_HAS_STALLGUARD(X) - if (index < 2) TMC_SET_SGT(X); - #endif - #if AXIS_HAS_STALLGUARD(X2) - if (!(index & 1)) TMC_SET_SGT(X2); - #endif - break; - #endif - #if Y_SENSORLESS - case Y_AXIS: - #if AXIS_HAS_STALLGUARD(Y) - if (index < 2) TMC_SET_SGT(Y); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - if (!(index & 1)) TMC_SET_SGT(Y2); - #endif - break; - #endif - #if Z_SENSORLESS - case Z_AXIS: - #if AXIS_HAS_STALLGUARD(Z) - if (index < 2) TMC_SET_SGT(Z); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - if (!(index & 1)) TMC_SET_SGT(Z2); - #endif - break; - #endif - } - } - - if (report) { - #if X_SENSORLESS - #if AXIS_HAS_STALLGUARD(X) - TMC_SAY_SGT(X); - #endif - #if AXIS_HAS_STALLGUARD(X2) - TMC_SAY_SGT(X2); - #endif - #endif - #if Y_SENSORLESS - #if AXIS_HAS_STALLGUARD(Y) - TMC_SAY_SGT(Y); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - TMC_SAY_SGT(Y2); - #endif - #endif - #if Z_SENSORLESS - #if AXIS_HAS_STALLGUARD(Z) - TMC_SAY_SGT(Z); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - TMC_SAY_SGT(Z2); - #endif - #endif - } + #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) + if (parser.seen(axis_codes[X_AXIS])) tmc_set_sgt(stepperX, extended_axis_codes[TMC_X], parser.value_int()); + else tmc_get_sgt(stepperX, extended_axis_codes[TMC_X]); + #endif + #if ENABLED(X2_IS_TMC2130) + if (parser.seen(axis_codes[X_AXIS])) tmc_set_sgt(stepperX2, extended_axis_codes[TMC_X2], parser.value_int()); + else tmc_get_sgt(stepperX2, extended_axis_codes[TMC_X2]); + #endif + #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS) + if (parser.seen(axis_codes[Y_AXIS])) tmc_set_sgt(stepperY, extended_axis_codes[TMC_Y], parser.value_int()); + else tmc_get_sgt(stepperY, extended_axis_codes[TMC_Y]); + #endif + #if ENABLED(Y2_IS_TMC2130) + if (parser.seen(axis_codes[Y_AXIS])) tmc_set_sgt(stepperY2, extended_axis_codes[TMC_Y2], parser.value_int()); + else tmc_get_sgt(stepperY2, extended_axis_codes[TMC_Y2]); + #endif } #endif // SENSORLESS_HOMING /** * TMC Z axis calibration routine */ - #if ENABLED(TMC_Z_CALIBRATION) + #if ENABLED(TMC_Z_CALIBRATION) && (Z_IS_TRINAMIC || Z2_IS_TRINAMIC) inline void gcode_M915() { - const uint16_t _rms = parser.seenval('S') ? parser.value_int() : CALIBRATION_CURRENT, - _z = parser.seenval('Z') ? parser.value_linear_units() : CALIBRATION_EXTRA_HEIGHT; + uint16_t _rms = parser.seenval('S') ? parser.value_int() : CALIBRATION_CURRENT; + uint16_t _z = parser.seenval('Z') ? parser.value_int() : CALIBRATION_EXTRA_HEIGHT; - if (!TEST(axis_known_position, Z_AXIS)) { + if (!axis_known_position[Z_AXIS]) { SERIAL_ECHOLNPGM("\nPlease home Z axis first"); return; } - #if AXIS_IS_TMC(Z) - const uint16_t Z_current_1 = stepperZ.getCurrent(); - stepperZ.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER); - #endif - #if AXIS_IS_TMC(Z2) - const uint16_t Z2_current_1 = stepperZ2.getCurrent(); - stepperZ2.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER); - #endif + uint16_t Z_current_1 = stepperZ.getCurrent(); + uint16_t Z2_current_1 = stepperZ.getCurrent(); + stepperZ.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER); + stepperZ2.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER); SERIAL_ECHOPAIR("\nCalibration current: Z", _rms); soft_endstops_enabled = false; do_blocking_move_to_z(Z_MAX_POS+_z); - #if AXIS_IS_TMC(Z) - stepperZ.setCurrent(Z_current_1, R_SENSE, HOLD_MULTIPLIER); - #endif - #if AXIS_IS_TMC(Z2) - stepperZ2.setCurrent(Z2_current_1, R_SENSE, HOLD_MULTIPLIER); - #endif + stepperZ.setCurrent(Z_current_1, R_SENSE, HOLD_MULTIPLIER); + stepperZ2.setCurrent(Z2_current_1, R_SENSE, HOLD_MULTIPLIER); do_blocking_move_to_z(Z_MAX_POS); soft_endstops_enabled = true; - SERIAL_ECHOLNPGM("\nHoming Z due to lost steps"); - enqueue_and_echo_commands_P(PSTR("G28 Z")); + SERIAL_ECHOLNPGM("\nHoming Z because we lost steps"); + home_z_safely(); } #endif @@ -12003,44 +10932,26 @@ inline void gcode_M907() { #endif // HAS_MICROSTEPS #if HAS_CASE_LIGHT - #ifndef INVERT_CASE_LIGHT #define INVERT_CASE_LIGHT false #endif uint8_t case_light_brightness; // LCD routine wants INT bool case_light_on; - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - LEDColor case_light_color = - #ifdef CASE_LIGHT_NEOPIXEL_COLOR - CASE_LIGHT_NEOPIXEL_COLOR - #else - { 255, 255, 255, 255 } - #endif - ; - #endif - void update_case_light() { - const uint8_t i = case_light_on ? case_light_brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i; - - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - - leds.set_color( - MakeLEDColor(case_light_color.r, case_light_color.g, case_light_color.b, case_light_color.w, n10ct), - false - ); - - #else // !CASE_LIGHT_USE_NEOPIXEL - - SET_OUTPUT(CASE_LIGHT_PIN); + pinMode(CASE_LIGHT_PIN, OUTPUT); // digitalWrite doesn't set the port mode + if (case_light_on) { if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) - analogWrite(CASE_LIGHT_PIN, n10ct); - else { - const bool s = case_light_on ? !INVERT_CASE_LIGHT : INVERT_CASE_LIGHT; - WRITE(CASE_LIGHT_PIN, s ? HIGH : LOW); - } - - #endif // !CASE_LIGHT_USE_NEOPIXEL + analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 - case_light_brightness : case_light_brightness); + else + WRITE(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? LOW : HIGH); + } + else { + if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) + analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 : 0); + else + WRITE(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? HIGH : LOW); + } } #endif // HAS_CASE_LIGHT @@ -12066,11 +10977,11 @@ inline void gcode_M355() { // always report case light status SERIAL_ECHO_START(); if (!case_light_on) { - SERIAL_ECHOLNPGM("Case light: off"); + SERIAL_ECHOLN("Case light: off"); } else { - if (!USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) SERIAL_ECHOLNPGM("Case light: on"); - else SERIAL_ECHOLNPAIR("Case light: ", int(case_light_brightness)); + if (!USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) SERIAL_ECHOLN("Case light: on"); + else SERIAL_ECHOLNPAIR("Case light: ", (int)case_light_brightness); } #else @@ -12084,39 +10995,44 @@ inline void gcode_M355() { /** * M163: Set a single mix factor for a mixing extruder * This is called "weight" by some systems. - * The 'P' values must sum to 1.0 or must be followed by M164 to normalize them. * * S[index] The channel index to set * P[float] The mix value + * */ inline void gcode_M163() { const int mix_index = parser.intval('S'); - if (mix_index < MIXING_STEPPERS) - mixing_factor[mix_index] = MAX(parser.floatval('P'), 0.0); + if (mix_index < MIXING_STEPPERS) { + float mix_value = parser.floatval('P'); + NOLESS(mix_value, 0.0); + mixing_factor[mix_index] = RECIPROCAL(mix_value); + } } - /** - * M164: Normalize and commit the mix. - * If 'S' is given store as a virtual tool. (Requires MIXING_VIRTUAL_TOOLS > 1) - * - * S[index] The virtual tool to store - */ - inline void gcode_M164() { - normalize_mix(); - #if MIXING_VIRTUAL_TOOLS > 1 - const int tool_index = parser.intval('S', -1); - if (WITHIN(tool_index, 0, MIXING_VIRTUAL_TOOLS - 1)) { + #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() { + const int tool_index = parser.intval('S'); + 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 - } + } + + #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 should sum to 1.0, but they will be normalized regardless. + * 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 @@ -12124,6 +11040,7 @@ inline void gcode_M355() { * 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 @@ -12147,10 +11064,10 @@ inline void gcode_M999() { if (parser.boolval('S')) return; // gcode_LastN = Stopped_gcode_LastN; - flush_and_request_resend(); + FlushSerialRequestResend(); } -#if DO_SWITCH_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) #if EXTRUDERS > 3 #define REQ_ANGLES 4 #define _SERVO_NR (e < 2 ? SWITCHING_EXTRUDER_SERVO_NR : SWITCHING_EXTRUDER_E23_SERVO_NR) @@ -12161,7 +11078,7 @@ inline void gcode_M999() { inline void move_extruder_servo(const uint8_t e) { constexpr int16_t angles[] = SWITCHING_EXTRUDER_SERVO_ANGLES; static_assert(COUNT(angles) == REQ_ANGLES, "SWITCHING_EXTRUDER_SERVO_ANGLES needs " STRINGIFY(REQ_ANGLES) " angles."); - planner.synchronize(); + stepper.synchronize(); #if EXTRUDERS & 1 if (e < EXTRUDERS - 1) #endif @@ -12170,12 +11087,12 @@ inline void gcode_M999() { safe_delay(500); } } -#endif // DO_SWITCH_EXTRUDER +#endif // SWITCHING_EXTRUDER #if ENABLED(SWITCHING_NOZZLE) inline void move_nozzle_servo(const uint8_t e) { const int16_t angles[2] = SWITCHING_NOZZLE_SERVO_ANGLES; - planner.synchronize(); + stepper.synchronize(); MOVE_SERVO(SWITCHING_NOZZLE_SERVO_NR, angles[e]); safe_delay(500); } @@ -12186,7 +11103,7 @@ inline void invalid_extruder_error(const uint8_t e) { SERIAL_CHAR('T'); SERIAL_ECHO_F(e, DEC); SERIAL_CHAR(' '); - SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER); + SERIAL_ECHOLN(MSG_INVALID_EXTRUDER); } #if ENABLED(PARKING_EXTRUDER) @@ -12238,254 +11155,18 @@ inline void invalid_extruder_error(const uint8_t e) { #endif // HAS_FANMUX /** - * Tool Change functions + * Perform a tool-change, which may result in moving the + * previous tool out of the way and the new tool into place. */ +void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool no_move/*=false*/) { + #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 -#if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - - inline void mixing_tool_change(const uint8_t tmp_extruder) { if (tmp_extruder >= MIXING_VIRTUAL_TOOLS) return invalid_extruder_error(tmp_extruder); // 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]; - } - -#endif // MIXING_EXTRUDER && MIXING_VIRTUAL_TOOLS > 1 - -#if ENABLED(DUAL_X_CARRIAGE) - - inline void dualx_tool_change(const uint8_t tmp_extruder, bool &no_move) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("Dual X Carriage Mode "); - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: SERIAL_ECHOLNPGM("DXC_FULL_CONTROL_MODE"); break; - case DXC_AUTO_PARK_MODE: SERIAL_ECHOLNPGM("DXC_AUTO_PARK_MODE"); break; - case DXC_DUPLICATION_MODE: SERIAL_ECHOLNPGM("DXC_DUPLICATION_MODE"); break; - } - } - #endif - - const float xhome = x_home_pos(active_extruder); - if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE - && IsRunning() - && (delayed_move_time || current_position[X_AXIS] != xhome) - ) { - float raised_z = current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT; - #if ENABLED(MAX_SOFTWARE_ENDSTOPS) - NOMORE(raised_z, soft_endstop_max[Z_AXIS]); - #endif - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPAIR("Raise to ", raised_z); - SERIAL_ECHOLNPAIR("MoveX to ", xhome); - SERIAL_ECHOLNPAIR("Lower to ", current_position[Z_AXIS]); - } - #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] : xhome, - current_position[Y_AXIS], - i == 2 ? current_position[Z_AXIS] : raised_z, - current_position[E_CART], - planner.max_feedrate_mm_s[i == 1 ? X_AXIS : Z_AXIS], - active_extruder - ); - planner.synchronize(); - } - - // Apply Y & Z extruder offset (X offset is used as home pos with Dual X) - 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]; - - // Activate the new extruder ahead of calling set_axis_is_at_home! - 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); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("New Extruder", current_position); - #endif - - // Only when auto-parking are carriages safe to move - if (dual_x_carriage_mode != DXC_AUTO_PARK_MODE) no_move = true; - - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: - // New current position is the position of the activated extruder - current_position[X_AXIS] = inactive_extruder_x_pos; - // Save the inactive extruder's position (from the old current_position) - inactive_extruder_x_pos = destination[X_AXIS]; - break; - case DXC_AUTO_PARK_MODE: - // record raised toolhead position for use by unpark - COPY(raised_parked_position, current_position); - raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT; - #if ENABLED(MAX_SOFTWARE_ENDSTOPS) - NOMORE(raised_parked_position[Z_AXIS], soft_endstop_max[Z_AXIS]); - #endif - active_extruder_parked = true; - delayed_move_time = 0; - break; - case DXC_DUPLICATION_MODE: - // If the new extruder is the left one, set it "parked" - // This triggers the second extruder to move into the duplication position - active_extruder_parked = (active_extruder == 0); - current_position[X_AXIS] = active_extruder_parked ? inactive_extruder_x_pos : destination[X_AXIS] + duplicate_extruder_x_offset; - inactive_extruder_x_pos = destination[X_AXIS]; - extruder_duplication_enabled = false; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPAIR("Set inactive_extruder_x_pos=", inactive_extruder_x_pos); - SERIAL_ECHOLNPGM("Clear extruder_duplication_enabled"); - } - #endif - break; - } - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); - DEBUG_POS("New extruder (parked)", current_position); - } - #endif - - // No extra case for HAS_ABL in DUAL_X_CARRIAGE. Does that mean they don't work together? - } - -#endif // DUAL_X_CARRIAGE - -#if ENABLED(PARKING_EXTRUDER) - - inline void parking_extruder_tool_change(const uint8_t tmp_extruder, bool no_move) { - constexpr float z_raise = PARKING_EXTRUDER_SECURITY_RAISE; - - if (!no_move) { - - const float parkingposx[] = PARKING_EXTRUDER_PARKING_X, - midpos = (parkingposx[0] + parkingposx[1]) * 0.5 + hotend_offset[X_AXIS][active_extruder], - grabpos = parkingposx[tmp_extruder] + hotend_offset[X_AXIS][active_extruder] - + (tmp_extruder == 0 ? -(PARKING_EXTRUDER_GRAB_DISTANCE) : PARKING_EXTRUDER_GRAB_DISTANCE); - /** - * Steps: - * 1. Raise Z-Axis to give enough clearance - * 2. Move to park position of old extruder - * 3. Disengage magnetic field, wait for delay - * 4. Move near new extruder - * 5. Engage magnetic field for new extruder - * 6. Move to parking incl. offset of new extruder - * 7. Lower Z-Axis - */ - - // STEP 1 - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("Starting Autopark"); - if (DEBUGGING(LEVELING)) DEBUG_POS("current position:", current_position); - #endif - current_position[Z_AXIS] += z_raise; - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(1) Raise Z-Axis "); - if (DEBUGGING(LEVELING)) DEBUG_POS("Moving to Raised Z-Position", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder); - planner.synchronize(); - - // STEP 2 - current_position[X_AXIS] = parkingposx[active_extruder] + hotend_offset[X_AXIS][active_extruder]; - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPAIR("(2) Park extruder ", active_extruder); - if (DEBUGGING(LEVELING)) DEBUG_POS("Moving ParkPos", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); - planner.synchronize(); - - // STEP 3 - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(3) Disengage magnet "); - #endif - pe_deactivate_magnet(active_extruder); - - // STEP 4 - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(4) Move to position near new extruder"); - #endif - current_position[X_AXIS] += (active_extruder == 0 ? 10 : -10); // move 10mm away from parked extruder - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("Moving away from parked extruder", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); - planner.synchronize(); - - // STEP 5 - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(5) Engage magnetic field"); - #endif - - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - pe_activate_magnet(active_extruder); //just save power for inverted magnets - #endif - pe_activate_magnet(tmp_extruder); - - // STEP 6 - current_position[X_AXIS] = grabpos + (tmp_extruder == 0 ? (+10) : (-10)); - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); - current_position[X_AXIS] = grabpos; - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPAIR("(6) Unpark extruder ", tmp_extruder); - if (DEBUGGING(LEVELING)) DEBUG_POS("Move UnparkPos", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS]/2, active_extruder); - planner.synchronize(); - - // Step 7 - current_position[X_AXIS] = midpos - hotend_offset[X_AXIS][tmp_extruder]; - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(7) Move midway between hotends"); - if (DEBUGGING(LEVELING)) DEBUG_POS("Move midway to new extruder", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); - planner.synchronize(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("Autopark done."); - #endif - } - else { // nomove == true - // Only engage magnetic field for new extruder - pe_activate_magnet(tmp_extruder); - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - pe_activate_magnet(active_extruder); // Just save power for inverted magnets - #endif - } - current_position[Z_AXIS] += hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("Applying Z-offset", current_position); - #endif - } - -#endif // PARKING_EXTRUDER - -/** - * Perform a tool-change, which may result in moving the - * previous tool out of the way and the new tool into place. - */ -void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool no_move/*=false*/) { - planner.synchronize(); - - #if HAS_LEVELING - // Set current position to the physical position - const bool leveling_was_active = planner.leveling_active; - set_bed_leveling_enabled(false); - #endif - - #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - - mixing_tool_change(tmp_extruder); #else // !MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1 @@ -12506,88 +11187,350 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n #endif } + // Save current position to destination, for use later + set_destination_from_current(); + #if ENABLED(DUAL_X_CARRIAGE) - #if HAS_SOFTWARE_ENDSTOPS - // Update the X software endstops early - active_extruder = tmp_extruder; - update_software_endstops(X_AXIS); - active_extruder = !tmp_extruder; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPGM("Dual X Carriage Mode "); + switch (dual_x_carriage_mode) { + case DXC_FULL_CONTROL_MODE: SERIAL_ECHOLNPGM("DXC_FULL_CONTROL_MODE"); break; + case DXC_AUTO_PARK_MODE: SERIAL_ECHOLNPGM("DXC_AUTO_PARK_MODE"); break; + case DXC_DUPLICATION_MODE: SERIAL_ECHOLNPGM("DXC_DUPLICATION_MODE"); break; + } + } #endif - // Don't move the new extruder out of bounds - if (!WITHIN(current_position[X_AXIS], soft_endstop_min[X_AXIS], soft_endstop_max[X_AXIS])) - no_move = true; + const float xhome = x_home_pos(active_extruder); + if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE + && IsRunning() + && (delayed_move_time || current_position[X_AXIS] != xhome) + ) { + float raised_z = current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT; + #if ENABLED(MAX_SOFTWARE_ENDSTOPS) + NOMORE(raised_z, soft_endstop_max[Z_AXIS]); + #endif + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOLNPAIR("Raise to ", raised_z); + SERIAL_ECHOLNPAIR("MoveX to ", xhome); + SERIAL_ECHOLNPAIR("Lower to ", current_position[Z_AXIS]); + } + #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] : xhome, + current_position[Y_AXIS], + i == 2 ? current_position[Z_AXIS] : raised_z, + current_position[E_AXIS], + planner.max_feedrate_mm_s[i == 1 ? X_AXIS : Z_AXIS], + active_extruder + ); + stepper.synchronize(); + } - if (!no_move) set_destination_from_current(); - dualx_tool_change(tmp_extruder, no_move); // Can modify no_move + // Apply Y & Z extruder offset (X offset is used as home pos with Dual X) + 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]; + + // Activate the new extruder ahead of calling set_axis_is_at_home! + 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); + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("New Extruder", current_position); + #endif + + // Only when auto-parking are carriages safe to move + if (dual_x_carriage_mode != DXC_AUTO_PARK_MODE) no_move = true; + + switch (dual_x_carriage_mode) { + case DXC_FULL_CONTROL_MODE: + // New current position is the position of the activated extruder + current_position[X_AXIS] = inactive_extruder_x_pos; + // Save the inactive extruder's position (from the old current_position) + inactive_extruder_x_pos = destination[X_AXIS]; + break; + case DXC_AUTO_PARK_MODE: + // record raised toolhead position for use by unpark + COPY(raised_parked_position, current_position); + raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT; + #if ENABLED(MAX_SOFTWARE_ENDSTOPS) + NOMORE(raised_parked_position[Z_AXIS], soft_endstop_max[Z_AXIS]); + #endif + active_extruder_parked = true; + delayed_move_time = 0; + break; + case DXC_DUPLICATION_MODE: + // If the new extruder is the left one, set it "parked" + // This triggers the second extruder to move into the duplication position + active_extruder_parked = (active_extruder == 0); + + 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; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOLNPAIR("Set inactive_extruder_x_pos=", inactive_extruder_x_pos); + SERIAL_ECHOLNPGM("Clear extruder_duplication_enabled"); + } + #endif + break; + } + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOLNPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); + DEBUG_POS("New extruder (parked)", current_position); + } + #endif + + // No extra case for HAS_ABL in DUAL_X_CARRIAGE. Does that mean they don't work together? #else // !DUAL_X_CARRIAGE - set_destination_from_current(); + #if ENABLED(PARKING_EXTRUDER) // Dual Parking extruder + const float z_diff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; + float z_raise = PARKING_EXTRUDER_SECURITY_RAISE; + if (!no_move) { - #if ENABLED(PARKING_EXTRUDER) - parking_extruder_tool_change(tmp_extruder, no_move); - #endif + const float parkingposx[] = PARKING_EXTRUDER_PARKING_X, + midpos = (parkingposx[0] + parkingposx[1]) * 0.5 + hotend_offset[X_AXIS][active_extruder], + grabpos = parkingposx[tmp_extruder] + hotend_offset[X_AXIS][active_extruder] + + (tmp_extruder == 0 ? -(PARKING_EXTRUDER_GRAB_DISTANCE) : PARKING_EXTRUDER_GRAB_DISTANCE); + /** + * Steps: + * 1. Raise Z-Axis to give enough clearance + * 2. Move to park position of old extruder + * 3. Disengage magnetic field, wait for delay + * 4. Move near new extruder + * 5. Engage magnetic field for new extruder + * 6. Move to parking incl. offset of new extruder + * 7. Lower Z-Axis + */ + + // STEP 1 + #if ENABLED(DEBUG_LEVELING_FEATURE) + SERIAL_ECHOLNPGM("Starting Autopark"); + if (DEBUGGING(LEVELING)) DEBUG_POS("current position:", current_position); + #endif + current_position[Z_AXIS] += z_raise; + #if ENABLED(DEBUG_LEVELING_FEATURE) + SERIAL_ECHOLNPGM("(1) Raise Z-Axis "); + if (DEBUGGING(LEVELING)) DEBUG_POS("Moving to Raised Z-Position", current_position); + #endif + planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder); + stepper.synchronize(); + + // STEP 2 + current_position[X_AXIS] = parkingposx[active_extruder] + hotend_offset[X_AXIS][active_extruder]; + #if ENABLED(DEBUG_LEVELING_FEATURE) + SERIAL_ECHOLNPAIR("(2) Park extruder ", active_extruder); + if (DEBUGGING(LEVELING)) DEBUG_POS("Moving ParkPos", current_position); + #endif + planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); + stepper.synchronize(); + + // STEP 3 + #if ENABLED(DEBUG_LEVELING_FEATURE) + SERIAL_ECHOLNPGM("(3) Disengage magnet "); + #endif + pe_deactivate_magnet(active_extruder); + + // STEP 4 + #if ENABLED(DEBUG_LEVELING_FEATURE) + SERIAL_ECHOLNPGM("(4) Move to position near new extruder"); + #endif + current_position[X_AXIS] += (active_extruder == 0 ? 10 : -10); // move 10mm away from parked extruder + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("Moving away from parked extruder", current_position); + #endif + planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); + stepper.synchronize(); + + // STEP 5 + #if ENABLED(DEBUG_LEVELING_FEATURE) + SERIAL_ECHOLNPGM("(5) Engage magnetic field"); + #endif + + #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) + pe_activate_magnet(active_extruder); //just save power for inverted magnets + #endif + pe_activate_magnet(tmp_extruder); + + // STEP 6 + current_position[X_AXIS] = grabpos + (tmp_extruder == 0 ? (+10) : (-10)); + planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); + current_position[X_AXIS] = grabpos; + #if ENABLED(DEBUG_LEVELING_FEATURE) + SERIAL_ECHOLNPAIR("(6) Unpark extruder ", tmp_extruder); + if (DEBUGGING(LEVELING)) DEBUG_POS("Move UnparkPos", current_position); + #endif + planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS]/2, active_extruder); + stepper.synchronize(); + + // Step 7 + current_position[X_AXIS] = midpos - hotend_offset[X_AXIS][tmp_extruder]; + #if ENABLED(DEBUG_LEVELING_FEATURE) + SERIAL_ECHOLNPGM("(7) Move midway between hotends"); + if (DEBUGGING(LEVELING)) DEBUG_POS("Move midway to new extruder", current_position); + #endif + planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); + stepper.synchronize(); + #if ENABLED(DEBUG_LEVELING_FEATURE) + SERIAL_ECHOLNPGM("Autopark done."); + #endif + } + else { // nomove == true + // Only engage magnetic field for new extruder + pe_activate_magnet(tmp_extruder); + #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) + pe_activate_magnet(active_extruder); // Just save power for inverted magnets + #endif + } + current_position[Z_AXIS] -= hotend_offset[Z_AXIS][tmp_extruder] - hotend_offset[Z_AXIS][active_extruder]; // Apply Zoffset + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("Applying Z-offset", current_position); + #endif + + #endif // dualParking extruder #if ENABLED(SWITCHING_NOZZLE) - // Always raise by at least 1 to avoid workpiece - const float zdiff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; - current_position[Z_AXIS] += (zdiff > 0.0 ? zdiff : 0.0) + 1; + #define DONT_SWITCH (SWITCHING_EXTRUDER_SERVO_NR == SWITCHING_NOZZLE_SERVO_NR) + // <0 if the new nozzle is higher, >0 if lower. A bigger raise when lower. + const 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 (destination copied from current_position earlier) + current_position[Z_AXIS] += z_raise; planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder); move_nozzle_servo(tmp_extruder); #endif - const float xdiff = hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder], - ydiff = hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder]; + /** + * 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 ABL_PLANAR + // 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(PSTR("tmp_offset_vec")); + act_offset_vec.debug(PSTR("act_offset_vec")); + offset_vec.debug(PSTR("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(PSTR("offset_vec (AFTER)")); + #endif + + // Adjustments to the current position + const float xydiff[2] = { offset_vec.x, offset_vec.y }; + current_position[Z_AXIS] += offset_vec.z; + + #else // !ABL_PLANAR + + const 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 (planner.leveling_active) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOPAIR("Z before MBL: ", current_position[Z_AXIS]); + #endif + float x2 = current_position[X_AXIS] + xydiff[X_AXIS], + y2 = current_position[Y_AXIS] + xydiff[Y_AXIS], + z1 = current_position[Z_AXIS], z2 = z1; + planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], z1); + planner.apply_leveling(x2, y2, z2); + current_position[Z_AXIS] += z2 - z1; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) + SERIAL_ECHOLNPAIR(" after: ", current_position[Z_AXIS]); + #endif + } + + #endif // MESH_BED_LEVELING + + #endif // !HAS_ABL #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Offset Tool XY by { ", xdiff); - SERIAL_ECHOPAIR(", ", ydiff); + SERIAL_ECHOPAIR("Offset Tool XY by { ", xydiff[X_AXIS]); + SERIAL_ECHOPAIR(", ", xydiff[Y_AXIS]); SERIAL_ECHOLNPGM(" }"); } #endif // The newly-selected extruder XY is actually at... - current_position[X_AXIS] += xdiff; - current_position[Y_AXIS] += ydiff; + current_position[X_AXIS] += xydiff[X_AXIS]; + current_position[Y_AXIS] += xydiff[Y_AXIS]; // Set the new active extruder active_extruder = tmp_extruder; #endif // !DUAL_X_CARRIAGE - #if ENABLED(SWITCHING_NOZZLE) - // The newly-selected extruder Z is actually at... - current_position[Z_AXIS] -= zdiff; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("Sync After Toolchange", current_position); #endif // Tell the planner the new "current position" SYNC_PLAN_POSITION_KINEMATIC(); - #if ENABLED(DELTA) - //LOOP_XYZ(i) update_software_endstops(i); // or modify the constrain function - const bool safe_to_move = current_position[Z_AXIS] < delta_clip_start_height - 1; - #else - constexpr bool safe_to_move = true; + // Move to the "old position" (move the extruder into place) + #if ENABLED(SWITCHING_NOZZLE) + destination[Z_AXIS] += z_diff; // Include the Z restore with the "move back" #endif - - // Raise, move, and lower again - if (safe_to_move && !no_move && IsRunning()) { - #if DISABLED(SWITCHING_NOZZLE) - // Do a small lift to avoid the workpiece in the move back (below) - current_position[Z_AXIS] += 1.0; - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder); - #endif + if (!no_move && IsRunning()) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination); #endif // Move back to the original (or tweaked) position do_blocking_move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]); - #if ENABLED(DUAL_X_CARRIAGE) - active_extruder_parked = false; - #endif } #if ENABLED(SWITCHING_NOZZLE) else { @@ -12597,19 +11540,15 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n #endif } // (tmp_extruder != active_extruder) - planner.synchronize(); + stepper.synchronize(); #if ENABLED(EXT_SOLENOID) && !ENABLED(PARKING_EXTRUDER) disable_all_solenoids(); enable_solenoid_on_active_extruder(); - #endif + #endif // EXT_SOLENOID feedrate_mm_s = old_feedrate_mm_s; - #if HAS_SOFTWARE_ENDSTOPS && ENABLED(DUAL_X_CARRIAGE) - update_software_endstops(X_AXIS); - #endif - #else // HOTENDS <= 1 UNUSED(fr_mm_s); @@ -12627,8 +11566,8 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n #endif // HOTENDS <= 1 - #if DO_SWITCH_EXTRUDER - planner.synchronize(); + #if ENABLED(SWITCHING_EXTRUDER) && !DONT_SWITCH + stepper.synchronize(); move_extruder_servo(active_extruder); #endif @@ -12636,13 +11575,8 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n fanmux_switch(active_extruder); #endif - #if HAS_LEVELING - // Restore leveling to re-establish the logical position - set_bed_leveling_enabled(leveling_was_active); - #endif - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(active_extruder)); + SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, (int)active_extruder); #endif // !MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1 } @@ -12696,476 +11630,853 @@ void process_parsed_command() { switch (parser.command_letter) { case 'G': switch (parser.codenum) { - case 0: case 1: gcode_G0_G1( // G0: Fast Move, G1: Linear Move - #if IS_SCARA - parser.codenum == 0 - #endif - ); break; + // G0, G1 + case 0: + case 1: + #if IS_SCARA + gcode_G0_G1(parser.codenum == 0); + #else + gcode_G0_G1(); + #endif + break; + // G2, G3 #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA) - case 2: case 3: gcode_G2_G3(parser.codenum == 2); break; // G2: CW ARC, G3: CCW ARC - #endif - - case 4: gcode_G4(); break; // G4: Dwell - - #if ENABLED(BEZIER_CURVE_SUPPORT) - case 5: gcode_G5(); break; // G5: Cubic B_spline - #endif - - #if ENABLED(UNREGISTERED_MOVE_SUPPORT) - case 6: gcode_G6(); break; // G6: Direct stepper move - #endif - - #if ENABLED(FWRETRACT) - case 10: gcode_G10(); break; // G10: Retract - case 11: gcode_G11(); break; // G11: Prime - #endif - - #if ENABLED(NOZZLE_CLEAN_FEATURE) - case 12: gcode_G12(); break; // G12: Clean Nozzle - #endif - - #if ENABLED(CNC_WORKSPACE_PLANES) - case 17: gcode_G17(); break; // G17: Select Plane XY - case 18: gcode_G18(); break; // G18: Select Plane ZX - case 19: gcode_G19(); break; // G19: Select Plane YZ - #endif - - #if ENABLED(INCH_MODE_SUPPORT) - case 20: gcode_G20(); break; // G20: Inch Units - case 21: gcode_G21(); break; // G21: Millimeter Units - #endif - - #if ENABLED(G26_MESH_VALIDATION) - case 26: gcode_G26(); break; // G26: Mesh Validation Pattern - #endif - - #if ENABLED(NOZZLE_PARK_FEATURE) - case 27: gcode_G27(); break; // G27: Park Nozzle - #endif - - case 28: gcode_G28(false); break; // G28: Home one or more axes - - #if HAS_LEVELING - case 29: gcode_G29(); break; // G29: Detailed Z probe - #endif - - #if HAS_BED_PROBE - case 30: gcode_G30(); break; // G30: Single Z probe - #endif - - #if ENABLED(Z_PROBE_SLED) - case 31: gcode_G31(); break; // G31: Dock sled - case 32: gcode_G32(); break; // G32: Undock sled - #endif - - #if ENABLED(DELTA_AUTO_CALIBRATION) - case 33: gcode_G33(); break; // G33: Delta Auto-Calibration - #endif - - #if ENABLED(G38_PROBE_TARGET) - case 38: - if (parser.subcode == 2 || parser.subcode == 3) - gcode_G38(parser.subcode == 2); // G38.2, G38.3: Probe towards object + case 2: // G2: CW ARC + case 3: // G3: CCW ARC + gcode_G2_G3(parser.codenum == 2); break; #endif - #if HAS_MESH - case 42: gcode_G42(); break; // G42: Move to mesh point + // G4 Dwell + case 4: + gcode_G4(); + break; + + #if ENABLED(BEZIER_CURVE_SUPPORT) + case 5: // G5: Cubic B_spline + gcode_G5(); + break; + #endif // BEZIER_CURVE_SUPPORT + + #if ENABLED(FWRETRACT) + case 10: // G10: retract + gcode_G10(); + break; + case 11: // G11: retract_recover + gcode_G11(); + break; + #endif // FWRETRACT + + #if ENABLED(NOZZLE_CLEAN_FEATURE) + case 12: + gcode_G12(); // G12: Nozzle Clean + break; + #endif // NOZZLE_CLEAN_FEATURE + + #if ENABLED(CNC_WORKSPACE_PLANES) + case 17: // G17: Select Plane XY + gcode_G17(); + break; + case 18: // G18: Select Plane ZX + gcode_G18(); + break; + case 19: // G19: Select Plane YZ + gcode_G19(); + break; + #endif // CNC_WORKSPACE_PLANES + + #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(G26_MESH_VALIDATION) + case 26: // G26: Mesh Validation Pattern generation + gcode_G26(); + break; + #endif // G26_MESH_VALIDATION + + #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(false); + break; + + #if HAS_LEVELING + case 29: // G29 Detailed Z probe, probes the bed at 3 or more points, + // or provides access to the UBL System if enabled. + gcode_G29(); + break; + #endif // HAS_LEVELING + + #if HAS_BED_PROBE + + case 30: // G30 Single Z probe + gcode_G30(); + break; + + #if ENABLED(Z_PROBE_SLED) + + case 31: // G31: dock the sled + gcode_G31(); + break; + + case 32: // G32: undock the sled + gcode_G32(); + break; + + #endif // Z_PROBE_SLED + + #endif // HAS_BED_PROBE + + #if ENABLED(DELTA_AUTO_CALIBRATION) + + case 33: // G33: Delta Auto-Calibration + gcode_G33(); + break; + + #endif // DELTA_AUTO_CALIBRATION + + #if ENABLED(G38_PROBE_TARGET) + case 38: // G38.2 & G38.3 + if (parser.subcode == 2 || parser.subcode == 3) + gcode_G38(parser.subcode == 2); + break; #endif - case 90: relative_mode = false; break; // G90: Absolute coordinates - case 91: relative_mode = true; break; // G91: Relative coordinates + case 90: // G90 + relative_mode = false; + break; + case 91: // G91 + relative_mode = true; + break; - case 92: gcode_G92(); break; // G92: Set Position - #if ENABLED(MECHADUINO_I2C_COMMANDS) - case 95: gcode_G95(); break; // G95: Set torque mode - case 96: gcode_G96(); break; // G96: Mark encoder reference point + case 92: // G92 + gcode_G92(); + break; + + #if HAS_MESH + case 42: + gcode_G42(); + break; #endif #if ENABLED(DEBUG_GCODE_PARSER) - case 800: parser.debug(); break; // G800: GCode Parser Test for G + case 800: + parser.debug(); // GCode Parser Test for G + break; #endif - - default: parser.unknown_command_error(); } break; case 'M': switch (parser.codenum) { #if HAS_RESUME_CONTINUE - case 0: case 1: gcode_M0_M1(); break; // M0: Unconditional stop, M1: Conditional stop - #endif + case 0: // M0: Unconditional stop - Wait for user button press on LCD + case 1: // M1: Conditional stop - Wait for user button press on LCD + gcode_M0_M1(); + break; + #endif // ULTIPANEL #if ENABLED(SPINDLE_LASER_ENABLE) - case 3: gcode_M3_M4(true); break; // M3: Laser/CW-Spindle Power - case 4: gcode_M3_M4(false); break; // M4: Laser/CCW-Spindle Power - case 5: gcode_M5(); break; // M5: Laser/Spindle OFF + case 3: + gcode_M3_M4(true); // M3: turn spindle/laser on, set laser/spindle power/speed, set rotation direction CW + break; // synchronizes with movement commands + case 4: + gcode_M3_M4(false); // M4: turn spindle/laser on, set laser/spindle power/speed, set rotation direction CCW + break; // synchronizes with movement commands + case 5: + gcode_M5(); // M5 - turn spindle/laser off + break; // synchronizes with movement commands #endif - - case 17: gcode_M17(); break; // M17: Enable all steppers + case 17: // M17: Enable all stepper motors + gcode_M17(); + break; #if ENABLED(SDSUPPORT) - case 20: gcode_M20(); break; // M20: List SD Card - case 21: gcode_M21(); break; // M21: Init SD Card - case 22: gcode_M22(); break; // M22: Release SD Card - case 23: gcode_M23(); break; // M23: Select File - case 24: gcode_M24(); break; // M24: Start SD Print - case 25: gcode_M25(); break; // M25: Pause SD Print - case 26: gcode_M26(); break; // M26: Set SD Index - case 27: gcode_M27(); break; // M27: Get SD Status - case 28: gcode_M28(); break; // M28: Start SD Write - case 29: gcode_M29(); break; // M29: Stop SD Write - case 30: gcode_M30(); break; // M30: Delete File - case 32: gcode_M32(); break; // M32: Select file, Start SD Print + case 20: // M20: list SD card + gcode_M20(); break; + case 21: // M21: init SD card + gcode_M21(); break; + case 22: // M22: release SD card + gcode_M22(); break; + case 23: // M23: Select file + gcode_M23(); break; + case 24: // M24: Start SD print + gcode_M24(); break; + case 25: // M25: Pause SD print + gcode_M25(); break; + case 26: // M26: Set SD index + gcode_M26(); break; + case 27: // M27: Get SD status + gcode_M27(); break; + case 28: // M28: Start SD write + gcode_M28(); break; + case 29: // M29: Stop SD write + gcode_M29(); break; + case 30: // M30 Delete File + gcode_M30(); break; + case 32: // M32: Select file and start SD print + gcode_M32(); break; + #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - case 33: gcode_M33(); break; // M33: Report longname path + case 33: // M33: Get the long full path to a file or folder + gcode_M33(); break; #endif + #if ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE) - case 34: gcode_M34(); break; // M34: Set SD card sorting options - #endif - case 928: gcode_M928(); break; // M928: Start SD write + case 34: // M34: Set SD card sorting options + gcode_M34(); break; + #endif // SDCARD_SORT_ALPHA && SDSORT_GCODE + + case 928: // M928: Start SD write + gcode_M928(); break; #endif // SDSUPPORT - case 31: gcode_M31(); break; // M31: Report print job elapsed time + case 31: // M31: Report time since the start of SD print or last M109 + gcode_M31(); break; + + case 42: // M42: Change pin state + gcode_M42(); break; - case 42: gcode_M42(); break; // M42: Change pin state #if ENABLED(PINS_DEBUGGING) - case 43: gcode_M43(); break; // M43: Read/monitor pin and endstop states + case 43: // M43: Read pin state + gcode_M43(); break; #endif + #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - case 48: gcode_M48(); break; // M48: Z probe repeatability test - #endif + case 48: // M48: Z probe repeatability test + gcode_M48(); + break; + #endif // Z_MIN_PROBE_REPEATABILITY_TEST + #if ENABLED(G26_MESH_VALIDATION) - case 49: gcode_M49(); break; // M49: Toggle the G26 Debug Flag - #endif + case 49: // M49: Turn on or off G26 debug flag for verbose output + gcode_M49(); + break; + #endif // G26_MESH_VALIDATION #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY) - case 73: gcode_M73(); break; // M73: Set Print Progress % + case 73: // M73: Set print progress percentage + gcode_M73(); break; #endif - case 75: gcode_M75(); break; // M75: Start Print Job Timer - case 76: gcode_M76(); break; // M76: Pause Print Job Timer - case 77: gcode_M77(); break; // M77: Stop Print Job Timer + + case 75: // M75: Start print timer + gcode_M75(); break; + case 76: // M76: Pause print timer + gcode_M76(); break; + case 77: // M77: Stop print timer + gcode_M77(); break; + #if ENABLED(PRINTCOUNTER) - case 78: gcode_M78(); break; // M78: Report Print Statistics + case 78: // M78: Show print statistics + gcode_M78(); break; #endif #if ENABLED(M100_FREE_MEMORY_WATCHER) - case 100: gcode_M100(); break; // M100: Free Memory Report + case 100: // M100: Free Memory Report + gcode_M100(); + break; #endif - case 104: gcode_M104(); break; // M104: Set Hotend Temperature - case 110: gcode_M110(); break; // M110: Set Current Line Number - case 111: gcode_M111(); break; // M111: Set Debug Flags + case 104: // M104: Set hot end temperature + gcode_M104(); + break; + + case 110: // M110: Set Current Line Number + gcode_M110(); + break; + + case 111: // M111: Set debug level + gcode_M111(); + break; #if DISABLED(EMERGENCY_PARSER) - case 108: gcode_M108(); break; // M108: Cancel Waiting - case 112: gcode_M112(); break; // M112: Emergency Stop - case 410: gcode_M410(); break; // M410: Quickstop. Abort all planned moves - #else - case 108: case 112: case 410: break; // Silently drop as handled by emergency parser + + 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: gcode_M113(); break; // M113: Set Host Keepalive Interval + case 113: // M113: Set Host Keepalive interval + gcode_M113(); + break; #endif - case 105: gcode_M105(); KEEPALIVE_STATE(NOT_BUSY); return; // M105: Report Temperatures (and say "ok") + case 140: // M140: Set bed temperature + gcode_M140(); + break; - #if ENABLED(AUTO_REPORT_TEMPERATURES) - case 155: gcode_M155(); break; // M155: Set Temperature Auto-report Interval + case 105: // M105: Report current temperature + gcode_M105(); + KEEPALIVE_STATE(NOT_BUSY); + return; // "ok" already printed + + #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED) + case 155: // M155: Set temperature auto-report interval + gcode_M155(); + break; #endif - case 109: gcode_M109(); break; // M109: Set Hotend Temperature. Wait for target. + case 109: // M109: Wait for hotend temperature to reach target + gcode_M109(); + break; - #if HAS_HEATED_BED - case 140: gcode_M140(); break; // M140: Set Bed Temperature - case 190: gcode_M190(); break; // M190: Set Bed Temperature. Wait for target. - #endif + #if HAS_TEMP_BED + case 190: // M190: Wait for bed temperature to reach target + gcode_M190(); + break; + #endif // HAS_TEMP_BED #if FAN_COUNT > 0 - case 106: gcode_M106(); break; // M106: Set Fan Speed - case 107: gcode_M107(); break; // M107: Fan Off - #endif + case 106: // M106: Fan On + gcode_M106(); + break; + case 107: // M107: Fan Off + gcode_M107(); + break; + #endif // FAN_COUNT > 0 #if ENABLED(PARK_HEAD_ON_PAUSE) - case 125: gcode_M125(); break; // M125: Park (for Filament Change) + case 125: // M125: Store current position and move to filament change position + gcode_M125(); break; #endif #if ENABLED(BARICUDA) + // PWM for HEATER_1_PIN #if HAS_HEATER_1 - case 126: gcode_M126(); break; // M126: Valve 1 Open - case 127: gcode_M127(); break; // M127: Valve 1 Closed - #endif + case 126: // M126: valve open + gcode_M126(); + break; + case 127: // M127: valve closed + gcode_M127(); + break; + #endif // HAS_HEATER_1 + + // PWM for HEATER_2_PIN #if HAS_HEATER_2 - case 128: gcode_M128(); break; // M128: Valve 2 Open - case 129: gcode_M129(); break; // M129: Valve 2 Closed - #endif - #endif + case 128: // M128: valve open + gcode_M128(); + break; + case 129: // M129: valve closed + gcode_M129(); + break; + #endif // HAS_HEATER_2 + #endif // BARICUDA #if HAS_POWER_SWITCH - case 80: gcode_M80(); break; // M80: Turn on Power Supply - #endif - case 81: gcode_M81(); break; // M81: Turn off Power and Power Supply - case 82: gcode_M82(); break; // M82: Disable Relative E-Axis - case 83: gcode_M83(); break; // M83: Set Relative E-Axis - case 18: case 84: gcode_M18_M84(); break; // M18/M84: Disable Steppers / Set Timeout - case 85: gcode_M85(); break; // M85: Set inactivity stepper shutdown timeout - case 92: gcode_M92(); break; // M92: Set steps-per-unit - case 114: gcode_M114(); break; // M114: Report Current Position - case 115: gcode_M115(); break; // M115: Capabilities Report - case 117: gcode_M117(); break; // M117: Set LCD message text - case 118: gcode_M118(); break; // M118: Print a message in the host console - case 119: gcode_M119(); break; // M119: Report Endstop states - case 120: gcode_M120(); break; // M120: Enable Endstops - case 121: gcode_M121(); break; // M121: Disable Endstops + case 80: // M80: Turn on Power Supply + gcode_M80(); + break; + + #endif // HAS_POWER_SWITCH + + case 81: // M81: Turn off Power, including Power Supply, if possible + gcode_M81(); + break; + + case 82: // M82: Set E axis normal mode (same as other axes) + gcode_M82(); + break; + case 83: // M83: Set E axis relative mode + gcode_M83(); + break; + case 18: // M18 => M84 + case 84: // M84: Disable all steppers or set timeout + gcode_M18_M84(); + break; + case 85: // M85: Set inactivity stepper shutdown timeout + gcode_M85(); + break; + case 92: // M92: Set the steps-per-unit for one or more axes + gcode_M92(); + break; + case 114: // M114: Report current position + gcode_M114(); + break; + case 115: // M115: Report capabilities + gcode_M115(); + break; + case 117: // M117: Set LCD message text, if possible + gcode_M117(); + break; + case 118: // M118: Display a message in the host console + gcode_M118(); + break; + case 119: // M119: Report endstop states + gcode_M119(); + break; + case 120: // M120: Enable endstops + gcode_M120(); + break; + case 121: // M121: Disable endstops + gcode_M121(); + break; #if ENABLED(ULTIPANEL) - case 145: gcode_M145(); break; // M145: Set material heatup parameters + + case 145: // M145: Set material heatup parameters + gcode_M145(); + break; + #endif #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - case 149: gcode_M149(); break; // M149: Set Temperature Units, C F K + case 149: // M149: Set temperature units + gcode_M149(); + break; #endif #if HAS_COLOR_LEDS - case 150: gcode_M150(); break; // M150: Set Status LED Color - #endif + + case 150: // M150: Set Status LED Color + gcode_M150(); + break; + + #endif // HAS_COLOR_LEDS #if ENABLED(MIXING_EXTRUDER) - case 163: gcode_M163(); break; // M163: Set Mixing Component + case 163: // M163: Set a component weight for mixing extruder + gcode_M163(); + break; #if MIXING_VIRTUAL_TOOLS > 1 - case 164: gcode_M164(); break; // M164: Save Current Mix + case 164: // M164: Save current mix as a virtual extruder + gcode_M164(); + break; #endif #if ENABLED(DIRECT_MIXING_IN_G1) - case 165: gcode_M165(); break; // M165: Set Multiple Mixing Components + case 165: // M165: Set multiple mix weights + gcode_M165(); + break; #endif #endif #if DISABLED(NO_VOLUMETRICS) - case 200: gcode_M200(); break; // M200: Set Filament Diameter, Volumetric Extrusion - #endif - - case 201: gcode_M201(); break; // M201: Set Max Printing Acceleration (units/sec^2) - #if 0 - case 202: gcode_M202(); break; // M202: Not used for Sprinter/grbl gen6 - #endif - case 203: gcode_M203(); break; // M203: Set Max Feedrate (units/sec) - case 204: gcode_M204(); break; // M204: Set Acceleration - case 205: gcode_M205(); break; // M205: Set Advanced settings - - #if HAS_M206_COMMAND - case 206: gcode_M206(); break; // M206: Set Home Offsets - case 428: gcode_M428(); break; // M428: Set Home Offsets based on current position - #endif - - #if ENABLED(FWRETRACT) - case 207: gcode_M207(); break; // M207: Set Retract Length, Feedrate, Z lift - case 208: gcode_M208(); break; // M208: Set Additional Prime Length and Feedrate - case 209: - if (MIN_AUTORETRACT <= MAX_AUTORETRACT) gcode_M209(); // M209: Turn Auto-Retract on/off + case 200: // M200: Set filament diameter, E to cubic units + gcode_M200(); break; #endif - case 211: gcode_M211(); break; // M211: Enable/Disable/Report Software Endstops + case 201: // M201: Set max acceleration for print moves (units/s^2) + gcode_M201(); + break; + #if 0 // Not used for Sprinter/grbl gen6 + case 202: // M202 + gcode_M202(); + break; + #endif + case 203: // M203: Set max feedrate (units/sec) + gcode_M203(); + break; + case 204: // M204: Set acceleration + gcode_M204(); + break; + case 205: // M205: Set advanced settings + gcode_M205(); + break; + + #if HAS_M206_COMMAND + case 206: // M206: Set home offsets + gcode_M206(); + break; + #endif + + #if ENABLED(DELTA) + case 665: // M665: Set delta configurations + gcode_M665(); + break; + #endif + + #if ENABLED(DELTA) || ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) + case 666: // M666: Set delta or dual endstop adjustment + gcode_M666(); + break; + #endif + + #if ENABLED(FWRETRACT) + case 207: // M207: Set Retract Length, Feedrate, and Z lift + gcode_M207(); + break; + case 208: // M208: Set Recover (unretract) Additional Length and Feedrate + gcode_M208(); + break; + case 209: // M209: Turn Automatic Retract Detection on/off + if (MIN_AUTORETRACT <= MAX_AUTORETRACT) gcode_M209(); + break; + #endif // FWRETRACT + + case 211: // M211: Enable, Disable, and/or Report software endstops + gcode_M211(); + break; #if HOTENDS > 1 - case 218: gcode_M218(); break; // M218: Set Tool Offset - #endif + case 218: // M218: Set a tool offset + gcode_M218(); + break; + #endif // HOTENDS > 1 - case 220: gcode_M220(); break; // M220: Set Feedrate Percentage - case 221: gcode_M221(); break; // M221: Set Flow Percentage - case 226: gcode_M226(); break; // M226: Wait for Pin State + case 220: // M220: Set Feedrate Percentage: S ("FR" on your LCD) + gcode_M220(); + break; - #if defined(CHDK) || HAS_PHOTOGRAPH - case 240: gcode_M240(); break; // M240: Trigger Camera - #endif + case 221: // M221: Set Flow Percentage + gcode_M221(); + break; - #if HAS_LCD_CONTRAST - case 250: gcode_M250(); break; // M250: Set LCD Contrast - #endif - - #if ENABLED(EXPERIMENTAL_I2CBUS) - case 260: gcode_M260(); break; // M260: Send Data to i2c slave - case 261: gcode_M261(); break; // M261: Request Data from i2c slave - #endif + case 226: // M226: Wait until a pin reaches a state + gcode_M226(); + break; #if HAS_SERVOS - case 280: gcode_M280(); break; // M280: Set Servo Position - #endif + case 280: // M280: Set servo position absolute + gcode_M280(); + break; + #endif // HAS_SERVOS #if ENABLED(BABYSTEPPING) - case 290: gcode_M290(); break; // M290: Babystepping - #endif + case 290: // M290: Babystepping + gcode_M290(); + break; + #endif // BABYSTEPPING #if HAS_BUZZER - case 300: gcode_M300(); break; // M300: Add Tone/Buzz to Queue - #endif + case 300: // M300: Play beep tone + gcode_M300(); + break; + #endif // HAS_BUZZER #if ENABLED(PIDTEMP) - case 301: gcode_M301(); break; // M301: Set Hotend PID parameters - #endif - - #if ENABLED(PREVENT_COLD_EXTRUSION) - case 302: gcode_M302(); break; // M302: Set Minimum Extrusion Temp - #endif - - case 303: gcode_M303(); break; // M303: PID Autotune + case 301: // M301: Set hotend PID parameters + gcode_M301(); + break; + #endif // PIDTEMP #if ENABLED(PIDTEMPBED) - case 304: gcode_M304(); break; // M304: Set Bed PID parameters - #endif + case 304: // M304: Set bed PID parameters + gcode_M304(); + break; + #endif // PIDTEMPBED - #if HAS_MICROSTEPS - case 350: gcode_M350(); break; // M350: Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. - case 351: gcode_M351(); break; // M351: Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. - #endif + #if defined(CHDK) || HAS_PHOTOGRAPH + case 240: // M240: Trigger a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/ + gcode_M240(); + break; + #endif // CHDK || PHOTOGRAPH_PIN - case 355: gcode_M355(); break; // M355: Set Case Light brightness + #if HAS_LCD_CONTRAST + case 250: // M250: Set LCD contrast + gcode_M250(); + break; + #endif // HAS_LCD_CONTRAST + + #if ENABLED(EXPERIMENTAL_I2CBUS) + + case 260: // M260: Send data to an i2c slave + gcode_M260(); + break; + + case 261: // M261: Request data from an i2c slave + gcode_M261(); + break; + + #endif // EXPERIMENTAL_I2CBUS + + #if ENABLED(PREVENT_COLD_EXTRUSION) + case 302: // M302: Allow cold extrudes (set the minimum extrude temperature) + gcode_M302(); + break; + #endif // PREVENT_COLD_EXTRUSION + + case 303: // M303: PID autotune + gcode_M303(); + break; #if ENABLED(MORGAN_SCARA) - case 360: if (gcode_M360()) return; break; // M360: SCARA Theta pos1 - case 361: if (gcode_M361()) return; break; // M361: SCARA Theta pos2 - case 362: if (gcode_M362()) return; break; // M362: SCARA Psi pos1 - case 363: if (gcode_M363()) return; break; // M363: SCARA Psi pos2 - case 364: if (gcode_M364()) return; break; // M364: SCARA Psi pos3 (90 deg to Theta) - #endif + case 360: // M360: SCARA Theta pos1 + if (gcode_M360()) return; + break; + case 361: // M361: SCARA Theta pos2 + if (gcode_M361()) return; + break; + case 362: // M362: SCARA Psi pos1 + if (gcode_M362()) return; + break; + case 363: // M363: SCARA Psi pos2 + if (gcode_M363()) return; + break; + case 364: // M364: SCARA Psi pos3 (90 deg to Theta) + if (gcode_M364()) return; + break; + #endif // SCARA - case 400: gcode_M400(); break; // M400: Synchronize. Wait for moves to finish. + case 400: // M400: Finish all moves + gcode_M400(); + break; #if HAS_BED_PROBE - case 401: gcode_M401(); break; // M401: Deploy Probe - case 402: gcode_M402(); break; // M402: Stow Probe - #endif + case 401: // M401: Deploy probe + gcode_M401(); + break; + case 402: // M402: Stow probe + gcode_M402(); + break; + #endif // HAS_BED_PROBE #if ENABLED(FILAMENT_WIDTH_SENSOR) - case 404: gcode_M404(); break; // M404: Set/Report Nominal Filament Width - case 405: gcode_M405(); break; // M405: Enable Filament Width Sensor - case 406: gcode_M406(); break; // M406: Disable Filament Width Sensor - case 407: gcode_M407(); break; // M407: Report Measured Filament Width - #endif + case 404: // M404: Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width + gcode_M404(); + break; + case 405: // M405: Turn on filament sensor for control + gcode_M405(); + break; + case 406: // M406: Turn off filament sensor for control + gcode_M406(); + break; + case 407: // M407: Display measured filament diameter + gcode_M407(); + break; + #endif // FILAMENT_WIDTH_SENSOR #if HAS_LEVELING - case 420: gcode_M420(); break; // M420: Set Bed Leveling Enabled / Fade + case 420: // M420: Enable/Disable Bed Leveling + gcode_M420(); + break; #endif #if HAS_MESH - case 421: gcode_M421(); break; // M421: Set a Mesh Z value + case 421: // M421: Set a Mesh Bed Leveling Z coordinate + gcode_M421(); + break; #endif - case 500: gcode_M500(); break; // M500: Store Settings in EEPROM - case 501: gcode_M501(); break; // M501: Read Settings from EEPROM - case 502: gcode_M502(); break; // M502: Revert Settings to defaults + #if HAS_M206_COMMAND + case 428: // M428: Apply current_position to home_offset + gcode_M428(); + break; + #endif + + case 500: // M500: Store settings in EEPROM + gcode_M500(); + break; + case 501: // M501: Read settings from EEPROM + gcode_M501(); + break; + case 502: // M502: Revert to default settings + gcode_M502(); + break; + #if DISABLED(DISABLE_M503) - case 503: gcode_M503(); break; // M503: Report Settings (in SRAM) - #endif - #if ENABLED(EEPROM_SETTINGS) - case 504: gcode_M504(); break; // M504: Validate EEPROM - #endif - - #if ENABLED(SDSUPPORT) - case 524: gcode_M524(); break; // M524: Abort SD print job + case 503: // M503: print settings currently in memory + gcode_M503(); + break; #endif #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - case 540: gcode_M540(); break; // M540: Set Abort on Endstop Hit for SD Printing - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - case 600: gcode_M600(); break; // M600: Pause for Filament Change - case 603: gcode_M603(); break; // M603: Configure Filament Change - #endif - - #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - case 605: gcode_M605(); break; // M605: Set Dual X Carriage movement mode - #endif - - #if ENABLED(DELTA) || ENABLED(HANGPRINTER) - case 665: gcode_M665(); break; // M665: Delta / Hangprinter Configuration - #endif - #if ENABLED(DELTA) || ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - case 666: gcode_M666(); break; // M666: DELTA/Dual Endstop Adjustment - #endif - - #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - case 701: gcode_M701(); break; // M701: Load Filament - case 702: gcode_M702(); break; // M702: Unload Filament - #endif - - #if ENABLED(MAX7219_GCODE) - case 7219: gcode_M7219(); break; // M7219: Set LEDs, columns, and rows - #endif - - #if ENABLED(DEBUG_GCODE_PARSER) - case 800: parser.debug(); break; // M800: GCode Parser Test for M + case 540: // M540: Set abort on endstop hit for SD printing + gcode_M540(); + break; #endif #if HAS_BED_PROBE - case 851: gcode_M851(); break; // M851: Set Z Probe Z Offset - #endif + case 851: // M851: Set Z Probe Z Offset + gcode_M851(); + break; + #endif // HAS_BED_PROBE #if ENABLED(SKEW_CORRECTION_GCODE) - case 852: gcode_M852(); break; // M852: Set Skew factors + case 852: // M852: Set Skew factors + gcode_M852(); + break; #endif - #if ENABLED(I2C_POSITION_ENCODERS) - case 860: gcode_M860(); break; // M860: Report encoder module position - case 861: gcode_M861(); break; // M861: Report encoder module status - case 862: gcode_M862(); break; // M862: Perform axis test - case 863: gcode_M863(); break; // M863: Calibrate steps/mm - case 864: gcode_M864(); break; // M864: Change module address - case 865: gcode_M865(); break; // M865: Check module firmware version - case 866: gcode_M866(); break; // M866: Report axis error count - case 867: gcode_M867(); break; // M867: Toggle error correction - case 868: gcode_M868(); break; // M868: Set error correction threshold - case 869: gcode_M869(); break; // M869: Report axis error + #if ENABLED(ADVANCED_PAUSE_FEATURE) + case 600: // M600: Pause for filament change + gcode_M600(); + break; + #endif // ADVANCED_PAUSE_FEATURE + + #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) + case 605: // M605: Set Dual X Carriage movement mode + gcode_M605(); + break; + #endif // DUAL_X_CARRIAGE + + #if ENABLED(MK2_MULTIPLEXER) + case 702: // M702: Unload all extruders + gcode_M702(); + break; #endif #if ENABLED(LIN_ADVANCE) - case 900: gcode_M900(); break; // M900: Set Linear Advance K factor + case 900: // M900: Set advance K factor. + gcode_M900(); + break; #endif - case 907: gcode_M907(); break; // M907: Set Digital Trimpot Motor Current using axis codes. + case 907: // M907: Set digital trimpot motor current using axis codes. + gcode_M907(); + break; #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT) - case 908: gcode_M908(); break; // M908: Direct Control Digital Trimpot - #if ENABLED(DAC_STEPPER_CURRENT) - case 909: gcode_M909(); break; // M909: Print Digipot/DAC current value (As with Printrbot RevF) - case 910: gcode_M910(); break; // M910: Commit Digipot/DAC value to External EEPROM (As with Printrbot RevF) - #endif - #endif - #if HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2208) + case 908: // M908: Control digital trimpot directly. + gcode_M908(); + break; + + #if ENABLED(DAC_STEPPER_CURRENT) // As with Printrbot RevF + + case 909: // M909: Print digipot/DAC current value + gcode_M909(); + break; + + case 910: // M910: Commit digipot/DAC value to external EEPROM + gcode_M910(); + break; + + #endif + + #endif // HAS_DIGIPOTSS || DAC_STEPPER_CURRENT + + #if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + case 906: // M906: Set motor current in milliamps using axis codes X, Y, Z, E + gcode_M906(); + break; + + case 911: // M911: Report TMC prewarn triggered flags + gcode_M911(); + break; + + case 912: // M911: Clear TMC prewarn triggered flags + gcode_M912(); + break; + #if ENABLED(TMC_DEBUG) - case 122: gcode_M122(); break; // M122: Debug TMC steppers + case 122: // Debug TMC steppers + gcode_M122(); + break; #endif - case 906: gcode_M906(); break; // M906: Set motor current in milliamps using axis codes X, Y, Z, E - case 911: gcode_M911(); break; // M911: Report TMC prewarn triggered flags - case 912: gcode_M912(); break; // M911: Clear TMC prewarn triggered flags + #if ENABLED(HYBRID_THRESHOLD) - case 913: gcode_M913(); break; // M913: Set HYBRID_THRESHOLD speed. + case 913: // M913: Set HYBRID_THRESHOLD speed. + gcode_M913(); + break; #endif + #if ENABLED(SENSORLESS_HOMING) - case 914: gcode_M914(); break; // M914: Set SENSORLESS_HOMING sensitivity. + case 914: // M914: Set SENSORLESS_HOMING sensitivity. + gcode_M914(); + break; #endif - #if ENABLED(TMC_Z_CALIBRATION) - case 915: gcode_M915(); break; // M915: TMC Z axis calibration routine + + #if ENABLED(TMC_Z_CALIBRATION) && (Z_IS_TRINAMIC || Z2_IS_TRINAMIC) + case 915: // M915: TMC Z axis calibration routine + gcode_M915(); + break; #endif #endif - case 999: gcode_M999(); break; // M999: Restart after being Stopped + #if HAS_MICROSTEPS - default: parser.unknown_command_error(); + case 350: // M350: Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. + gcode_M350(); + break; + + case 351: // M351: Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. + gcode_M351(); + break; + + #endif // HAS_MICROSTEPS + + case 355: // M355 set case light brightness + gcode_M355(); + break; + + #if ENABLED(DEBUG_GCODE_PARSER) + case 800: + parser.debug(); // GCode Parser Test for M + break; + #endif + + #if ENABLED(I2C_POSITION_ENCODERS) + + case 860: // M860 Report encoder module position + gcode_M860(); + break; + + case 861: // M861 Report encoder module status + gcode_M861(); + break; + + case 862: // M862 Perform axis test + gcode_M862(); + break; + + case 863: // M863 Calibrate steps/mm + gcode_M863(); + break; + + case 864: // M864 Change module address + gcode_M864(); + break; + + case 865: // M865 Check module firmware version + gcode_M865(); + break; + + case 866: // M866 Report axis error count + gcode_M866(); + break; + + case 867: // M867 Toggle error correction + gcode_M867(); + break; + + case 868: // M868 Set error correction threshold + gcode_M868(); + break; + + case 869: // M869 Report axis error + gcode_M869(); + break; + + #endif // I2C_POSITION_ENCODERS + + case 999: // M999: Restart after being Stopped + gcode_M999(); + break; } break; - case 'T': gcode_T(parser.codenum); break; // T: Tool Select + case 'T': + gcode_T(parser.codenum); + break; default: parser.unknown_command_error(); } KEEPALIVE_STATE(NOT_BUSY); + ok_to_send(); } @@ -13190,9 +12501,9 @@ void process_next_command() { * Send a "Resend: nnn" message to the host to * indicate that a command needs to be re-sent. */ -void flush_and_request_resend() { +void FlushSerialRequestResend() { //char command_queue[cmd_queue_index_r][100]="Resend:"; - SERIAL_FLUSH(); + MYSERIAL.flush(); SERIAL_PROTOCOLPGM(MSG_RESEND); SERIAL_PROTOCOLLN(gcode_LastN + 1); ok_to_send(); @@ -13208,6 +12519,7 @@ void flush_and_request_resend() { * B Block queue space remaining */ void ok_to_send() { + refresh_cmd_timeout(); if (!send_ok[cmd_queue_index_r]) return; SERIAL_PROTOCOLPGM(MSG_OK); #if ENABLED(ADVANCED_OK) @@ -13267,6 +12579,20 @@ void ok_to_send() { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + #define ABL_BG_SPACING(A) bilinear_grid_spacing_virt[A] + #define ABL_BG_FACTOR(A) bilinear_grid_factor_virt[A] + #define ABL_BG_POINTS_X ABL_GRID_POINTS_VIRT_X + #define ABL_BG_POINTS_Y ABL_GRID_POINTS_VIRT_Y + #define ABL_BG_GRID(X,Y) z_values_virt[X][Y] + #else + #define ABL_BG_SPACING(A) bilinear_grid_spacing[A] + #define ABL_BG_FACTOR(A) bilinear_grid_factor[A] + #define ABL_BG_POINTS_X GRID_MAX_POINTS_X + #define ABL_BG_POINTS_Y GRID_MAX_POINTS_Y + #define ABL_BG_GRID(X,Y) z_values[X][Y] + #endif + // Get the Z adjustment for non-linear bed leveling float bilinear_z_offset(const float raw[XYZ]) { @@ -13301,7 +12627,7 @@ void ok_to_send() { #endif gridx = gx; - nextx = MIN(gridx + 1, ABL_BG_POINTS_X - 1); + nextx = min(gridx + 1, ABL_BG_POINTS_X - 1); } if (last_y != ry || last_gridx != gridx) { @@ -13318,7 +12644,7 @@ void ok_to_send() { #endif gridy = gy; - nexty = MIN(gridy + 1, ABL_BG_POINTS_Y - 1); + nexty = min(gridy + 1, ABL_BG_POINTS_Y - 1); } if (last_gridx != gridx || last_gridy != gridy) { @@ -13342,7 +12668,7 @@ void ok_to_send() { /* static float last_offset = 0; - if (ABS(last_offset - offset) > 0.2) { + if (FABS(last_offset - offset) > 0.2) { SERIAL_ECHOPGM("Sudden Shift at "); SERIAL_ECHOPAIR("x=", rx); SERIAL_ECHOPAIR(" / ", bilinear_grid_spacing[X_AXIS]); @@ -13387,9 +12713,30 @@ void ok_to_send() { delta_diagonal_rod_2_tower[B_AXIS] = sq(delta_diagonal_rod + drt[B_AXIS]); delta_diagonal_rod_2_tower[C_AXIS] = sq(delta_diagonal_rod + drt[C_AXIS]); update_software_endstops(Z_AXIS); - axis_homed = 0; + axis_homed[X_AXIS] = axis_homed[Y_AXIS] = axis_homed[Z_AXIS] = false; } + #if ENABLED(DELTA_FAST_SQRT) + /** + * Fast inverse sqrt from Quake III Arena + * See: https://en.wikipedia.org/wiki/Fast_inverse_square_root + */ + float Q_rsqrt(const float number) { + long i; + float x2, y; + const float threehalfs = 1.5f; + x2 = number * 0.5f; + y = number; + i = * ( long * ) &y; // evil floating point bit level hacking + i = 0x5F3759DF - ( i >> 1 ); // what the f***? + y = * ( float * ) &i; + y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration + // y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed + return y; + } + + #endif + /** * Delta Inverse Kinematics * @@ -13404,31 +12751,23 @@ void ok_to_send() { * * - Disable the home_offset (M206) and/or position_shift (G92) * features to remove up to 12 float additions. + * + * - Use a fast-inverse-sqrt function and add the reciprocal. + * (see above) */ - #define DELTA_DEBUG(VAR) do { \ - SERIAL_ECHOPAIR("cartesian X:", VAR[X_AXIS]); \ - SERIAL_ECHOPAIR(" Y:", VAR[Y_AXIS]); \ - SERIAL_ECHOLNPAIR(" Z:", VAR[Z_AXIS]); \ + #define DELTA_DEBUG() do { \ + SERIAL_ECHOPAIR("cartesian X:", raw[X_AXIS]); \ + SERIAL_ECHOPAIR(" Y:", raw[Y_AXIS]); \ + SERIAL_ECHOLNPAIR(" Z:", raw[Z_AXIS]); \ SERIAL_ECHOPAIR("delta A:", delta[A_AXIS]); \ SERIAL_ECHOPAIR(" B:", delta[B_AXIS]); \ SERIAL_ECHOLNPAIR(" C:", delta[C_AXIS]); \ }while(0) void inverse_kinematics(const float raw[XYZ]) { - #if HOTENDS > 1 - // Delta hotend offsets must be applied in Cartesian space with no "spoofing" - const float pos[XYZ] = { - raw[X_AXIS] - hotend_offset[X_AXIS][active_extruder], - raw[Y_AXIS] - hotend_offset[Y_AXIS][active_extruder], - raw[Z_AXIS] - }; - DELTA_IK(pos); - //DELTA_DEBUG(pos); - #else - DELTA_IK(raw); - //DELTA_DEBUG(raw); - #endif + DELTA_IK(raw); + // DELTA_DEBUG(); } /** @@ -13438,10 +12777,10 @@ void ok_to_send() { float delta_safe_distance_from_top() { float cartesian[XYZ] = { 0, 0, 0 }; inverse_kinematics(cartesian); - const float centered_extent = delta[A_AXIS]; + float distance = delta[A_AXIS]; cartesian[Y_AXIS] = DELTA_PRINTABLE_RADIUS; inverse_kinematics(cartesian); - return ABS(centered_extent - delta[A_AXIS]); + return FABS(distance - delta[A_AXIS]); } /** @@ -13469,7 +12808,7 @@ void ok_to_send() { * * The result is stored in the cartes[] array. */ - void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3) { + void forward_kinematics_DELTA(float z1, float z2, float z3) { // Create a vector in old coordinates along x axis of new coordinate const float p12[] = { delta_tower[B_AXIS][X_AXIS] - delta_tower[A_AXIS][X_AXIS], @@ -13477,11 +12816,11 @@ void ok_to_send() { z2 - z1 }, - // Get the reciprocal of Magnitude of vector. - d2 = sq(p12[0]) + sq(p12[1]) + sq(p12[2]), inv_d = RSQRT(d2), + // Get the Magnitude of vector. + d = SQRT(sq(p12[0]) + sq(p12[1]) + sq(p12[2])), - // Create unit vector by multiplying by the inverse of the magnitude. - ex[3] = { p12[0] * inv_d, p12[1] * inv_d, p12[2] * inv_d }, + // Create unit vector by dividing by magnitude. + ex[3] = { p12[0] / d, p12[1] / d, p12[2] / d }, // Get the vector from the origin of the new system to the third point. p13[3] = { @@ -13500,11 +12839,11 @@ void ok_to_send() { // 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 and the inverse of the magnitude of Y component - const float j2 = sq(ey[0]) + sq(ey[1]) + sq(ey[2]), inv_j = RSQRT(j2); + // The magnitude of Y component + const float j = SQRT(sq(ey[0]) + sq(ey[1]) + sq(ey[2])); // Convert to a unit vector - ey[0] *= inv_j; ey[1] *= inv_j; ey[2] *= inv_j; + 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); @@ -13515,8 +12854,8 @@ void ok_to_send() { }, // We now have the d, i and j values defined in Wikipedia. // Plug them into the equations defined in Wikipedia for Xnew, Ynew and Znew - Xnew = (delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[B_AXIS] + d2) * inv_d * 0.5, - Ynew = ((delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[C_AXIS] + sq(i) + j2) * 0.5 - i * Xnew) * inv_j, + Xnew = (delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[B_AXIS] + sq(d)) / (d * 2), + Ynew = ((delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[C_AXIS] + HYPOT2(i, j)) / 2 - i * Xnew) / j, Znew = SQRT(delta_diagonal_rod_2_tower[A_AXIS] - HYPOT2(Xnew, Ynew)); // Start from the origin of the old coordinates and add vectors in the @@ -13524,124 +12863,15 @@ void ok_to_send() { // in the old system. cartes[X_AXIS] = delta_tower[A_AXIS][X_AXIS] + ex[0] * Xnew + ey[0] * Ynew - ez[0] * Znew; cartes[Y_AXIS] = delta_tower[A_AXIS][Y_AXIS] + ex[1] * Xnew + ey[1] * Ynew - ez[1] * Znew; - cartes[Z_AXIS] = z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew; + cartes[Z_AXIS] = z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew; } - void forward_kinematics_DELTA(const float (&point)[ABC]) { + void forward_kinematics_DELTA(float point[ABC]) { forward_kinematics_DELTA(point[A_AXIS], point[B_AXIS], point[C_AXIS]); } #endif // DELTA -#if ENABLED(HANGPRINTER) - - /** - * Recalculate factors used for hangprinter kinematics whenever - * settings have been changed (e.g., by M665). - */ - void recalc_hangprinter_settings(){ - HANGPRINTER_IK_ORIGIN(line_lengths_origin); - - #if ENABLED(LINE_BUILDUP_COMPENSATION_FEATURE) - - const uint8_t mech_adv_tmp[MOV_AXIS] = MECHANICAL_ADVANTAGE, - actn_pts_tmp[MOV_AXIS] = ACTION_POINTS; - const uint16_t m_g_t_tmp[MOV_AXIS] = MOTOR_GEAR_TEETH, - s_g_t_tmp[MOV_AXIS] = SPOOL_GEAR_TEETH; - const float mnt_l_tmp[MOV_AXIS] = MOUNTED_LINE; - float s_r2_tmp[MOV_AXIS] = SPOOL_RADII, - steps_per_unit_times_r_tmp[MOV_AXIS]; - uint8_t nr_lines_dir_tmp[MOV_AXIS]; - - LOOP_MOV_AXIS(i){ - steps_per_unit_times_r_tmp[i] = (float(mech_adv_tmp[i])*STEPS_PER_MOTOR_REVOLUTION*s_g_t_tmp[i])/(2*M_PI*m_g_t_tmp[i]); - nr_lines_dir_tmp[i] = mech_adv_tmp[i]*actn_pts_tmp[i]; - s_r2_tmp[i] *= s_r2_tmp[i]; - planner.k2[i] = -(float)nr_lines_dir_tmp[i]*SPOOL_BUILDUP_FACTOR; - planner.k0[i] = 2.0*steps_per_unit_times_r_tmp[i]/planner.k2[i]; - } - - // Assumes spools are mounted near D-anchor in ceiling - #define HYP3D(x,y,z) SQRT(sq(x) + sq(y) + sq(z)) - float line_on_spool_origin_tmp[MOV_AXIS]; - line_on_spool_origin_tmp[A_AXIS] = actn_pts_tmp[A_AXIS] * mnt_l_tmp[A_AXIS] - - actn_pts_tmp[A_AXIS] * HYPOT(anchor_A_y, anchor_D_z - anchor_A_z) - - nr_lines_dir_tmp[A_AXIS] * line_lengths_origin[A_AXIS]; - line_on_spool_origin_tmp[B_AXIS] = actn_pts_tmp[B_AXIS] * mnt_l_tmp[B_AXIS] - - actn_pts_tmp[B_AXIS] * HYP3D(anchor_B_x, anchor_B_y, anchor_D_z - anchor_B_z) - - nr_lines_dir_tmp[B_AXIS] * line_lengths_origin[B_AXIS]; - line_on_spool_origin_tmp[C_AXIS] = actn_pts_tmp[C_AXIS] * mnt_l_tmp[C_AXIS] - - actn_pts_tmp[C_AXIS] * HYP3D(anchor_C_x, anchor_C_y, anchor_D_z - anchor_C_z) - - nr_lines_dir_tmp[C_AXIS] * line_lengths_origin[C_AXIS]; - line_on_spool_origin_tmp[D_AXIS] = actn_pts_tmp[D_AXIS] * mnt_l_tmp[D_AXIS] - - nr_lines_dir_tmp[D_AXIS] * line_lengths_origin[D_AXIS]; - - LOOP_MOV_AXIS(i) { - planner.axis_steps_per_mm[i] = steps_per_unit_times_r_tmp[i] / - SQRT((SPOOL_BUILDUP_FACTOR) * line_on_spool_origin_tmp[i] + s_r2_tmp[i]); - planner.k1[i] = (SPOOL_BUILDUP_FACTOR) * - (line_on_spool_origin_tmp[i] + nr_lines_dir_tmp[i] * line_lengths_origin[i]) + s_r2_tmp[i]; - - planner.sqrtk1[i] = SQRT(planner.k1[i]); - } - planner.axis_steps_per_mm[E_AXIS] = DEFAULT_E_AXIS_STEPS_PER_UNIT; - - #endif // LINE_BUILDUP_COMPENSATION_FEATURE - - SYNC_PLAN_POSITION_KINEMATIC(); // recalcs line lengths in case anchor was moved - } - - /** - * Hangprinter inverse kinematics - */ - void inverse_kinematics(const float raw[XYZ]) { - HANGPRINTER_IK(raw); - } - - /** - * Hangprinter forward kinematics - * Basic idea is to subtract squared line lengths to get linear equations. - * Subtracting d*d from a*a, b*b, and c*c gives the cleanest derivation: - * - * a*a - d*d = k1 + k2*y + k3*z <---- a line (I) - * b*b - d*d = k4 + k5*x + k6*y + k7*z <---- a plane (II) - * c*c - d*d = k8 + k9*x + k10*y + k11*z <---- a plane (III) - * - * Use (I) to reduce (II) and (III) into lines. Eliminate y, keep z. - * - * (II): b*b - d*d = k12 + k13*x + k14*z - * <=> x = k0b + k1b*z, <---- a line (IV) - * - * (III): c*c - d*d = k15 + k16*x + k17*z - * <=> x = k0c + k1c*z, <---- a line (V) - * - * where k1, k2, ..., k17, k0b, k0c, k1b, and k1c are known constants. - * - * These two straight lines are not parallel, so they will cross in exactly one point. - * Find z by setting (IV) = (V) - * Find x by inserting z into (V) - * Find y by inserting z into (I) - * - * Warning: truncation errors will typically be in the order of a few tens of microns. - */ - void forward_kinematics_HANGPRINTER(float a, float b, float c, float d){ - const float Asq = sq(anchor_A_y) + sq(anchor_A_z), - Bsq = sq(anchor_B_x) + sq(anchor_B_y) + sq(anchor_B_z), - Csq = sq(anchor_C_x) + sq(anchor_C_y) + sq(anchor_C_z), - Dsq = sq(anchor_D_z), - aa = sq(a), - dd = sq(d), - k0b = (-sq(b) + Bsq - Dsq + dd) / (2.0 * anchor_B_x) + (anchor_B_y / (2.0 * anchor_A_y * anchor_B_x)) * (Dsq - Asq + aa - dd), - k0c = (-sq(c) + Csq - Dsq + dd) / (2.0 * anchor_C_x) + (anchor_C_y / (2.0 * anchor_A_y * anchor_C_x)) * (Dsq - Asq + aa - dd), - k1b = (anchor_B_y * (anchor_A_z - anchor_D_z)) / (anchor_A_y * anchor_B_x) + (anchor_D_z - anchor_B_z) / anchor_B_x, - k1c = (anchor_C_y * (anchor_A_z - anchor_D_z)) / (anchor_A_y * anchor_C_x) + (anchor_D_z - anchor_C_z) / anchor_C_x; - - cartes[Z_AXIS] = (k0b - k0c) / (k1c - k1b); - cartes[X_AXIS] = k0c + k1c * cartes[Z_AXIS]; - cartes[Y_AXIS] = (Asq - Dsq - aa + dd) / (2.0 * anchor_A_y) + ((anchor_D_z - anchor_A_z) / anchor_A_y) * cartes[Z_AXIS]; - } -#endif // HANGPRINTER - /** * Get the stepper positions in the cartes[] array. * Forward kinematics are applied for DELTA and SCARA. @@ -13654,28 +12884,21 @@ void ok_to_send() { void get_cartesian_from_steppers() { #if ENABLED(DELTA) forward_kinematics_DELTA( - planner.get_axis_position_mm(A_AXIS), - planner.get_axis_position_mm(B_AXIS), - planner.get_axis_position_mm(C_AXIS) - ); - #elif ENABLED(HANGPRINTER) - forward_kinematics_HANGPRINTER( - planner.get_axis_position_mm(A_AXIS), - planner.get_axis_position_mm(B_AXIS), - planner.get_axis_position_mm(C_AXIS), - planner.get_axis_position_mm(D_AXIS) + stepper.get_axis_position_mm(A_AXIS), + stepper.get_axis_position_mm(B_AXIS), + stepper.get_axis_position_mm(C_AXIS) ); #else #if IS_SCARA forward_kinematics_SCARA( - planner.get_axis_position_degrees(A_AXIS), - planner.get_axis_position_degrees(B_AXIS) + stepper.get_axis_position_degrees(A_AXIS), + stepper.get_axis_position_degrees(B_AXIS) ); #else - cartes[X_AXIS] = planner.get_axis_position_mm(X_AXIS); - cartes[Y_AXIS] = planner.get_axis_position_mm(Y_AXIS); + cartes[X_AXIS] = stepper.get_axis_position_mm(X_AXIS); + cartes[Y_AXIS] = stepper.get_axis_position_mm(Y_AXIS); #endif - cartes[Z_AXIS] = planner.get_axis_position_mm(Z_AXIS); + cartes[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); #endif } @@ -13724,13 +12947,13 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { // Remaining cartesian distances const float zdiff = destination[Z_AXIS] - current_position[Z_AXIS], - ediff = destination[E_CART] - current_position[E_CART]; + ediff = destination[E_AXIS] - current_position[E_AXIS]; // Get the linear distance in XYZ // If the move is very short, check the E move distance // No E move either? Game over. float cartesian_mm = SQRT(sq(xdiff) + sq(ydiff) + sq(zdiff)); - if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(ediff); + if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = FABS(ediff); if (UNEAR_ZERO(cartesian_mm)) return; // The length divided by the segment size @@ -13739,8 +12962,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { NOLESS(segments, 1); // The approximate length of each segment - const float inv_segments = 1.0f / float(segments), - cartesian_segment_mm = cartesian_mm * inv_segments, + const float inv_segments = 1.0 / float(segments), segment_distance[XYZE] = { xdiff * inv_segments, ydiff * inv_segments, @@ -13750,7 +12972,6 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { // SERIAL_ECHOPAIR("mm=", cartesian_mm); // SERIAL_ECHOLNPAIR(" segments=", segments); - // SERIAL_ECHOLNPAIR(" segment_mm=", cartesian_segment_mm); // Get the raw current position as starting point float raw[XYZE]; @@ -13765,13 +12986,12 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { idle(); } LOOP_XYZE(i) raw[i] += segment_distance[i]; - if (!planner.buffer_line_kinematic(raw, fr_mm_s, active_extruder, cartesian_segment_mm)) - break; + planner.buffer_line_kinematic(raw, fr_mm_s, active_extruder); } // Since segment_distance is only approximate, // the final move must be to the exact destination. - planner.buffer_line_kinematic(destination, fr_mm_s, active_extruder, cartesian_segment_mm); + planner.buffer_line_kinematic(destination, fr_mm_s, active_extruder); } #elif ENABLED(MESH_BED_LEVELING) @@ -13798,11 +13018,10 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { return; } - #define MBL_SEGMENT_END(A) (current_position[_AXIS(A)] + (destination[_AXIS(A)] - current_position[_AXIS(A)]) * normalized_dist) - #define MBL_SEGMENT_END_E (current_position[E_CART] + (destination[E_CART] - current_position[E_CART]) * normalized_dist) + #define MBL_SEGMENT_END(A) (current_position[A ##_AXIS] + (destination[A ##_AXIS] - current_position[A ##_AXIS]) * normalized_dist) float normalized_dist, end[XYZE]; - const int8_t gcx = MAX(cx1, cx2), gcy = MAX(cy1, cy2); + const int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2); // Crosses on the X and not already split on this X? // The x_splits flags are insurance against rounding errors. @@ -13831,7 +13050,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { } destination[Z_AXIS] = MBL_SEGMENT_END(Z); - destination[E_CART] = MBL_SEGMENT_END_E; + destination[E_AXIS] = MBL_SEGMENT_END(E); // Do the split and look for more borders mesh_line_to_destination(fr_mm_s, x_splits, y_splits); @@ -13843,7 +13062,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - #define CELL_INDEX(A,V) ((V - bilinear_start[_AXIS(A)]) * ABL_BG_FACTOR(_AXIS(A))) + #define CELL_INDEX(A,V) ((V - bilinear_start[A##_AXIS]) * ABL_BG_FACTOR(A##_AXIS)) /** * Prepare a bilinear-leveled linear move on Cartesian, @@ -13867,11 +13086,10 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { return; } - #define LINE_SEGMENT_END(A) (current_position[_AXIS(A)] + (destination[_AXIS(A)] - current_position[_AXIS(A)]) * normalized_dist) - #define LINE_SEGMENT_END_E (current_position[E_CART] + (destination[E_CART] - current_position[E_CART]) * normalized_dist) + #define LINE_SEGMENT_END(A) (current_position[A ##_AXIS] + (destination[A ##_AXIS] - current_position[A ##_AXIS]) * normalized_dist) float normalized_dist, end[XYZE]; - const int8_t gcx = MAX(cx1, cx2), gcy = MAX(cy1, cy2); + const int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2); // Crosses on the X and not already split on this X? // The x_splits flags are insurance against rounding errors. @@ -13900,7 +13118,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { } destination[Z_AXIS] = LINE_SEGMENT_END(Z); - destination[E_CART] = LINE_SEGMENT_END_E; + destination[E_AXIS] = LINE_SEGMENT_END(E); // Do the split and look for more borders bilinear_line_to_destination(fr_mm_s, x_splits, y_splits); @@ -13916,25 +13134,11 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { #if !UBL_SEGMENTED #if IS_KINEMATIC - #if IS_SCARA - /** - * Before raising this value, use M665 S[seg_per_sec] to decrease - * the number of segments-per-second. Default is 200. Some deltas - * do better with 160 or lower. It would be good to know how many - * segments-per-second are actually possible for SCARA on AVR. - * - * Longer segments result in less kinematic overhead - * but may produce jagged lines. Try 0.5mm, 1.0mm, and 2.0mm - * and compare the difference. - */ - #define SCARA_MIN_SEGMENT_LENGTH 0.5f - #endif - /** - * Prepare a linear move in a DELTA, SCARA or HANGPRINTER setup. + * Prepare a linear move in a DELTA or SCARA setup. * * This calls planner.buffer_line several times, adding - * small incremental moves for DELTA, SCARA or HANGPRINTER. + * small incremental moves for DELTA or SCARA. * * For Unified Bed Leveling (Delta or Segmented Cartesian) * the ubl.prepare_segmented_line_to method replaces this. @@ -13945,18 +13149,10 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { const float _feedrate_mm_s = MMS_SCALED(feedrate_mm_s); const float xdiff = rtarget[X_AXIS] - current_position[X_AXIS], - ydiff = rtarget[Y_AXIS] - current_position[Y_AXIS] - #if ENABLED(HANGPRINTER) - , zdiff = rtarget[Z_AXIS] - current_position[Z_AXIS] - #endif - ; + ydiff = rtarget[Y_AXIS] - current_position[Y_AXIS]; - // If the move is only in Z/E (for Hangprinter only in E) don't split up the move - if (!xdiff && !ydiff - #if ENABLED(HANGPRINTER) - && !zdiff - #endif - ) { + // If the move is only in Z/E don't split up the move + if (!xdiff && !ydiff) { planner.buffer_line_kinematic(rtarget, _feedrate_mm_s, active_extruder); return false; // caller will update current_position } @@ -13965,17 +13161,14 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { if (!position_is_reachable(rtarget[X_AXIS], rtarget[Y_AXIS])) return true; // Remaining cartesian distances - const float - #if DISABLED(HANGPRINTER) - zdiff = rtarget[Z_AXIS] - current_position[Z_AXIS], - #endif - ediff = rtarget[E_CART] - current_position[E_CART]; + const float zdiff = rtarget[Z_AXIS] - current_position[Z_AXIS], + ediff = rtarget[E_AXIS] - current_position[E_AXIS]; // Get the linear distance in XYZ // If the move is very short, check the E move distance // No E move either? Game over. float cartesian_mm = SQRT(sq(xdiff) + sq(ydiff) + sq(zdiff)); - if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(ediff); + if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = FABS(ediff); if (UNEAR_ZERO(cartesian_mm)) return true; // Minimum number of seconds to move the given distance @@ -13985,16 +13178,16 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { // gives the number of segments uint16_t segments = delta_segments_per_second * seconds; - // For SCARA enforce a minimum segment size + // For SCARA minimum segment size is 0.25mm #if IS_SCARA - NOMORE(segments, cartesian_mm * (1.0f / float(SCARA_MIN_SEGMENT_LENGTH))); + NOMORE(segments, cartesian_mm * 4); #endif // At least one segment is required NOLESS(segments, 1); // The approximate length of each segment - const float inv_segments = 1.0f / float(segments), + const float inv_segments = 1.0 / float(segments), segment_distance[XYZE] = { xdiff * inv_segments, ydiff * inv_segments, @@ -14002,54 +13195,24 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { ediff * inv_segments }; - #if !HAS_FEEDRATE_SCALING - const float cartesian_segment_mm = cartesian_mm * inv_segments; - #endif + // SERIAL_ECHOPAIR("mm=", cartesian_mm); + // SERIAL_ECHOPAIR(" seconds=", seconds); + // SERIAL_ECHOLNPAIR(" segments=", segments); - /* - SERIAL_ECHOPAIR("mm=", cartesian_mm); - SERIAL_ECHOPAIR(" seconds=", seconds); - SERIAL_ECHOPAIR(" segments=", segments); - #if !HAS_FEEDRATE_SCALING - SERIAL_ECHOPAIR(" segment_mm=", cartesian_segment_mm); - #endif - SERIAL_EOL(); - //*/ - - #if HAS_FEEDRATE_SCALING + #if ENABLED(SCARA_FEEDRATE_SCALING) // SCARA needs to scale the feed rate from mm/s to degrees/s // i.e., Complete the angular vector in the given time. - const float segment_length = cartesian_mm * inv_segments, - inv_segment_length = 1.0f / segment_length, // 1/mm/segs + const float inv_segment_length = min(10.0, float(segments) / cartesian_mm), // 1/mm/segs inverse_secs = inv_segment_length * _feedrate_mm_s; - - float oldA = planner.position_float[A_AXIS], - oldB = planner.position_float[B_AXIS] - #if ENABLED(DELTA_FEEDRATE_SCALING) - , oldC = planner.position_float[C_AXIS] - #endif - ; - - /* - SERIAL_ECHOPGM("Scaled kinematic move: "); - SERIAL_ECHOPAIR(" segment_length (inv)=", segment_length); - SERIAL_ECHOPAIR(" (", inv_segment_length); - SERIAL_ECHOPAIR(") _feedrate_mm_s=", _feedrate_mm_s); - SERIAL_ECHOPAIR(" inverse_secs=", inverse_secs); - SERIAL_ECHOPAIR(" oldA=", oldA); - SERIAL_ECHOPAIR(" oldB=", oldB); - #if ENABLED(DELTA_FEEDRATE_SCALING) - SERIAL_ECHOPAIR(" oldC=", oldC); - #endif - SERIAL_EOL(); - safe_delay(5); - //*/ + float oldA = stepper.get_axis_position_degrees(A_AXIS), + oldB = stepper.get_axis_position_degrees(B_AXIS); #endif // Get the current position as starting point float raw[XYZE]; COPY(raw, current_position); + // Calculate and execute the segments while (--segments) { @@ -14061,10 +13224,8 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { } LOOP_XYZE(i) raw[i] += segment_distance[i]; - #if ENABLED(DELTA) && HOTENDS < 2 + #if ENABLED(DELTA) DELTA_IK(raw); // Delta can inline its kinematics - #elif ENABLED(HANGPRINTER) - HANGPRINTER_IK(raw); // Modifies line_lengths[ABCD] #else inverse_kinematics(raw); #endif @@ -14074,70 +13235,20 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { #if ENABLED(SCARA_FEEDRATE_SCALING) // For SCARA scale the feed rate from mm/s to degrees/s // i.e., Complete the angular vector in the given time. - if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], raw[Z_AXIS], raw[E_CART], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder, segment_length)) - break; - /* - SERIAL_ECHO(segments); - SERIAL_ECHOPAIR(": X=", raw[X_AXIS]); SERIAL_ECHOPAIR(" Y=", raw[Y_AXIS]); - SERIAL_ECHOPAIR(" A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); - SERIAL_ECHOLNPAIR(" F", HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs * 60); - safe_delay(5); - //*/ + planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], raw[Z_AXIS], raw[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder); oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; - #elif ENABLED(DELTA_FEEDRATE_SCALING) - // For DELTA scale the feed rate from Effector mm/s to Carriage mm/s - // i.e., Complete the linear vector in the given time. - if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], SQRT(sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC)) * inverse_secs, active_extruder, segment_length)) - break; - /* - SERIAL_ECHO(segments); - SERIAL_ECHOPAIR(": X=", raw[X_AXIS]); SERIAL_ECHOPAIR(" Y=", raw[Y_AXIS]); - SERIAL_ECHOPAIR(" A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); SERIAL_ECHOPAIR(" C=", delta[C_AXIS]); - SERIAL_ECHOLNPAIR(" F", SQRT(sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC)) * inverse_secs * 60); - safe_delay(5); - //*/ - oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; oldC = delta[C_AXIS]; - #elif ENABLED(HANGPRINTER) - if (!planner.buffer_line(line_lengths[A_AXIS], line_lengths[B_AXIS], line_lengths[C_AXIS], line_lengths[D_AXIS], raw[E_CART], _feedrate_mm_s, active_extruder, cartesian_segment_mm)) - break; #else - if (!planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_CART], _feedrate_mm_s, active_extruder, cartesian_segment_mm)) - break; + planner.buffer_line(delta[A_AXIS], delta[B_AXIS], raw[Z_AXIS], raw[E_AXIS], _feedrate_mm_s, active_extruder); #endif } // Ensure last segment arrives at target location. - #if HAS_FEEDRATE_SCALING + #if ENABLED(SCARA_FEEDRATE_SCALING) inverse_kinematics(rtarget); ADJUST_DELTA(rtarget); - #endif - - #if ENABLED(SCARA_FEEDRATE_SCALING) - const float diff2 = HYPOT2(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB); - if (diff2) { - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], rtarget[Z_AXIS], rtarget[E_CART], SQRT(diff2) * inverse_secs, active_extruder, segment_length); - /* - SERIAL_ECHOPAIR("final: A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); - SERIAL_ECHOPAIR(" adiff=", delta[A_AXIS] - oldA); SERIAL_ECHOPAIR(" bdiff=", delta[B_AXIS] - oldB); - SERIAL_ECHOLNPAIR(" F", SQRT(diff2) * inverse_secs * 60); - SERIAL_EOL(); - safe_delay(5); - //*/ - } - #elif ENABLED(DELTA_FEEDRATE_SCALING) - const float diff2 = sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC); - if (diff2) { - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], rtarget[E_AXIS], SQRT(diff2) * inverse_secs, active_extruder, segment_length); - /* - SERIAL_ECHOPAIR("final: A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); SERIAL_ECHOPAIR(" C=", delta[C_AXIS]); - SERIAL_ECHOPAIR(" adiff=", delta[A_AXIS] - oldA); SERIAL_ECHOPAIR(" bdiff=", delta[B_AXIS] - oldB); SERIAL_ECHOPAIR(" cdiff=", delta[C_AXIS] - oldC); - SERIAL_ECHOLNPAIR(" F", SQRT(diff2) * inverse_secs * 60); - SERIAL_EOL(); - safe_delay(5); - //*/ - } + planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], rtarget[Z_AXIS], rtarget[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder); #else - planner.buffer_line_kinematic(rtarget, _feedrate_mm_s, active_extruder, cartesian_segment_mm); + planner.buffer_line_kinematic(rtarget, _feedrate_mm_s, active_extruder); #endif return false; // caller will update current_position @@ -14198,7 +13309,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { case DXC_FULL_CONTROL_MODE: break; case DXC_AUTO_PARK_MODE: - if (current_position[E_CART] == destination[E_CART]) { + if (current_position[E_AXIS] == destination[E_AXIS]) { // This is a travel move (with no extrusion) // Skip it, but keep track of the current position // (so it can be used as the start of the next non-travel move) @@ -14211,14 +13322,14 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { } // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower for (uint8_t i = 0; i < 3; i++) - if (!planner.buffer_line( + planner.buffer_line( i == 0 ? raised_parked_position[X_AXIS] : current_position[X_AXIS], i == 0 ? raised_parked_position[Y_AXIS] : current_position[Y_AXIS], i == 2 ? current_position[Z_AXIS] : raised_parked_position[Z_AXIS], - current_position[E_CART], + current_position[E_AXIS], i == 1 ? PLANNER_XY_FEEDRATE() : planner.max_feedrate_mm_s[Z_AXIS], - active_extruder) - ) break; + active_extruder + ); delayed_move_time = 0; active_extruder_parked = false; #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -14235,14 +13346,19 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { } #endif // 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_CART]); - if (!planner.buffer_line( + planner.set_position_mm( + 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_CART], - planner.max_feedrate_mm_s[X_AXIS], 1) - ) break; - planner.synchronize(); + 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; #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -14265,28 +13381,29 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { * Prepare a single move and get ready for the next one * * This may result in several calls to planner.buffer_line to - * do smaller moves for DELTA, SCARA, HANGPRINTER, mesh moves, etc. + * do smaller moves for DELTA, SCARA, mesh moves, etc. * * Make sure current_position[E] and destination[E] are good * before calling or cold/lengthy extrusion may get missed. */ void prepare_move_to_destination() { clamp_to_software_endstops(destination); + refresh_cmd_timeout(); #if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE) if (!DEBUGGING(DRYRUN)) { - if (destination[E_CART] != current_position[E_CART]) { + if (destination[E_AXIS] != current_position[E_AXIS]) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (thermalManager.tooColdToExtrude(active_extruder)) { - current_position[E_CART] = destination[E_CART]; // Behave as if the move really took place, but ignore E part + current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); } #endif // PREVENT_COLD_EXTRUSION #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - if (ABS(destination[E_CART] - current_position[E_CART]) * planner.e_factor[active_extruder] > (EXTRUDE_MAXLENGTH)) { - current_position[E_CART] = destination[E_CART]; // Behave as if the move really took place, but ignore E part + if (FABS(destination[E_AXIS] - current_position[E_AXIS]) * planner.e_factor[active_extruder] > (EXTRUDE_MAXLENGTH)) { + current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); } @@ -14355,7 +13472,7 @@ void prepare_move_to_destination() { rt_X = cart[p_axis] - center_P, rt_Y = cart[q_axis] - center_Q, linear_travel = cart[l_axis] - current_position[l_axis], - extruder_travel = cart[E_CART] - current_position[E_CART]; + extruder_travel = cart[E_AXIS] - current_position[E_AXIS]; // CCW angle of rotation between position and target from the circle center. Only one atan2() trig computation required. float angular_travel = ATAN2(r_P * rt_Y - r_Q * rt_X, r_P * rt_X + r_Q * rt_Y); @@ -14366,9 +13483,8 @@ void prepare_move_to_destination() { if (angular_travel == 0 && current_position[p_axis] == cart[p_axis] && current_position[q_axis] == cart[q_axis]) angular_travel = RADIANS(360); - const float flat_mm = radius * angular_travel, - mm_of_travel = linear_travel ? HYPOT(flat_mm, linear_travel) : ABS(flat_mm); - if (mm_of_travel < 0.001f) return; + const 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)); NOLESS(segments, 1); @@ -14405,34 +13521,30 @@ void prepare_move_to_destination() { linear_per_segment = linear_travel / segments, extruder_per_segment = extruder_travel / segments, sin_T = theta_per_segment, - cos_T = 1 - 0.5f * sq(theta_per_segment); // Small angle approximation + cos_T = 1 - 0.5 * sq(theta_per_segment); // Small angle approximation // Initialize the linear axis raw[l_axis] = current_position[l_axis]; // Initialize the extruder axis - raw[E_CART] = current_position[E_CART]; + raw[E_AXIS] = current_position[E_AXIS]; const float fr_mm_s = MMS_SCALED(feedrate_mm_s); millis_t next_idle_ms = millis() + 200UL; - #if HAS_FEEDRATE_SCALING - // SCARA needs to scale the feed rate from mm/s to degrees/s - const float inv_segment_length = 1.0f / (MM_PER_ARC_SEGMENT), - inverse_secs = inv_segment_length * fr_mm_s; - float oldA = planner.position_float[A_AXIS], - oldB = planner.position_float[B_AXIS] - #if ENABLED(DELTA_FEEDRATE_SCALING) - , oldC = planner.position_float[C_AXIS] - #endif - ; - #endif - #if N_ARC_CORRECTION > 1 int8_t arc_recalc_count = N_ARC_CORRECTION; #endif + #if ENABLED(SCARA_FEEDRATE_SCALING) + // SCARA needs to scale the feed rate from mm/s to degrees/s + const float inv_segment_length = 1.0 / (MM_PER_ARC_SEGMENT), + inverse_secs = inv_segment_length * fr_mm_s; + float oldA = stepper.get_axis_position_degrees(A_AXIS), + oldB = stepper.get_axis_position_degrees(B_AXIS); + #endif + for (uint16_t i = 1; i < segments; i++) { // Iterate (segments-1) times thermalManager.manage_heater(); @@ -14468,70 +13580,48 @@ void prepare_move_to_destination() { raw[p_axis] = center_P + r_P; raw[q_axis] = center_Q + r_Q; raw[l_axis] += linear_per_segment; - raw[E_CART] += extruder_per_segment; + raw[E_AXIS] += extruder_per_segment; clamp_to_software_endstops(raw); - #if HAS_FEEDRATE_SCALING - inverse_kinematics(raw); - ADJUST_DELTA(raw); - #endif - #if ENABLED(SCARA_FEEDRATE_SCALING) // For SCARA scale the feed rate from mm/s to degrees/s // i.e., Complete the angular vector in the given time. - if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], raw[Z_AXIS], raw[E_CART], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder, MM_PER_ARC_SEGMENT)) - break; + inverse_kinematics(raw); + ADJUST_DELTA(raw); + planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], raw[Z_AXIS], raw[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder); oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; - #elif ENABLED(DELTA_FEEDRATE_SCALING) - // For DELTA scale the feed rate from Effector mm/s to Carriage mm/s - // i.e., Complete the linear vector in the given time. - if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], SQRT(sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC)) * inverse_secs, active_extruder, MM_PER_ARC_SEGMENT)) - break; - oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; oldC = delta[C_AXIS]; - #elif HAS_UBL_AND_CURVES - float pos[XYZ] = { raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS] }; - planner.apply_leveling(pos); - if (!planner.buffer_segment(pos[X_AXIS], pos[Y_AXIS], pos[Z_AXIS], raw[E_CART], fr_mm_s, active_extruder, MM_PER_ARC_SEGMENT)) - break; #else - if (!planner.buffer_line_kinematic(raw, fr_mm_s, active_extruder)) - break; + planner.buffer_line_kinematic(raw, fr_mm_s, active_extruder); #endif } // Ensure last segment arrives at target location. - #if HAS_FEEDRATE_SCALING + #if ENABLED(SCARA_FEEDRATE_SCALING) inverse_kinematics(cart); ADJUST_DELTA(cart); - #endif - - #if ENABLED(SCARA_FEEDRATE_SCALING) - const float diff2 = HYPOT2(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB); - if (diff2) - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], cart[Z_AXIS], cart[E_CART], SQRT(diff2) * inverse_secs, active_extruder, MM_PER_ARC_SEGMENT); - #elif ENABLED(DELTA_FEEDRATE_SCALING) - const float diff2 = sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC); - if (diff2) - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_CART], SQRT(diff2) * inverse_secs, active_extruder, MM_PER_ARC_SEGMENT); - #elif HAS_UBL_AND_CURVES - float pos[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] }; - planner.apply_leveling(pos); - planner.buffer_segment(pos[X_AXIS], pos[Y_AXIS], pos[Z_AXIS], cart[E_CART], fr_mm_s, active_extruder, MM_PER_ARC_SEGMENT); + planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], cart[Z_AXIS], cart[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder); #else planner.buffer_line_kinematic(cart, fr_mm_s, active_extruder); #endif - COPY(current_position, cart); + // 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 + // in any intermediate location. + set_current_from_destination(); } // plan_arc #endif // ARC_SUPPORT #if ENABLED(BEZIER_CURVE_SUPPORT) - void plan_cubic_move(const float (&cart)[XYZE], const float (&offset)[4]) { - cubic_b_spline(current_position, cart, offset, MMS_SCALED(feedrate_mm_s), active_extruder); - COPY(current_position, cart); + void plan_cubic_move(const float (&offset)[4]) { + cubic_b_spline(current_position, destination, offset, MMS_SCALED(feedrate_mm_s), active_extruder); + + // As far as the parser is concerned, the position is now == destination. In reality the + // motion control system might still be processing the action and the real tool position + // in any intermediate location. + set_current_from_destination(); } #endif // BEZIER_CURVE_SUPPORT @@ -14544,41 +13634,29 @@ void prepare_move_to_destination() { const millis_t ms = millis(); if (ELAPSED(ms, nextMotorCheck)) { nextMotorCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s - - // If any of the drivers or the bed are enabled... - if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON - #if HAS_HEATED_BED - || thermalManager.soft_pwm_amount_bed > 0 - #endif - #if HAS_X2_ENABLE - || X2_ENABLE_READ == X_ENABLE_ON - #endif - #if HAS_Y2_ENABLE - || Y2_ENABLE_READ == Y_ENABLE_ON - #endif - #if HAS_Z2_ENABLE - || Z2_ENABLE_READ == Z_ENABLE_ON - #endif - || E0_ENABLE_READ == E_ENABLE_ON + if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON || thermalManager.soft_pwm_amount_bed > 0 + || E0_ENABLE_READ == E_ENABLE_ON // If any of the drivers are enabled... #if E_STEPPERS > 1 || E1_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 2 - || E2_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 3 - || E3_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 4 - || E4_ENABLE_READ == E_ENABLE_ON - #endif - #endif + #if HAS_X2_ENABLE + || X2_ENABLE_READ == X_ENABLE_ON #endif - #endif + #if E_STEPPERS > 2 + || E2_ENABLE_READ == E_ENABLE_ON + #if E_STEPPERS > 3 + || E3_ENABLE_READ == E_ENABLE_ON + #if E_STEPPERS > 4 + || E4_ENABLE_READ == E_ENABLE_ON + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #endif // E_STEPPERS > 1 ) { lastMotorOn = ms; //... set time to NOW so the fan will turn on } // Fan off if no steppers have been enabled for CONTROLLERFAN_SECS seconds - const uint8_t speed = (lastMotorOn && PENDING(ms, lastMotorOn + (CONTROLLERFAN_SECS) * 1000UL)) ? CONTROLLERFAN_SPEED : 0; - controllerFanSpeed = speed; + uint8_t speed = (!lastMotorOn || ELAPSED(ms, lastMotorOn + (CONTROLLERFAN_SECS) * 1000UL)) ? 0 : CONTROLLERFAN_SPEED; // allows digital or PWM fan output to be used (see M42 handling) WRITE(CONTROLLER_FAN_PIN, speed); @@ -14678,7 +13756,7 @@ void prepare_move_to_destination() { if (ELAPSED(millis(), next_status_led_update_ms)) { next_status_led_update_ms += 500; // Update every 0.5s float max_temp = 0.0; - #if HAS_HEATED_BED + #if HAS_TEMP_BED max_temp = MAX3(max_temp, thermalManager.degTargetBed(), thermalManager.degBed()); #endif HOTEND_LOOP() @@ -14700,35 +13778,66 @@ void prepare_move_to_destination() { #endif +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + + void handle_filament_runout() { + if (!filament_ran_out) { + filament_ran_out = true; + enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT)); + stepper.synchronize(); + } + } + +#endif // FILAMENT_RUNOUT_SENSOR + +#if ENABLED(FAST_PWM_FAN) + + void setPwmFrequency(uint8_t pin, int val) { + val &= 0x07; + switch (digitalPinToTimer(pin)) { + #ifdef TCCR0A + #if !AVR_AT90USB1286_FAMILY + case TIMER0A: + #endif + case TIMER0B: //_SET_CS(0, val); + break; + #endif + #ifdef TCCR1A + case TIMER1A: case TIMER1B: //_SET_CS(1, val); + break; + #endif + #if defined(TCCR2) || defined(TCCR2A) + #ifdef TCCR2 + case TIMER2: + #endif + #ifdef TCCR2A + case TIMER2A: case TIMER2B: + #endif + _SET_CS(2, val); break; + #endif + #ifdef TCCR3A + case TIMER3A: case TIMER3B: case TIMER3C: _SET_CS(3, val); break; + #endif + #ifdef TCCR4A + case TIMER4A: case TIMER4B: case TIMER4C: _SET_CS(4, val); break; + #endif + #ifdef TCCR5A + case TIMER5A: case TIMER5B: case TIMER5C: _SET_CS(5, val); break; + #endif + } + } + +#endif // FAST_PWM_FAN + void enable_all_steppers() { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - #if ENABLED(HANGPRINTER) - enable_A(); - enable_B(); - enable_C(); - enable_D(); - #else - enable_X(); - enable_Y(); - enable_Z(); - enable_E4(); - #endif + enable_X(); + enable_Y(); + enable_Z(); enable_E0(); enable_E1(); enable_E2(); enable_E3(); -} - -void disable_e_stepper(const uint8_t e) { - switch (e) { - case 0: disable_E0(); break; - case 1: disable_E1(); break; - case 2: disable_E2(); break; - case 3: disable_E3(); break; - case 4: disable_E4(); break; - } + enable_E4(); } void disable_e_steppers() { @@ -14746,6 +13855,186 @@ void disable_all_steppers() { disable_e_steppers(); } +#if ENABLED(MONITOR_DRIVER_STATUS) + /* + * Check for over temperature or short to ground error flags. + * Report and log warning of overtemperature condition. + * Reduce driver current in a persistent otpw condition. + * Keep track of otpw counter so we don't reduce current on a single instance, + * and so we don't repeatedly report warning before the condition is cleared. + */ + + struct TMC_driver_data { + uint32_t drv_status; + bool is_otpw; + bool is_ot; + bool is_error; + }; + #if ENABLED(HAVE_TMC2130) + static uint32_t get_pwm_scale(TMC2130Stepper &st) { return st.PWM_SCALE(); } + static uint8_t get_status_response(TMC2130Stepper &st) { return st.status_response&0xF; } + static TMC_driver_data get_driver_data(TMC2130Stepper &st) { + constexpr uint32_t OTPW_bm = 0x4000000UL; + constexpr uint8_t OTPW_bp = 26; + constexpr uint32_t OT_bm = 0x2000000UL; + constexpr uint8_t OT_bp = 25; + constexpr uint8_t DRIVER_ERROR_bm = 0x2UL; + constexpr uint8_t DRIVER_ERROR_bp = 1; + TMC_driver_data data; + data.drv_status = st.DRV_STATUS(); + data.is_otpw = (data.drv_status & OTPW_bm)>>OTPW_bp; + data.is_ot = (data.drv_status & OT_bm)>>OT_bp; + data.is_error = (st.status_response & DRIVER_ERROR_bm)>>DRIVER_ERROR_bp; + return data; + } + #endif + #if ENABLED(HAVE_TMC2208) + static uint32_t get_pwm_scale(TMC2208Stepper &st) { return st.pwm_scale_sum(); } + static uint8_t get_status_response(TMC2208Stepper &st) { + uint32_t drv_status = st.DRV_STATUS(); + uint8_t gstat = st.GSTAT(); + uint8_t response = 0; + response |= (drv_status >> (31-3)) & 0b1000; + response |= gstat & 0b11; + return response; + } + static TMC_driver_data get_driver_data(TMC2208Stepper &st) { + constexpr uint32_t OTPW_bm = 0b1ul; + constexpr uint8_t OTPW_bp = 0; + constexpr uint32_t OT_bm = 0b10ul; + constexpr uint8_t OT_bp = 1; + TMC_driver_data data; + data.drv_status = st.DRV_STATUS(); + data.is_otpw = (data.drv_status & OTPW_bm)>>OTPW_bp; + data.is_ot = (data.drv_status & OT_bm)>>OT_bp; + data.is_error = st.drv_err(); + return data; + } + #endif + + template + uint8_t monitor_tmc_driver(TMC &st, const char axisID, uint8_t otpw_cnt) { + TMC_driver_data data = get_driver_data(st); + + #if ENABLED(STOP_ON_ERROR) + if (data.is_error) { + SERIAL_EOL(); + SERIAL_ECHO(axisID); + SERIAL_ECHO(" driver error detected:"); + if (data.is_ot) SERIAL_ECHO("\novertemperature"); + if (st.s2ga()) SERIAL_ECHO("\nshort to ground (coil A)"); + if (st.s2gb()) SERIAL_ECHO("\nshort to ground (coil B)"); + SERIAL_EOL(); + #if ENABLED(TMC_DEBUG) + gcode_M122(); + #endif + kill(PSTR("Driver error")); + } + #endif + + // Report if a warning was triggered + if (data.is_otpw && otpw_cnt==0) { + char timestamp[10]; + duration_t elapsed = print_job_timer.duration(); + const bool has_days = (elapsed.value > 60*60*24L); + (void)elapsed.toDigital(timestamp, has_days); + SERIAL_EOL(); + SERIAL_ECHO(timestamp); + SERIAL_ECHOPGM(": "); + SERIAL_ECHO(axisID); + SERIAL_ECHOPGM(" driver overtemperature warning! ("); + SERIAL_ECHO(st.getCurrent()); + SERIAL_ECHOLN("mA)"); + } + #if CURRENT_STEP_DOWN > 0 + // Decrease current if is_otpw is true and driver is enabled and there's been more then 4 warnings + if (data.is_otpw && !st.isEnabled() && otpw_cnt > 4) { + st.setCurrent(st.getCurrent() - CURRENT_STEP_DOWN, R_SENSE, HOLD_MULTIPLIER); + #if ENABLED(REPORT_CURRENT_CHANGE) + SERIAL_ECHO(axisID); + SERIAL_ECHOLNPAIR(" current decreased to ", st.getCurrent()); + #endif + } + #endif + + if (data.is_otpw) { + otpw_cnt++; + st.flag_otpw = true; + } + else if (otpw_cnt>0) otpw_cnt--; + + if (report_tmc_status) { + const uint32_t pwm_scale = get_pwm_scale(st); + SERIAL_ECHO(axisID); + SERIAL_ECHOPAIR(":", pwm_scale); + SERIAL_ECHO(" |0b"); MYSERIAL.print(get_status_response(st), BIN); + SERIAL_ECHO("| "); + if (data.is_error) SERIAL_ECHO('E'); + else if (data.is_ot) SERIAL_ECHO('O'); + else if (data.is_otpw) SERIAL_ECHO('W'); + else if (otpw_cnt>0) MYSERIAL.print(otpw_cnt, DEC); + else if (st.flag_otpw) SERIAL_ECHO('F'); + SERIAL_ECHO("\t"); + } + + return otpw_cnt; + } + + void monitor_tmc_driver() { + static millis_t next_cOT = 0; + if (ELAPSED(millis(), next_cOT)) { + next_cOT = millis() + 500; + #if ENABLED(X_IS_TMC2130)|| (ENABLED(X_IS_TMC2208) && defined(X_HARDWARE_SERIAL)) || ENABLED(IS_TRAMS) + static uint8_t x_otpw_cnt = 0; + x_otpw_cnt = monitor_tmc_driver(stepperX, axis_codes[X_AXIS], x_otpw_cnt); + #endif + #if ENABLED(Y_IS_TMC2130)|| (ENABLED(Y_IS_TMC2208) && defined(Y_HARDWARE_SERIAL)) || ENABLED(IS_TRAMS) + static uint8_t y_otpw_cnt = 0; + y_otpw_cnt = monitor_tmc_driver(stepperY, axis_codes[Y_AXIS], y_otpw_cnt); + #endif + #if ENABLED(Z_IS_TMC2130)|| (ENABLED(Z_IS_TMC2208) && defined(Z_HARDWARE_SERIAL)) || ENABLED(IS_TRAMS) + static uint8_t z_otpw_cnt = 0; + z_otpw_cnt = monitor_tmc_driver(stepperZ, axis_codes[Z_AXIS], z_otpw_cnt); + #endif + #if ENABLED(X2_IS_TMC2130) || (ENABLED(X2_IS_TMC2208) && defined(X2_HARDWARE_SERIAL)) + static uint8_t x2_otpw_cnt = 0; + x2_otpw_cnt = monitor_tmc_driver(stepperX2, axis_codes[X_AXIS], x2_otpw_cnt); + #endif + #if ENABLED(Y2_IS_TMC2130) || (ENABLED(Y2_IS_TMC2208) && defined(Y2_HARDWARE_SERIAL)) + static uint8_t y2_otpw_cnt = 0; + y2_otpw_cnt = monitor_tmc_driver(stepperY2, axis_codes[Y_AXIS], y2_otpw_cnt); + #endif + #if ENABLED(Z2_IS_TMC2130) || (ENABLED(Z2_IS_TMC2208) && defined(Z2_HARDWARE_SERIAL)) + static uint8_t z2_otpw_cnt = 0; + z2_otpw_cnt = monitor_tmc_driver(stepperZ2, axis_codes[Z_AXIS], z2_otpw_cnt); + #endif + #if ENABLED(E0_IS_TMC2130)|| (ENABLED(E0_IS_TMC2208) && defined(E0_HARDWARE_SERIAL)) || ENABLED(IS_TRAMS) + static uint8_t e0_otpw_cnt = 0; + e0_otpw_cnt = monitor_tmc_driver(stepperE0, axis_codes[E_AXIS], e0_otpw_cnt); + #endif + #if ENABLED(E1_IS_TMC2130) || (ENABLED(E1_IS_TMC2208) && defined(E1_HARDWARE_SERIAL)) + static uint8_t e1_otpw_cnt = 0; + e1_otpw_cnt = monitor_tmc_driver(stepperE1, axis_codes[E_AXIS], e1_otpw_cnt); + #endif + #if ENABLED(E2_IS_TMC2130) || (ENABLED(E2_IS_TMC2208) && defined(E2_HARDWARE_SERIAL)) + static uint8_t e2_otpw_cnt = 0; + e2_otpw_cnt = monitor_tmc_driver(stepperE2, axis_codes[E_AXIS], e2_otpw_cnt); + #endif + #if ENABLED(E3_IS_TMC2130) || (ENABLED(E3_IS_TMC2208) && defined(E3_HARDWARE_SERIAL)) + static uint8_t e3_otpw_cnt = 0; + e3_otpw_cnt = monitor_tmc_driver(stepperE3, axis_codes[E_AXIS], e3_otpw_cnt); + #endif + #if ENABLED(E4_IS_TMC2130) || (ENABLED(E4_IS_TMC2208) && defined(E4_HARDWARE_SERIAL)) + static uint8_t e4_otpw_cnt = 0; + e4_otpw_cnt = monitor_tmc_driver(stepperE4, axis_codes[E_AXIS], e4_otpw_cnt); + #endif + + if (report_tmc_status) SERIAL_EOL(); + } + } + +#endif // MONITOR_DRIVER_STATUS + /** * Manage several activities: * - Check for Filament Runout @@ -14758,10 +14047,11 @@ void disable_all_steppers() { * - Check if cooling fan needs to be switched on * - Check if an idle but hot extruder needs filament extruded (EXTRUDER_RUNOUT_PREVENT) */ -void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { +void manage_inactivity(bool ignore_stepper_queue/*=false*/) { #if ENABLED(FILAMENT_RUNOUT_SENSOR) - runout.run(); + if ((IS_SD_PRINTING || print_job_timer.isRunning()) && (READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING)) + handle_filament_runout(); #endif #if ENABLED(ANYCUBIC_TFT_MODEL) && ENABLED(ANYCUBIC_FILAMENT_RUNOUT_SENSOR) @@ -14772,7 +14062,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { const millis_t ms = millis(); - if (max_inactive_time && ELAPSED(ms, previous_move_ms + max_inactive_time)) { + if (max_inactive_time && ELAPSED(ms, previous_cmd_ms + max_inactive_time)) { SERIAL_ERROR_START(); SERIAL_ECHOLNPAIR(MSG_KILL_INACTIVE_TIME, parser.command_ptr); kill(PSTR(MSG_KILLED)); @@ -14780,31 +14070,28 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { // Prevent steppers timing-out in the middle of M600 #if ENABLED(ADVANCED_PAUSE_FEATURE) && ENABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT) - #define MOVE_AWAY_TEST !did_pause_print + #define MOVE_AWAY_TEST !move_away_flag #else #define MOVE_AWAY_TEST true #endif - if (stepper_inactive_time) { - if (planner.has_blocks_queued()) - previous_move_ms = ms; // reset_stepper_timeout to keep steppers powered - else if (MOVE_AWAY_TEST && !ignore_stepper_queue && ELAPSED(ms, previous_move_ms + stepper_inactive_time)) { - #if ENABLED(DISABLE_INACTIVE_X) - disable_X(); - #endif - #if ENABLED(DISABLE_INACTIVE_Y) - disable_Y(); - #endif - #if ENABLED(DISABLE_INACTIVE_Z) - disable_Z(); - #endif - #if ENABLED(DISABLE_INACTIVE_E) - disable_e_steppers(); - #endif - #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL) // Only needed with an LCD - if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false; - #endif - } + if (MOVE_AWAY_TEST && stepper_inactive_time && ELAPSED(ms, previous_cmd_ms + stepper_inactive_time) + && !ignore_stepper_queue && !planner.blocks_queued()) { + #if ENABLED(DISABLE_INACTIVE_X) + disable_X(); + #endif + #if ENABLED(DISABLE_INACTIVE_Y) + disable_Y(); + #endif + #if ENABLED(DISABLE_INACTIVE_Z) + disable_Z(); + #endif + #if ENABLED(DISABLE_INACTIVE_E) + disable_e_steppers(); + #endif + #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL) // Only needed with an LCD + ubl.lcd_map_control = defer_return_to_status = false; + #endif } #ifdef CHDK // Check if pin should be set to LOW after M240 set it to HIGH @@ -14841,7 +14128,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { // --------------------------------------------------------- static int homeDebounceCount = 0; // poor man's debouncing count const int HOME_DEBOUNCE_DELAY = 2500; - if (!IS_SD_PRINTING() && !READ(HOME_PIN)) { + if (!IS_SD_PRINTING && !READ(HOME_PIN)) { if (!homeDebounceCount) { enqueue_and_echo_commands_P(PSTR("G28")); LCD_MESSAGEPGM(MSG_AUTO_HOME); @@ -14857,26 +14144,12 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { controllerFan(); // Check if fan should be turned on to cool stepper drivers down #endif - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.check(); - #endif - #if ENABLED(EXTRUDER_RUNOUT_PREVENT) - if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP - && ELAPSED(ms, previous_move_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL) - && !planner.has_blocks_queued() - ) { + if (ELAPSED(ms, previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL) + && thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) { #if ENABLED(SWITCHING_EXTRUDER) - bool oldstatus; - switch (active_extruder) { - default: oldstatus = E0_ENABLE_READ; enable_E0(); break; - #if E_STEPPERS > 1 - case 2: case 3: oldstatus = E1_ENABLE_READ; enable_E1(); break; - #if E_STEPPERS > 2 - case 4: oldstatus = E2_ENABLE_READ; enable_E2(); break; - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - } + const bool oldstatus = E0_ENABLE_READ; + enable_E0(); #else // !SWITCHING_EXTRUDER bool oldstatus; switch (active_extruder) { @@ -14896,24 +14169,17 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { } #endif // !SWITCHING_EXTRUDER - const float olde = current_position[E_CART]; - current_position[E_CART] += EXTRUDER_RUNOUT_EXTRUDE; - planner.buffer_line_kinematic(current_position, MMM_TO_MMS(EXTRUDER_RUNOUT_SPEED), active_extruder); - current_position[E_CART] = olde; - planner.set_e_position_mm(olde); - planner.synchronize(); + previous_cmd_ms = ms; // refresh_cmd_timeout() + const float olde = current_position[E_AXIS]; + current_position[E_AXIS] += EXTRUDER_RUNOUT_EXTRUDE; + planner.buffer_line_kinematic(current_position, MMM_TO_MMS(EXTRUDER_RUNOUT_SPEED), active_extruder); + current_position[E_AXIS] = olde; + planner.set_e_position_mm(olde); + stepper.synchronize(); #if ENABLED(SWITCHING_EXTRUDER) - switch (active_extruder) { - default: oldstatus = E0_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 1 - case 2: case 3: oldstatus = E1_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 2 - case 4: oldstatus = E2_ENABLE_WRITE(oldstatus); break; - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - } - #else // !SWITCHING_EXTRUDER + E0_ENABLE_WRITE(oldstatus); + #else switch (active_extruder) { case 0: E0_ENABLE_WRITE(oldstatus); break; #if E_STEPPERS > 1 @@ -14930,8 +14196,6 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { #endif // E_STEPPERS > 1 } #endif // !SWITCHING_EXTRUDER - - previous_move_ms = ms; // reset_stepper_timeout to keep steppers powered } #endif // EXTRUDER_RUNOUT_PREVENT @@ -14965,8 +14229,8 @@ void idle( #endif ) { #if ENABLED(MAX7219_DEBUG) - max7219.idle_tasks(); - #endif + Max7219_idle_tasks(); + #endif // MAX7219_DEBUG #ifdef ANYCUBIC_TFT_MODEL AnycubicTFT.CommandScan(); @@ -14976,6 +14240,10 @@ void idle( host_keepalive(); + #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED) + thermalManager.auto_report_temperatures(); + #endif + manage_inactivity( #if ENABLED(ADVANCED_PAUSE_FEATURE) no_stepper_sleep @@ -14993,21 +14261,12 @@ void idle( #endif #if ENABLED(I2C_POSITION_ENCODERS) - static millis_t i2cpem_next_update_ms; - if (planner.has_blocks_queued() && ELAPSED(millis(), i2cpem_next_update_ms)) { + if (planner.blocks_queued() && + ( (blockBufferIndexRef != planner.block_buffer_head) || + ((lastUpdateMillis + I2CPE_MIN_UPD_TIME_MS) < millis())) ) { + blockBufferIndexRef = planner.block_buffer_head; I2CPEM.update(); - i2cpem_next_update_ms = millis() + I2CPE_MIN_UPD_TIME_MS; - } - #endif - - #if HAS_AUTO_REPORTING - if (!suspend_auto_report) { - #if ENABLED(AUTO_REPORT_TEMPERATURES) - thermalManager.auto_report_temperatures(); - #endif - #if ENABLED(AUTO_REPORT_SD_STATUS) - card.auto_report_sd_status(); - #endif + lastUpdateMillis = millis(); } #endif } @@ -15045,7 +14304,7 @@ void kill(const char* lcd_msg) { #endif #if HAS_POWER_SWITCH - PSU_OFF(); + SET_INPUT(PS_ON_PIN); #endif suicide(); @@ -15099,7 +14358,7 @@ void stop() { void setup() { #if ENABLED(MAX7219_DEBUG) - max7219.init(); + Max7219_init(); #endif #if ENABLED(DISABLE_JTAG) @@ -15109,7 +14368,7 @@ void setup() { #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) - runout.setup(); + setup_filrunoutpin(); #endif setup_killpin(); @@ -15120,7 +14379,7 @@ void setup() { disableStepperDrivers(); #endif - MYSERIAL0.begin(BAUDRATE); + MYSERIAL.begin(BAUDRATE); SERIAL_PROTOCOLLNPGM("start"); SERIAL_ECHO_START(); @@ -15129,11 +14388,7 @@ void setup() { AnycubicTFT.Setup(); #endif - // Prepare communication for TMC drivers - #if HAS_DRIVER(TMC2130) - tmc_init_cs_pins(); - #endif - #if HAS_DRIVER(TMC2208) + #if ENABLED(HAVE_TMC2208) tmc2208_serial_begin(); #endif @@ -15162,7 +14417,7 @@ void setup() { SERIAL_ECHO_START(); SERIAL_ECHOPAIR(MSG_FREE_MEMORY, freeMemory()); - SERIAL_ECHOLNPAIR(MSG_PLANNER_BUFFER_BYTES, int(sizeof(block_t))*(BLOCK_BUFFER_SIZE)); + SERIAL_ECHOLNPAIR(MSG_PLANNER_BUFFER_BYTES, (int)sizeof(block_t)*BLOCK_BUFFER_SIZE); // Send "ok" after commands by default for (int8_t i = 0; i < BUFSIZE; i++) send_ok[i] = true; @@ -15183,13 +14438,12 @@ void setup() { thermalManager.init(); // Initialize temperature loop - print_job_timer.init(); // Initial setup of print job timer + #if ENABLED(USE_WATCHDOG) + watchdog_init(); + #endif - endstops.init(); // Init endstops and pullups - - stepper.init(); // Init stepper. This enables interrupts! - - servo_init(); // Initialize all servos, stow servo probe + stepper.init(); // Initialize stepper, this enables interrupts! + servo_init(); #if HAS_PHOTOGRAPH OUT_WRITE(PHOTOGRAPH_PIN, LOW); @@ -15272,7 +14526,6 @@ void setup() { #endif lcd_init(); - lcd_reset_status(); #if ENABLED(SHOW_BOOTSCREEN) lcd_bootscreen(); @@ -15299,6 +14552,7 @@ void setup() { #if ENABLED(BLTOUCH) // Make sure any BLTouch error condition is cleared bltouch_command(BLTOUCH_RESET); + set_bltouch_deployed(true); set_bltouch_deployed(false); #endif @@ -15311,7 +14565,11 @@ void setup() { i2c.onRequest(i2c_on_request); #endif - #if DO_SWITCH_EXTRUDER + #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) + setup_endstop_interrupts(); + #endif + + #if ENABLED(SWITCHING_EXTRUDER) && !DONT_SWITCH move_extruder_servo(0); // Initialize extruder servo #endif @@ -15328,24 +14586,11 @@ void setup() { pe_deactivate_magnet(1); #endif #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - check_print_job_recovery(); - #endif - - #if ENABLED(USE_WATCHDOG) - watchdog_init(); - #endif - - #if ENABLED(HANGPRINTER) - enable_A(); - enable_B(); - enable_C(); - enable_D(); - #endif - - #if ENABLED(SDSUPPORT) && DISABLED(ULTRA_LCD) - card.beginautostart(); + #if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) + SET_OUTPUT(LCD_PINS_DC); + OUT_WRITE(LCD_PINS_RS, LOW); + delay(1000); + WRITE(LCD_PINS_RS, HIGH); #endif } @@ -15353,7 +14598,6 @@ void setup() { /** * The main Marlin program loop * - * - Abort SD printing if flagged * - Save or log commands to SD * - Process available commands (if not saving) * - Call heater manager @@ -15362,33 +14606,11 @@ void setup() { * - Call LCD update */ void loop() { + if (commands_in_queue < BUFSIZE) get_available_commands(); #if ENABLED(SDSUPPORT) - - card.checkautostart(); - - if (card.abort_sd_printing) { - card.stopSDPrint( - #if SD_RESORT - true - #endif - ); - clear_command_queue(); - quickstop_stepper(); - print_job_timer.stop(); - thermalManager.disable_all_heaters(); - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; - #endif - wait_for_heatup = false; - #if ENABLED(POWER_LOSS_RECOVERY) - card.removeJobRecoveryFile(); - #endif - } - - #endif // SDSUPPORT - - if (commands_in_queue < BUFSIZE) get_available_commands(); + card.checkautostart(false); + #endif if (commands_in_queue) { @@ -15401,13 +14623,12 @@ void loop() { card.closefile(); SERIAL_PROTOCOLLNPGM(MSG_FILE_SAVED); - #if USE_MARLINSERIAL - #if ENABLED(SERIAL_STATS_DROPPED_RX) - SERIAL_ECHOLNPAIR("Dropped bytes: ", customizedSerial.dropped()); - #endif - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - SERIAL_ECHOLNPAIR("Max RX Queue Size: ", customizedSerial.rxMaxEnqueued()); - #endif + #if ENABLED(SERIAL_STATS_DROPPED_RX) + SERIAL_ECHOLNPAIR("Dropped bytes: ", customizedSerial.dropped()); + #endif + + #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) + SERIAL_ECHOLNPAIR("Max RX Queue Size: ", customizedSerial.rxMaxEnqueued()); #endif ok_to_send(); @@ -15421,12 +14642,8 @@ void loop() { ok_to_send(); } } - else { + else process_next_command(); - #if ENABLED(POWER_LOSS_RECOVERY) - if (card.cardOK && card.sdprinting) save_job_recovery_info(); - #endif - } #else @@ -15440,7 +14657,7 @@ void loop() { if (++cmd_queue_index_r >= BUFSIZE) cmd_queue_index_r = 0; } } - endstops.event_handler(); + endstops.report_state(); idle(); #ifdef ANYCUBIC_TFT_MODEL diff --git a/Marlin/Max7219_Debug_LEDs.cpp b/Marlin/Max7219_Debug_LEDs.cpp index 2be4bfd..b38a75d 100644 --- a/Marlin/Max7219_Debug_LEDs.cpp +++ b/Marlin/Max7219_Debug_LEDs.cpp @@ -22,569 +22,325 @@ /** * This module is off by default, but can be enabled to facilitate the display of - * extra debug information during code development. + * extra debug information during code development. It assumes the existence of a + * Max7219 LED Matrix. A suitable device can be obtained on eBay similar to this: + * http://www.ebay.com/itm/191781645249 for under $2.00 including shipping. * - * Just connect up 5V and GND to give it power, then connect up the pins assigned + * Just connect up +5v and GND to give it power, then connect up the pins assigned * in Configuration_adv.h. For example, on the Re-ARM you could use: * * #define MAX7219_CLK_PIN 77 * #define MAX7219_DIN_PIN 78 * #define MAX7219_LOAD_PIN 79 * - * send() is called automatically at startup, and then there are a number of + * Max7219_init() is called automatically at startup, and then there are a number of * support functions available to control the LEDs in the 8x8 grid. + * + * void Max7219_init(); + * void Max7219_PutByte(uint8_t data); + * void Max7219(uint8_t reg, uint8_t data); + * void Max7219_LED_On(uint8_t col, uint8_t row); + * void Max7219_LED_Off(uint8_t col, uint8_t row); + * void Max7219_LED_Toggle(uint8_t col, uint8_t row); + * void Max7219_Clear_Row(uint8_t row); + * void Max7219_Clear_Column(uint8_t col); + * void Max7219_Set_Row(uint8_t row, uint8_t val); + * void Max7219_Set_2_Rows(uint8_t row, uint16_t val); + * void Max7219_Set_4_Rows(uint8_t row, uint32_t val); + * void Max7219_Set_Column(uint8_t col, uint8_t val); + * void Max7219_idle_tasks(); */ #include "MarlinConfig.h" #if ENABLED(MAX7219_DEBUG) -#define MAX7219_ERRORS // Disable to save 406 bytes of Program Memory - #include "Max7219_Debug_LEDs.h" #include "planner.h" #include "stepper.h" #include "Marlin.h" -#include "delay.h" -Max7219 max7219; - -uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 }; - -#define LINE_REG(Q) (max7219_reg_digit0 + ((Q) & 0x7)) -#if _ROT == 0 || _ROT == 270 - #define _LED_BIT(Q) (7 - ((Q) & 0x7)) - #define _LED_UNIT(Q) ((Q) & ~0x7) -#else - #define _LED_BIT(Q) ((Q) & 0x7) - #define _LED_UNIT(Q) ((MAX7219_NUMBER_UNITS - 1 - ((Q) >> 3)) << 3) -#endif -#if _ROT < 180 - #define _LED_IND(P,Q) (_LED_UNIT(P) + (Q)) -#else - #define _LED_IND(P,Q) (_LED_UNIT(P) + (7 - ((Q) & 0x7))) -#endif -#if _ROT == 0 || _ROT == 180 - #define LED_IND(X,Y) _LED_IND(X,Y) - #define LED_BIT(X,Y) _LED_BIT(X) -#elif _ROT == 90 || _ROT == 270 - #define LED_IND(X,Y) _LED_IND(Y,X) - #define LED_BIT(X,Y) _LED_BIT(Y) -#endif -#define XOR_7219(X,Y) do{ led_line[LED_IND(X,Y)] ^= _BV(LED_BIT(X,Y)); }while(0) -#define SET_7219(X,Y) do{ led_line[LED_IND(X,Y)] |= _BV(LED_BIT(X,Y)); }while(0) -#define CLR_7219(X,Y) do{ led_line[LED_IND(X,Y)] &= ~_BV(LED_BIT(X,Y)); }while(0) -#define BIT_7219(X,Y) TEST(led_line[LED_IND(X,Y)], LED_BIT(X,Y)) +static uint8_t LEDs[8] = { 0 }; #ifdef CPU_32_BIT - #define SIG_DELAY() DELAY_US(1) // Approximate a 1µs delay on 32-bit ARM - #undef CRITICAL_SECTION_START - #undef CRITICAL_SECTION_END - #define CRITICAL_SECTION_START NOOP - #define CRITICAL_SECTION_END NOOP + #define MS_DELAY() delayMicroseconds(5) // 32-bit processors need a delay to stabilize the signal #else - #define SIG_DELAY() DELAY_NS(188) // Delay for 0.1875µs (16MHz AVR) or 0.15µs (20MHz AVR) + #define MS_DELAY() NOOP #endif -void Max7219::error(const char * const func, const int32_t v1, const int32_t v2/*=-1*/) { - #if ENABLED(MAX7219_ERRORS) - SERIAL_ECHOPGM("??? Max7219::"); - serialprintPGM(func); - SERIAL_CHAR('('); - SERIAL_ECHO(v1); - if (v2 > 0) SERIAL_ECHOPAIR(", ", v2); - SERIAL_CHAR(')'); - SERIAL_EOL(); - #else - UNUSED(func); UNUSED(v1); UNUSED(v2); - #endif -} - -/** - * Flip the lowest n_bytes of the supplied bits: - * flipped(x, 1) flips the low 8 bits of x. - * flipped(x, 2) flips the low 16 bits of x. - * flipped(x, 3) flips the low 24 bits of x. - * flipped(x, 4) flips the low 32 bits of x. - */ -inline uint32_t flipped(const uint32_t bits, const uint8_t n_bytes) { - uint32_t mask = 1, outbits = 0; - for (uint8_t b = 0; b < n_bytes * 8; b++) { - outbits <<= 1; - if (bits & mask) outbits |= 1; - mask <<= 1; - } - return outbits; -} - -void Max7219::noop() { - CRITICAL_SECTION_START; - SIG_DELAY(); - WRITE(MAX7219_DIN_PIN, LOW); - for (uint8_t i = 16; i--;) { - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, LOW); - SIG_DELAY(); - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, HIGH); - SIG_DELAY(); - } - CRITICAL_SECTION_END; -} - -void Max7219::putbyte(uint8_t data) { - CRITICAL_SECTION_START; +void Max7219_PutByte(uint8_t data) { + CRITICAL_SECTION_START for (uint8_t i = 8; i--;) { - SIG_DELAY(); + MS_DELAY(); WRITE(MAX7219_CLK_PIN, LOW); // tick - SIG_DELAY(); + MS_DELAY(); WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW); // send 1 or 0 based on data bit - SIG_DELAY(); + MS_DELAY(); WRITE(MAX7219_CLK_PIN, HIGH); // tock - SIG_DELAY(); + MS_DELAY(); data <<= 1; } - CRITICAL_SECTION_END; + CRITICAL_SECTION_END } -void Max7219::pulse_load() { - SIG_DELAY(); - WRITE(MAX7219_LOAD_PIN, LOW); // tell the chip to load the data - SIG_DELAY(); +void Max7219(const uint8_t reg, const uint8_t data) { + MS_DELAY(); + CRITICAL_SECTION_START + WRITE(MAX7219_LOAD_PIN, LOW); // begin + MS_DELAY(); + Max7219_PutByte(reg); // specify register + MS_DELAY(); + Max7219_PutByte(data); // put data + MS_DELAY(); + WRITE(MAX7219_LOAD_PIN, LOW); // and tell the chip to load the data + MS_DELAY(); WRITE(MAX7219_LOAD_PIN, HIGH); - SIG_DELAY(); + CRITICAL_SECTION_END + MS_DELAY(); } -void Max7219::send(const uint8_t reg, const uint8_t data) { - SIG_DELAY(); - CRITICAL_SECTION_START; - SIG_DELAY(); - putbyte(reg); // specify register - SIG_DELAY(); - putbyte(data); // put data - CRITICAL_SECTION_END; -} - -// Send out a single native row of bits to all units -void Max7219::refresh_line(const uint8_t line) { - for (uint8_t u = MAX7219_NUMBER_UNITS; u--;) - send(LINE_REG(line), led_line[(u << 3) | (line & 0x7)]); - pulse_load(); -} - -// Send out a single native row of bits to just one unit -void Max7219::refresh_unit_line(const uint8_t line) { - for (uint8_t u = MAX7219_NUMBER_UNITS; u--;) - if (u == (line >> 3)) send(LINE_REG(line), led_line[line]); else noop(); - pulse_load(); -} - -void Max7219::set(const uint8_t line, const uint8_t bits) { - led_line[line] = bits; - refresh_line(line); -} - -#if ENABLED(MAX7219_NUMERIC) - - // Draw an integer with optional leading zeros and optional decimal point - void Max7219::print(const uint8_t start, int16_t value, uint8_t size, const bool leadzero=false, bool dec=false) { - constexpr uint8_t led_numeral[10] = { 0x7E, 0x60, 0x6D, 0x79, 0x63, 0x5B, 0x5F, 0x70, 0x7F, 0x7A }, - led_decimal = 0x80, led_minus = 0x01; - - bool blank = false, neg = value < 0; - if (neg) value *= -1; - while (size--) { - const bool minus = neg && blank; - if (minus) neg = false; - send( - max7219_reg_digit0 + start + size, - minus ? led_minus : blank ? 0x00 : led_numeral[value % 10] | (dec ? led_decimal : 0x00) - ); - pulse_load(); // tell the chips to load the clocked out data - value /= 10; - if (!value && !leadzero) blank = true; - dec = false; - } +void Max7219_LED_Set(const uint8_t row, const uint8_t col, const bool on) { + if (row > 7 || col > 7) { + SERIAL_ECHOPAIR("??? Max7219_LED_Set(", (int)row); + SERIAL_ECHOPAIR(",", (int)col); + SERIAL_ECHOLNPGM(")"); + return; } + if (TEST(LEDs[row], col) == on) return; // if LED is already on/off, leave alone + if (on) SBI(LEDs[row], col); else CBI(LEDs[row], col); + Max7219(8 - row, LEDs[row]); +} - // Draw a float with a decimal point and optional digits - void Max7219::print(const uint8_t start, const float value, const uint8_t pre_size, const uint8_t post_size, const bool leadzero=false) { - if (pre_size) print(start, value, pre_size, leadzero, !!post_size); - if (post_size) { - const int16_t after = ABS(value) * (10 ^ post_size); - print(start + pre_size, after, post_size, true); - } +void Max7219_LED_On(const uint8_t col, const uint8_t row) { + if (row > 7 || col > 7) { + SERIAL_ECHOPAIR("??? Max7219_LED_On(", (int)col); + SERIAL_ECHOPAIR(",", (int)row); + SERIAL_ECHOLNPGM(")"); + return; } - -#endif // MAX7219_NUMERIC - -// Modify a single LED bit and send the changed line -void Max7219::led_set(const uint8_t x, const uint8_t y, const bool on) { - if (x > MAX7219_X_LEDS - 1 || y > MAX7219_Y_LEDS - 1) return error(PSTR("led_set"), x, y); - if (BIT_7219(x, y) == on) return; - XOR_7219(x, y); - refresh_line(LED_IND(x, y)); + Max7219_LED_Set(col, row, true); } -void Max7219::led_on(const uint8_t x, const uint8_t y) { - if (x > MAX7219_X_LEDS - 1 || y > MAX7219_Y_LEDS - 1) return error(PSTR("led_on"), x, y); - led_set(x, y, true); -} - -void Max7219::led_off(const uint8_t x, const uint8_t y) { - if (x > MAX7219_X_LEDS - 1 || y > MAX7219_Y_LEDS - 1) return error(PSTR("led_off"), x, y); - led_set(x, y, false); -} - -void Max7219::led_toggle(const uint8_t x, const uint8_t y) { - if (x > MAX7219_X_LEDS - 1 || y > MAX7219_Y_LEDS - 1) return error(PSTR("led_toggle"), x, y); - led_set(x, y, !BIT_7219(x, y)); -} - -void Max7219::send_row(const uint8_t row) { - #if _ROT == 0 || _ROT == 180 - refresh_line(LED_IND(0, row)); - #else - UNUSED(row); - refresh(); - #endif -} - -void Max7219::send_column(const uint8_t col) { - #if _ROT == 90 || _ROT == 270 - refresh_line(LED_IND(col, 0)); - #else - UNUSED(col); - refresh(); - #endif -} - -void Max7219::clear() { - ZERO(led_line); - refresh(); -} - -void Max7219::fill() { - memset(led_line, 0xFF, sizeof(led_line)); - refresh(); -} - -void Max7219::clear_row(const uint8_t row) { - if (row >= MAX7219_Y_LEDS) return error(PSTR("clear_row"), row); - for (uint8_t x = 0; x < MAX7219_X_LEDS; x++) CLR_7219(x, row); - send_row(row); -} - -void Max7219::clear_column(const uint8_t col) { - if (col >= MAX7219_X_LEDS) return error(PSTR("set_column"), col); - for (uint8_t y = 0; y < MAX7219_Y_LEDS; y++) CLR_7219(col, y); - send_column(col); -} - -/** - * Plot the low order bits of val to the specified row of the matrix. - * With 4 Max7219 units in the chain, it's possible to set 32 bits at once with - * one call to the function (if rotated 90° or 180°). - */ -void Max7219::set_row(const uint8_t row, const uint32_t val) { - if (row >= MAX7219_Y_LEDS) return error(PSTR("set_row"), row); - uint32_t mask = _BV32(MAX7219_X_LEDS - 1); - for (uint8_t x = 0; x < MAX7219_X_LEDS; x++) { - if (val & mask) SET_7219(x, row); else CLR_7219(x, row); - mask >>= 1; +void Max7219_LED_Off(const uint8_t col, const uint8_t row) { + if (row > 7 || col > 7) { + SERIAL_ECHOPAIR("??? Max7219_LED_Off(", (int)row); + SERIAL_ECHOPAIR(",", (int)col); + SERIAL_ECHOLNPGM(")"); + return; } - send_row(row); + Max7219_LED_Set(col, row, false); } -/** - * Plot the low order bits of val to the specified column of the matrix. - * With 4 Max7219 units in the chain, it's possible to set 32 bits at once with - * one call to the function (if rotated 90° or 180°). - */ -void Max7219::set_column(const uint8_t col, const uint32_t val) { - if (col >= MAX7219_X_LEDS) return error(PSTR("set_column"), col); - uint32_t mask = _BV32(MAX7219_Y_LEDS - 1); - for (uint8_t y = 0; y < MAX7219_Y_LEDS; y++) { - if (val & mask) SET_7219(col, y); else CLR_7219(col, y); - mask >>= 1; +void Max7219_LED_Toggle(const uint8_t col, const uint8_t row) { + if (row > 7 || col > 7) { + SERIAL_ECHOPAIR("??? Max7219_LED_Toggle(", (int)row); + SERIAL_ECHOPAIR(",", (int)col); + SERIAL_ECHOLNPGM(")"); + return; } - send_column(col); + if (TEST(LEDs[row], col)) + Max7219_LED_Off(col, row); + else + Max7219_LED_On(col, row); } -void Max7219::set_rows_16bits(const uint8_t y, uint32_t val) { - #if MAX7219_X_LEDS == 8 - if (y > MAX7219_Y_LEDS - 2) return error(PSTR("set_rows_16bits"), y, val); - set_row(y + 1, val); val >>= 8; - set_row(y + 0, val); - #else // at least 16 bits on each row - if (y > MAX7219_Y_LEDS - 1) return error(PSTR("set_rows_16bits"), y, val); - set_row(y, val); - #endif -} - -void Max7219::set_rows_32bits(const uint8_t y, uint32_t val) { - #if MAX7219_X_LEDS == 8 - if (y > MAX7219_Y_LEDS - 4) return error(PSTR("set_rows_32bits"), y, val); - set_row(y + 3, val); val >>= 8; - set_row(y + 2, val); val >>= 8; - set_row(y + 1, val); val >>= 8; - set_row(y + 0, val); - #elif MAX7219_X_LEDS == 16 - if (y > MAX7219_Y_LEDS - 2) return error(PSTR("set_rows_32bits"), y, val); - set_row(y + 1, val); val >>= 16; - set_row(y + 0, val); - #else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits - if (y > MAX7219_Y_LEDS - 1) return error(PSTR("set_rows_32bits"), y, val); - set_row(y, val); - #endif -} - -void Max7219::set_columns_16bits(const uint8_t x, uint32_t val) { - #if MAX7219_Y_LEDS == 8 - if (x > MAX7219_X_LEDS - 2) return error(PSTR("set_columns_16bits"), x, val); - set_column(x + 0, val); val >>= 8; - set_column(x + 1, val); - #else // at least 16 bits in each column - if (x > MAX7219_X_LEDS - 1) return error(PSTR("set_columns_16bits"), x, val); - set_column(x, val); - #endif -} - -void Max7219::set_columns_32bits(const uint8_t x, uint32_t val) { - #if MAX7219_Y_LEDS == 8 - if (x > MAX7219_X_LEDS - 4) return error(PSTR("set_rows_32bits"), x, val); - set_column(x + 3, val); val >>= 8; - set_column(x + 2, val); val >>= 8; - set_column(x + 1, val); val >>= 8; - set_column(x + 0, val); - #elif MAX7219_Y_LEDS == 16 - if (x > MAX7219_X_LEDS - 2) return error(PSTR("set_rows_32bits"), x, val); - set_column(x + 1, val); val >>= 16; - set_column(x + 0, val); - #else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits - if (x > MAX7219_X_LEDS - 1) return error(PSTR("set_rows_32bits"), x, val); - set_column(x, val); - #endif -} - -// Initialize the Max7219 -void Max7219::register_setup() { - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_scanLimit, 0x07); - pulse_load(); // tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_decodeMode, 0x00); // using an led matrix (not digits) - pulse_load(); // tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_shutdown, 0x01); // not in shutdown mode - pulse_load(); // tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_displayTest, 0x00); // no display test - pulse_load(); // tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_intensity, 0x01 & 0x0F); // the first 0x0F is the value you can set - // range: 0x00 to 0x0F - pulse_load(); // tell the chips to load the clocked out data -} - -#ifdef MAX7219_INIT_TEST -#if MAX7219_INIT_TEST == 2 - - void Max7219::spiral(const bool on, const uint16_t del) { - constexpr int8_t way[] = { 1, 0, 0, 1, -1, 0, 0, -1 }; - int8_t px = 0, py = 0, dir = 0; - for (uint8_t i = MAX7219_X_LEDS * MAX7219_Y_LEDS; i--;) { - led_set(px, py, on); - delay(del); - const int8_t x = px + way[dir], y = py + way[dir + 1]; - if (!WITHIN(x, 0, MAX7219_X_LEDS-1) || !WITHIN(y, 0, MAX7219_Y_LEDS-1) || BIT_7219(x, y) == on) dir = (dir + 2) & 0x7; - px += way[dir]; py += way[dir + 1]; - } +void Max7219_Clear_Column(const uint8_t col) { + if (col > 7) { + SERIAL_ECHOPAIR("??? Max7219_Clear_Column(", (int)col); + SERIAL_ECHOLNPGM(")"); + return; } + LEDs[col] = 0; + Max7219(8 - col, LEDs[col]); +} -#else - - void Max7219::sweep(const int8_t dir, const uint16_t ms, const bool on) { - uint8_t x = dir > 0 ? 0 : MAX7219_X_LEDS-1; - for (uint8_t i = MAX7219_X_LEDS; i--; x += dir) { - set_column(x, on ? 0xFFFFFFFF : 0x00000000); - delay(ms); - } +void Max7219_Clear_Row(const uint8_t row) { + if (row > 7) { + SERIAL_ECHOPAIR("??? Max7219_Clear_Row(", (int)row); + SERIAL_ECHOLNPGM(")"); + return; } + for (uint8_t c = 0; c <= 7; c++) + Max7219_LED_Off(c, row); +} -#endif -#endif // MAX7219_INIT_TEST +void Max7219_Set_Row(const uint8_t row, const uint8_t val) { + if (row > 7) { + SERIAL_ECHOPAIR("??? Max7219_Set_Row(", (int)row); + SERIAL_ECHOPAIR(",", (int)val); + SERIAL_ECHOLNPGM(")"); + return; + } + for (uint8_t b = 0; b <= 7; b++) + if (TEST(val, b)) + Max7219_LED_On(7 - b, row); + else + Max7219_LED_Off(7 - b, row); +} + +void Max7219_Set_2_Rows(const uint8_t row, const uint16_t val) { + if (row > 6) { + SERIAL_ECHOPAIR("??? Max7219_Set_2_Rows(", (int)row); + SERIAL_ECHOPAIR(",", (int)val); + SERIAL_ECHOLNPGM(")"); + return; + } + Max7219_Set_Row(row + 1, (val >> 8) & 0xFF); + Max7219_Set_Row(row + 0, (val ) & 0xFF); +} + +void Max7219_Set_4_Rows(const uint8_t row, const uint32_t val) { + if (row > 4) { + SERIAL_ECHOPAIR("??? Max7219_Set_4_Rows(", (int)row); + SERIAL_ECHOPAIR(",", (long)val); + SERIAL_ECHOLNPGM(")"); + return; + } + Max7219_Set_Row(row + 3, (val >> 24) & 0xFF); + Max7219_Set_Row(row + 2, (val >> 16) & 0xFF); + Max7219_Set_Row(row + 1, (val >> 8) & 0xFF); + Max7219_Set_Row(row + 0, (val ) & 0xFF); +} + +void Max7219_Set_Column(const uint8_t col, const uint8_t val) { + if (col > 7) { + SERIAL_ECHOPAIR("??? Max7219_Column(", (int)col); + SERIAL_ECHOPAIR(",", (int)val); + SERIAL_ECHOLNPGM(")"); + return; + } + LEDs[col] = val; + Max7219(8 - col, LEDs[col]); +} + +void Max7219_init() { + uint8_t i, x, y; -void Max7219::init() { SET_OUTPUT(MAX7219_DIN_PIN); SET_OUTPUT(MAX7219_CLK_PIN); + OUT_WRITE(MAX7219_LOAD_PIN, HIGH); delay(1); - register_setup(); - - for (uint8_t i = 0; i <= 7; i++) { // Empty registers to turn all LEDs off - led_line[i] = 0x00; - send(max7219_reg_digit0 + i, 0); - pulse_load(); // tell the chips to load the clocked out data + //initiation of the max 7219 + Max7219(max7219_reg_scanLimit, 0x07); + Max7219(max7219_reg_decodeMode, 0x00); // using an led matrix (not digits) + Max7219(max7219_reg_shutdown, 0x01); // not in shutdown mode + Max7219(max7219_reg_displayTest, 0x00); // no display test + Max7219(max7219_reg_intensity, 0x01 & 0x0F); // the first 0x0F is the value you can set + // range: 0x00 to 0x0F + for (i = 0; i <= 7; i++) { // empty registers, turn all LEDs off + LEDs[i] = 0x00; + Max7219(i + 1, 0); } - #ifdef MAX7219_INIT_TEST - #if MAX7219_INIT_TEST == 2 - spiral(true, 8); - delay(150); - spiral(false, 8); - #else - // Do an aesthetically-pleasing pattern to fully test the Max7219 module and LEDs. - // Light up and turn off columns, both forward and backward. - sweep(1, 20, true); - sweep(1, 20, false); - delay(150); - sweep(-1, 20, true); - sweep(-1, 20, false); - #endif - #endif + for (x = 0; x <= 7; x++) // Do an aesthetically pleasing pattern to fully test + for (y = 0; y <= 7; y++) { // the Max7219 module and LEDs. First, turn them + Max7219_LED_On(x, y); // all on. + delay(3); + } + + for (x = 0; x <= 7; x++) // Now, turn them all off. + for (y = 0; y <= 7; y++) { + Max7219_LED_Off(x, y); + delay(3); // delay() is OK here. Max7219_init() is only called from + } // setup() and nothing is running yet. + + delay(150); + + for (x = 8; x--;) // Now, do the same thing from the opposite direction + for (y = 0; y <= 7; y++) { + Max7219_LED_On(x, y); + delay(2); + } + + for (x = 8; x--;) + for (y = 0; y <= 7; y++) { + Max7219_LED_Off(x, y); + delay(2); + } } /** - * This code demonstrates some simple debugging using a single 8x8 LED Matrix. If your feature could - * benefit from matrix display, add its code here. Very little processing is required, so the 7219 is - * ideal for debugging when realtime feedback is important but serial output can't be used. - */ - -// Apply changes to update a marker -void Max7219::mark16(const uint8_t y, const uint8_t v1, const uint8_t v2) { - #if MAX7219_X_LEDS == 8 - #if MAX7219_Y_LEDS == 8 - led_off(v1 & 0x7, y + (v1 >= 8)); - led_on(v2 & 0x7, y + (v2 >= 8)); - #else - led_off(y, v1 & 0xF); // At least 16 LEDs down. Use a single column. - led_on(y, v2 & 0xF); - #endif - #else - led_off(v1 & 0xF, y); // At least 16 LEDs across. Use a single row. - led_on(v2 & 0xF, y); +* These are sample debug features to demonstrate the usage of the 8x8 LED Matrix for debug purposes. +* There is very little CPU burden added to the system by displaying information within the idle() +* task. +* +* But with that said, if your debugging can be facilitated by making calls into the library from +* other places in the code, feel free to do it. The CPU burden for a few calls to toggle an LED +* or clear a row is not very significant. +*/ +void Max7219_idle_tasks() { +#if MAX7219_DEBUG_STEPPER_HEAD || MAX7219_DEBUG_STEPPER_TAIL || MAX7219_DEBUG_STEPPER_QUEUE + CRITICAL_SECTION_START + #if MAX7219_DEBUG_STEPPER_HEAD || MAX7219_DEBUG_STEPPER_QUEUE + const uint8_t head = planner.block_buffer_head; #endif -} - -// Apply changes to update a tail-to-head range -void Max7219::range16(const uint8_t y, const uint8_t ot, const uint8_t nt, const uint8_t oh, const uint8_t nh) { - #if MAX7219_X_LEDS == 8 - #if MAX7219_Y_LEDS == 8 - if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) - led_off(n & 0x7, y + (n >= 8)); - if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) - led_on(n & 0x7, y + (n >= 8)); - #else // The Max7219 Y-Axis has at least 16 LED's. So use a single column - if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) - led_off(y, n & 0xF); - if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) - led_on(y, n & 0xF); - #endif - #else // LED matrix has at least 16 LED's on the X-Axis. Use single line of LED's - if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) - led_off(n & 0xF, y); - if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) - led_on(n & 0xF, y); - #endif -} - -// Apply changes to update a quantity -void Max7219::quantity16(const uint8_t y, const uint8_t ov, const uint8_t nv) { - for (uint8_t i = MIN(nv, ov); i < MAX(nv, ov); i++) - #if MAX7219_X_LEDS == 8 - #if MAX7219_Y_LEDS == 8 - led_set(i >> 1, y + (i & 1), nv >= ov); // single 8x8 LED matrix. Use two lines to get 16 LED's - #else - led_set(y, i, nv >= ov); // The Max7219 Y-Axis has at least 16 LED's. So use a single column - #endif - #else - led_set(i, y, nv >= ov); // LED matrix has at least 16 LED's on the X-Axis. Use single line of LED's - #endif -} - -void Max7219::idle_tasks() { - #define MAX7219_USE_HEAD (defined(MAX7219_DEBUG_PLANNER_HEAD) || defined(MAX7219_DEBUG_PLANNER_QUEUE)) - #define MAX7219_USE_TAIL (defined(MAX7219_DEBUG_PLANNER_TAIL) || defined(MAX7219_DEBUG_PLANNER_QUEUE)) - #if MAX7219_USE_HEAD || MAX7219_USE_TAIL - CRITICAL_SECTION_START; - #if MAX7219_USE_HEAD - const uint8_t head = planner.block_buffer_head; - #endif - #if MAX7219_USE_TAIL - const uint8_t tail = planner.block_buffer_tail; - #endif - CRITICAL_SECTION_END; + #if MAX7219_DEBUG_STEPPER_TAIL || MAX7219_DEBUG_STEPPER_QUEUE + const uint8_t tail = planner.block_buffer_tail; #endif + CRITICAL_SECTION_END +#endif #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE) - static uint8_t refresh_cnt; // = 0 - constexpr uint16_t refresh_limit = 5; static millis_t next_blink = 0; - const millis_t ms = millis(); - const bool do_blink = ELAPSED(ms, next_blink); - #else - static uint16_t refresh_cnt; // = 0 - constexpr bool do_blink = true; - constexpr uint16_t refresh_limit = 50000; - #endif - - // Some Max7219 units are vulnerable to electrical noise, especially - // with long wires next to high current wires. If the display becomes - // corrupted, this will fix it within a couple seconds. - if (do_blink && ++refresh_cnt >= refresh_limit) { - refresh_cnt = 0; - register_setup(); - } - - #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE) - if (do_blink) { - led_toggle(MAX7219_X_LEDS - 1, MAX7219_Y_LEDS - 1); - next_blink = ms + 1000; + if (ELAPSED(millis(), next_blink)) { + Max7219_LED_Toggle(7, 7); + next_blink = millis() + 750; } #endif - #if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL + #ifdef MAX7219_DEBUG_STEPPER_HEAD + static int16_t last_head_cnt = 0; + if (last_head_cnt != head) { + if (last_head_cnt < 8) + Max7219_LED_Off(last_head_cnt, MAX7219_DEBUG_STEPPER_HEAD); + else + Max7219_LED_Off(last_head_cnt - 8, MAX7219_DEBUG_STEPPER_HEAD + 1); - static int16_t last_head_cnt = 0xF, last_tail_cnt = 0xF; - - if (last_head_cnt != head || last_tail_cnt != tail) { - range16(MAX7219_DEBUG_PLANNER_HEAD, last_tail_cnt, tail, last_head_cnt, head); last_head_cnt = head; - last_tail_cnt = tail; + if (head < 8) + Max7219_LED_On(head, MAX7219_DEBUG_STEPPER_HEAD); + else + Max7219_LED_On(head - 8, MAX7219_DEBUG_STEPPER_HEAD + 1); } - - #else - - #ifdef MAX7219_DEBUG_PLANNER_HEAD - static int16_t last_head_cnt = 0x1; - if (last_head_cnt != head) { - mark16(MAX7219_DEBUG_PLANNER_HEAD, last_head_cnt, head); - last_head_cnt = head; - } - #endif - - #ifdef MAX7219_DEBUG_PLANNER_TAIL - static int16_t last_tail_cnt = 0x1; - if (last_tail_cnt != tail) { - mark16(MAX7219_DEBUG_PLANNER_TAIL, last_tail_cnt, tail); - last_tail_cnt = tail; - } - #endif - #endif - #ifdef MAX7219_DEBUG_PLANNER_QUEUE + #ifdef MAX7219_DEBUG_STEPPER_TAIL + static int16_t last_tail_cnt = 0; + if (last_tail_cnt != tail) { + if (last_tail_cnt < 8) + Max7219_LED_Off(last_tail_cnt, MAX7219_DEBUG_STEPPER_TAIL); + else + Max7219_LED_Off(last_tail_cnt - 8, MAX7219_DEBUG_STEPPER_TAIL + 1); + + last_tail_cnt = tail; + if (tail < 8) + Max7219_LED_On(tail, MAX7219_DEBUG_STEPPER_TAIL); + else + Max7219_LED_On(tail - 8, MAX7219_DEBUG_STEPPER_TAIL + 1); + } + #endif + + #ifdef MAX7219_DEBUG_STEPPER_QUEUE static int16_t last_depth = 0; - const int16_t current_depth = (head - tail + BLOCK_BUFFER_SIZE) & (BLOCK_BUFFER_SIZE - 1) & 0xF; - if (current_depth != last_depth) { - quantity16(MAX7219_DEBUG_PLANNER_QUEUE, last_depth, current_depth); + int16_t current_depth = head - tail; + if (current_depth != last_depth) { // usually, no update will be needed. + if (current_depth < 0) current_depth += BLOCK_BUFFER_SIZE; + NOMORE(current_depth, BLOCK_BUFFER_SIZE); + NOMORE(current_depth, 16); // if the BLOCK_BUFFER_SIZE is greater than 16, two lines + // of LEDs is enough to see if the buffer is draining + + const uint8_t st = min(current_depth, last_depth), + en = max(current_depth, last_depth); + if (current_depth < last_depth) + for (uint8_t i = st; i <= en; i++) // clear the highest order LEDs + Max7219_LED_Off(i / 2, MAX7219_DEBUG_STEPPER_QUEUE + (i & 1)); + else + for (uint8_t i = st; i <= en; i++) // set the LEDs to current depth + Max7219_LED_On(i / 2, MAX7219_DEBUG_STEPPER_QUEUE + (i & 1)); + last_depth = current_depth; } #endif diff --git a/Marlin/Max7219_Debug_LEDs.h b/Marlin/Max7219_Debug_LEDs.h index 3523eef..3beccb0 100644 --- a/Marlin/Max7219_Debug_LEDs.h +++ b/Marlin/Max7219_Debug_LEDs.h @@ -22,45 +22,41 @@ /** * This module is off by default, but can be enabled to facilitate the display of - * extra debug information during code development. + * extra debug information during code development. It assumes the existence of a + * Max7219 LED Matrix. A suitable device can be obtained on eBay similar to this: + * http://www.ebay.com/itm/191781645249 for under $2.00 including shipping. * - * Just connect up 5V and GND to give it power, then connect up the pins assigned + * Just connect up +5v and GND to give it power, then connect up the pins assigned * in Configuration_adv.h. For example, on the Re-ARM you could use: * * #define MAX7219_CLK_PIN 77 * #define MAX7219_DIN_PIN 78 * #define MAX7219_LOAD_PIN 79 * - * max7219.init() is called automatically at startup, and then there are a number of + * Max7219_init() is called automatically at startup, and then there are a number of * support functions available to control the LEDs in the 8x8 grid. * - * If you are using the Max7219 matrix for firmware debug purposes in time sensitive - * areas of the code, please be aware that the orientation (rotation) of the display can - * affect the speed. The Max7219 can update a single column fairly fast. It is much - * faster to do a Max7219_Set_Column() with a rotation of 90 or 270 degrees than to do - * a Max7219_Set_Row(). The opposite is true for rotations of 0 or 180 degrees. + * void Max7219_init(); + * void Max7219_PutByte(uint8_t data); + * void Max7219(uint8_t reg, uint8_t data); + * void Max7219_LED_Set(uint8_t row, uint8_t col, bool on); + * void Max7219_LED_On(uint8_t col, uint8_t row); + * void Max7219_LED_Off(uint8_t col, uint8_t row); + * void Max7219_LED_Toggle(uint8_t row, uint8_t col); + * void Max7219_Clear_Row(uint8_t row); + * void Max7219_Clear_Column(uint8_t col); + * void Max7219_Set_Row(uint8_t row, uint8_t val); + * void Max7219_Set_2_Rows(uint8_t row, uint16_t val); + * void Max7219_Set_4_Rows(uint8_t row, uint32_t val); + * void Max7219_Set_Column(uint8_t col, uint8_t val); + * void Max7219_idle_tasks(); */ -#pragma once -#ifndef MAX7219_ROTATE - #define MAX7219_ROTATE 0 -#endif -#define _ROT ((MAX7219_ROTATE + 360) % 360) - -#define MAX7219_LINES (8 * (MAX7219_NUMBER_UNITS)) - -#if _ROT == 0 || _ROT == 180 - #define MAX7219_Y_LEDS 8 - #define MAX7219_X_LEDS MAX7219_LINES -#elif _ROT == 90 || _ROT == 270 - #define MAX7219_X_LEDS 8 - #define MAX7219_Y_LEDS MAX7219_LINES -#else - #error "MAX7219_ROTATE must be a multiple of +/- 90°." -#endif +#ifndef __MAX7219_DEBUG_LEDS_H__ +#define __MAX7219_DEBUG_LEDS_H__ // -// MAX7219 registers +// define max7219 registers // #define max7219_reg_noop 0x00 #define max7219_reg_digit0 0x01 @@ -72,83 +68,23 @@ #define max7219_reg_digit6 0x07 #define max7219_reg_digit7 0x08 -#define max7219_reg_decodeMode 0x09 #define max7219_reg_intensity 0x0A +#define max7219_reg_displayTest 0x0F +#define max7219_reg_decodeMode 0x09 #define max7219_reg_scanLimit 0x0B #define max7219_reg_shutdown 0x0C -#define max7219_reg_displayTest 0x0F -class Max7219 { -public: - static uint8_t led_line[MAX7219_LINES]; +void Max7219_init(); +void Max7219_PutByte(uint8_t data); +void Max7219(const uint8_t reg, const uint8_t data); +void Max7219_LED_Set(const uint8_t row, const uint8_t col, const bool on); +void Max7219_LED_On(const uint8_t row, const uint8_t col); +void Max7219_LED_Off(const uint8_t row, const uint8_t col); +void Max7219_LED_Toggle(const uint8_t row, const uint8_t col); +void Max7219_Clear_Row(const uint8_t row); +void Max7219_Clear_Column(const uint8_t col); +void Max7219_Set_Row(const uint8_t row, const uint8_t val); +void Max7219_Set_Column(const uint8_t col, const uint8_t val); +void Max7219_idle_tasks(); - Max7219() { } - - static void init(); - static void register_setup(); - static void putbyte(uint8_t data); - static void pulse_load(); - - // Set a single register (e.g., a whole native row) - static void send(const uint8_t reg, const uint8_t data); - - // Refresh all units - inline static void refresh() { for (uint8_t i = 0; i < 8; i++) refresh_line(i); } - - // Update a single native line on all units - static void refresh_line(const uint8_t line); - - // Update a single native line on just one unit - static void refresh_unit_line(const uint8_t line); - - // Set a single LED by XY coordinate - static void led_set(const uint8_t x, const uint8_t y, const bool on); - static void led_on(const uint8_t x, const uint8_t y); - static void led_off(const uint8_t x, const uint8_t y); - static void led_toggle(const uint8_t x, const uint8_t y); - - // Set all LEDs in a single column - static void set_column(const uint8_t col, const uint32_t val); - static void clear_column(const uint8_t col); - - // Set all LEDs in a single row - static void set_row(const uint8_t row, const uint32_t val); - static void clear_row(const uint8_t row); - - // 16 and 32 bit versions of Row and Column functions - // Multiple rows and columns will be used to display the value if - // the array of matrix LED's is too narrow to accomplish the goal - static void set_rows_16bits(const uint8_t y, uint32_t val); - static void set_rows_32bits(const uint8_t y, uint32_t val); - static void set_columns_16bits(const uint8_t x, uint32_t val); - static void set_columns_32bits(const uint8_t x, uint32_t val); - - // Quickly clear the whole matrix - static void clear(); - - // Quickly fill the whole matrix - static void fill(); - - // Apply custom code to update the matrix - static void idle_tasks(); - -private: - static void error(const char * const func, const int32_t v1, const int32_t v2=-1); - static void noop(); - static void set(const uint8_t line, const uint8_t bits); - static void send_row(const uint8_t row); - static void send_column(const uint8_t col); - static void mark16(const uint8_t y, const uint8_t v1, const uint8_t v2); - static void range16(const uint8_t y, const uint8_t ot, const uint8_t nt, const uint8_t oh, const uint8_t nh); - static void quantity16(const uint8_t y, const uint8_t ov, const uint8_t nv); - - #ifdef MAX7219_INIT_TEST - #if MAX7219_INIT_TEST == 2 - static void spiral(const bool on, const uint16_t del); - #else - static void sweep(const int8_t dir, const uint16_t ms, const bool on); - #endif - #endif -}; - -extern Max7219 max7219; +#endif // __MAX7219_DEBUG_LEDS_H__ diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 7e745ce..2399c42 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -42,21 +42,18 @@ * the bleeding-edge source code, but sometimes this is not enough. This check * forces a minimum config file revision. Otherwise Marlin will not build. */ -#define HEXIFY(H) _CAT(0x,H) -#if !defined(CONFIGURATION_H_VERSION) || HEXIFY(CONFIGURATION_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_H_VERSION) +#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 -#if !defined(CONFIGURATION_ADV_H_VERSION) || HEXIFY(CONFIGURATION_ADV_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION) +#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 /** * Warnings for old configurations */ -#ifndef MOTHERBOARD - #error "MOTHERBOARD is required. Please update your configuration." -#elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE) +#if !defined(X_BED_SIZE) || !defined(Y_BED_SIZE) #error "X_BED_SIZE and Y_BED_SIZE are now required! Please update your configuration." #elif WATCH_TEMP_PERIOD > 500 #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds." @@ -81,9 +78,7 @@ #elif defined(SDEXTRASLOW) #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead." #elif defined(FILAMENT_SENSOR) - #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration." -#elif defined(ENDSTOPPULLUP_FIL_RUNOUT) - #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP. Please update your configuration." + #error "FILAMENT_SENSOR is deprecated. Use FILAMENT_WIDTH_SENSOR instead." #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead." #elif defined(LANGUAGE_INCLUDE) @@ -98,8 +93,6 @@ #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(Z_ENDSTOP_SERVO_NR) - #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR. Please update your configuration." #elif defined(DEFAULT_XYJERK) #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead." #elif defined(XY_TRAVEL_SPEED) @@ -133,17 +126,11 @@ #elif defined(FILAMENT_CHANGE_RETRACT_LENGTH) #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH. Please update your configuration." #elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE) - #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration." -#elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE) - #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration." + #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_EXTRUDE_FEEDRATE. Please update your configuration." #elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) - #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." -#elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH) - #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." + #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_EXTRUDE_LENGTH. Please update your configuration." #elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT) #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT. Please update your configuration." -#elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS) - #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS. Please update your configuration." #elif ENABLED(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT) #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT. Please update your configuration." #elif defined(PLA_PREHEAT_HOTEND_TEMP) @@ -171,7 +158,7 @@ #elif defined(MIN_Z_HEIGHT_FOR_HOMING) #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT. Please update your configuration." #elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING) - #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead." + #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE instead." #elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS) #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration." #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT) @@ -184,8 +171,6 @@ #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE. Please update your configuration." #elif !defined(MIN_STEPS_PER_SEGMENT) #error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h. -#elif MIN_STEPS_PER_SEGMENT <= 0 - #error "MIN_STEPS_PER_SEGMENT must be at least 1. Please update your Configuration_adv.h." #elif defined(PREVENT_DANGEROUS_EXTRUDE) #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION. Please update your configuration." #elif defined(SCARA) @@ -234,20 +219,12 @@ #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h." #elif defined(ADVANCE) #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE." -#elif defined(LIN_ADVANCE_E_D_RATIO) - #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO. Check your configuration." #elif defined(NEOPIXEL_RGBW_LED) #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration." -#elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS) - #error "Remove DELTA_PROBEABLE_RADIUS and use MIN_PROBE_EDGE to inset the probe area instead." #elif defined(UBL_MESH_INSET) #error "UBL_MESH_INSET is now just MESH_INSET. Please update your configuration." #elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y) #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]. Please update your configuration." -#elif defined(ABL_PROBE_PT_1_X) || defined(ABL_PROBE_PT_1_Y) || defined(ABL_PROBE_PT_2_X) || defined(ABL_PROBE_PT_2_Y) || defined(ABL_PROBE_PT_3_X) || defined(ABL_PROBE_PT_3_Y) - #error "ABL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration." -#elif defined(UBL_PROBE_PT_1_X) || defined(UBL_PROBE_PT_1_Y) || defined(UBL_PROBE_PT_2_X) || defined(UBL_PROBE_PT_2_Y) || defined(UBL_PROBE_PT_3_X) || defined(UBL_PROBE_PT_3_Y) - #error "UBL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration." #elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY) #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY. Please update your configuration." #elif defined(BABYSTEP_ZPROBE_GFX_REVERSE) @@ -260,61 +237,8 @@ #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING. Please update your configuration." #elif defined(ANET_KEYPAD_LCD) #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD. Please update your configuration." -#elif defined(LCD_I2C_SAINSMART_YWROBOT) - #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004). Please update your configuration." #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT) #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN. Please update your configuration." -#elif defined(HAVE_TMCDRIVER) - #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(HAVE_TMC26X) - #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(HAVE_TMC2130) - #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." -#elif defined(HAVE_L6470DRIVER) - #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." -#elif defined(X_IS_TMC) || defined(X2_IS_TMC) || defined(Y_IS_TMC) || defined(Y2_IS_TMC) || defined(Z_IS_TMC) || defined(Z2_IS_TMC) \ - || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) - #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(X_IS_TMC26X) || defined(X2_IS_TMC26X) || defined(Y_IS_TMC26X) || defined(Y2_IS_TMC26X) || defined(Z_IS_TMC26X) || defined(Z2_IS_TMC26X) \ - || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) - #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(X_IS_TMC2130) || defined(X2_IS_TMC2130) || defined(Y_IS_TMC2130) || defined(Y2_IS_TMC2130) || defined(Z_IS_TMC2130) || defined(Z2_IS_TMC2130) \ - || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) - #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." -#elif defined(X_IS_TMC2208) || defined(X2_IS_TMC2208) || defined(Y_IS_TMC2208) || defined(Y2_IS_TMC2208) || defined(Z_IS_TMC2208) || defined(Z2_IS_TMC2208) \ - || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) - #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h." -#elif defined(X_IS_L6470) || defined(X2_IS_L6470) || defined(Y_IS_L6470) || defined(Y2_IS_L6470) || defined(Z_IS_L6470) || defined(Z2_IS_L6470) \ - || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) - #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." -#elif defined(AUTOMATIC_CURRENT_CONTROL) - #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration." -#elif defined(FILAMENT_CHANGE_LOAD_LENGTH) - #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH. Please update your configuration." -#elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET) - #error "LEVEL_BED_CORNERS requires a LEVEL_CORNERS_INSET value. Please update your Configuration.h." -#elif defined(BEZIER_JERK_CONTROL) - #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration." -#elif defined(JUNCTION_DEVIATION_FACTOR) - #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM. Please update your configuration." -#elif defined(JUNCTION_ACCELERATION_FACTOR) - #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h." -#elif defined(JUNCTION_ACCELERATION) - #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h." -#elif defined(MAX7219_DEBUG_STEPPER_HEAD) - #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD. Please update your configuration." -#elif defined(MAX7219_DEBUG_STEPPER_TAIL) - #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL. Please update your configuration." -#elif defined(MAX7219_DEBUG_STEPPER_QUEUE) - #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE. Please update your configuration." -#endif - -#define BOARD_MKS_13 -47 -#define BOARD_TRIGORILLA -343 -#if MB(MKS_13) - #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration." -#elif MB(BOARD_TRIGORILLA) - #error "BOARD_TRIGORILLA has been renamed BOARD_TRIGORILLA_13. Please update your configuration." #endif /** @@ -341,22 +265,16 @@ /** * Serial */ -#if USE_MARLINSERIAL +#ifndef USBCON #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE)) #error "RX_BUFFER_SIZE must be a power of 2 greater than 1." #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE)) #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256." - #elif ENABLED(BLUETOOTH) - #error "BLUETOOTH is only supported with AT90USB." #endif -#elif ENABLED(SERIAL_XON_XOFF) || ENABLED(SERIAL_STATS_MAX_RX_QUEUED) || ENABLED(SERIAL_STATS_DROPPED_RX) - #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices." -#endif - -#if SERIAL_PORT > 7 - #error "Set SERIAL_PORT to the port on your board. Usually this is 0." +#elif ENABLED(SERIAL_XON_XOFF) + #error "SERIAL_XON_XOFF is not supported on USB-native AVR devices." #endif /** @@ -401,12 +319,12 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, * Progress Bar */ #if ENABLED(LCD_PROGRESS_BAR) - #if DISABLED(SDSUPPORT) && DISABLED(LCD_SET_PROGRESS_MANUALLY) - #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY." + #if DISABLED(SDSUPPORT) + #error "LCD_PROGRESS_BAR requires SDSUPPORT." + #elif DISABLED(ULTRA_LCD) + #error "LCD_PROGRESS_BAR requires a character LCD." #elif ENABLED(DOGLCD) #error "LCD_PROGRESS_BAR does not apply to graphical displays." - #elif DISABLED(ULTIPANEL) - #error "LCD_PROGRESS_BAR requires a character LCD." #elif ENABLED(FILAMENT_LCD_DISPLAY) #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both." #endif @@ -414,13 +332,6 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR or Graphical LCD." #endif -/** - * Custom Boot and Status screens - */ -#if DISABLED(DOGLCD) && (ENABLED(SHOW_CUSTOM_BOOTSCREEN) || ENABLED(CUSTOM_STATUS_SCREEN_IMAGE)) - #error "Graphical LCD is required for SHOW_CUSTOM_BOOTSCREEN and CUSTOM_STATUS_SCREEN_IMAGE." -#endif - /** * SD File Sorting */ @@ -452,8 +363,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, * I2C Position Encoders */ #if ENABLED(I2C_POSITION_ENCODERS) - #if DISABLED(BABYSTEPPING) || DISABLED(BABYSTEP_XY) - #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY." + #if DISABLED(BABYSTEPPING) + #error "I2C_POSITION_ENCODERS requires BABYSTEPPING." #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5) #error "I2CPE_ENCODER_CNT must be between 1 and 5." #endif @@ -465,8 +376,6 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #if ENABLED(BABYSTEPPING) #if ENABLED(SCARA) #error "BABYSTEPPING is not implemented for SCARA yet." - #elif ENABLED(HANGPRINTER) - #error "BABYSTEPPING is not implemented for HANGPRINTER." #elif ENABLED(DELTA) && ENABLED(BABYSTEP_XY) #error "BABYSTEPPING only implemented for Z axis on deltabots." #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && ENABLED(MESH_BED_LEVELING) @@ -474,28 +383,18 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE #error "BABYSTEP_ZPROBE_OFFSET requires a probe." #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !ENABLED(DOGLCD) - #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD." + #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a DOGLCD." #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !ENABLED(BABYSTEP_ZPROBE_OFFSET) #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET." #endif #endif /** - * Filament Runout needs one or more pins and either SD Support or Auto print start detection + * Filament Runout needs a pin and either SD Support or Auto print start detection */ #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #if !PIN_EXISTS(FIL_RUNOUT) + #if !HAS_FIL_RUNOUT #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." - #elif NUM_RUNOUT_SENSORS > E_STEPPERS - #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers." - #elif NUM_RUNOUT_SENSORS > 1 && !PIN_EXISTS(FIL_RUNOUT2) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 1 requires FIL_RUNOUT2_PIN." - #elif NUM_RUNOUT_SENSORS > 2 && !PIN_EXISTS(FIL_RUNOUT3) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 2 requires FIL_RUNOUT3_PIN." - #elif NUM_RUNOUT_SENSORS > 3 && !PIN_EXISTS(FIL_RUNOUT4) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 3 requires FIL_RUNOUT4_PIN." - #elif NUM_RUNOUT_SENSORS > 4 && !PIN_EXISTS(FIL_RUNOUT5) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 4 requires FIL_RUNOUT5_PIN." #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART) #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART." #elif DISABLED(ADVANCED_PAUSE_FEATURE) @@ -507,34 +406,24 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, * Advanced Pause */ #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if !HAS_RESUME_CONTINUE - #error "ADVANCED_PAUSE_FEATURE currently requires an LCD controller or EMERGENCY_PARSER." + #if DISABLED(NEWPANEL) + #error "ADVANCED_PAUSE_FEATURE currently requires an LCD controller." #elif ENABLED(EXTRUDER_RUNOUT_PREVENT) #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE." #elif ENABLED(PARK_HEAD_ON_PAUSE) && DISABLED(SDSUPPORT) && DISABLED(NEWPANEL) && DISABLED(EMERGENCY_PARSER) #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller." #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT) - #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT." + #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT" #elif DISABLED(NOZZLE_PARK_FEATURE) - #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE." - #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH - #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." - #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH - #error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." - #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH - #error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." + #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE" #endif #endif /** * Individual axis homing is useless for DELTAS */ -#if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) - #if ENABLED(DELTA) - #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics." - #elif ENABLED(HANGPRINTER) - #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with HANGPRINTER kinematics." - #endif +#if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) && ENABLED(DELTA) + #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics." #endif /** @@ -565,6 +454,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, */ #ifdef SNMM #error "SNMM is now MK2_MULTIPLEXER. Please update your configuration." +#elif ENABLED(MK2_MULTIPLEXER) && DISABLED(ADVANCED_PAUSE_FEATURE) + #error "ADVANCED_PAUSE_FEATURE is required with MK2_MULTIPLEXER." #endif /** @@ -608,14 +499,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #endif #endif -/** - * Linear Advance 1.5 - Check K value range - */ -#if ENABLED(LIN_ADVANCE) - static_assert( - WITHIN(LIN_ADVANCE_K, 0, 10), - "LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)." - ); +#if ENABLED(LIN_ADVANCE) && !IS_CARTESIAN + #error "Sorry! LIN_ADVANCE is only compatible with Cartesian." #endif /** @@ -666,8 +551,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, /** * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder */ -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_PROBE && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR) - #error "Z_PROBE_SERVO_NR, switching nozzle, or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE." +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_ENDSTOP && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR) + #error "Z_ENDSTOP_SERVO_NR, switching nozzle, or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE." #endif /** @@ -691,25 +576,44 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, /** * Allow only one kinematic type to be defined */ -#if 1 < 0 \ - + ENABLED(HANGPRINTER) \ - + ENABLED(DELTA) \ - + ENABLED(MORGAN_SCARA) \ - + ENABLED(MAKERARM_SCARA) \ - + ENABLED(COREXY) \ - + ENABLED(COREXZ) \ - + ENABLED(COREYZ) \ - + ENABLED(COREYX) \ - + ENABLED(COREZX) \ - + ENABLED(COREZY) - #error "Please enable only one of HANGPRINTER, DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY." -#endif +static_assert(1 >= 0 + #if ENABLED(DELTA) + + 1 + #endif + #if ENABLED(MORGAN_SCARA) + + 1 + #endif + #if ENABLED(MAKERARM_SCARA) + + 1 + #endif + #if ENABLED(COREXY) + + 1 + #endif + #if ENABLED(COREXZ) + + 1 + #endif + #if ENABLED(COREYZ) + + 1 + #endif + #if ENABLED(COREYX) + + 1 + #endif + #if ENABLED(COREZX) + + 1 + #endif + #if ENABLED(COREZY) + + 1 + #endif + , "Please enable only one of DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY." +); /** * Delta requirements */ #if ENABLED(DELTA) - #if DISABLED(USE_XMAX_PLUG) && DISABLED(USE_YMAX_PLUG) && DISABLED(USE_ZMAX_PLUG) + #if HAS_BED_PROBE && ENABLED(Z_MIN_PROBE_ENDSTOP) + #error "Delta probably shouldn't use Z_MIN_PROBE_ENDSTOP. Comment out this line to continue." + #elif DISABLED(USE_XMAX_PLUG) && DISABLED(USE_YMAX_PLUG) && DISABLED(USE_ZMAX_PLUG) #error "You probably want to use Max Endstops for DELTA!" #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL." @@ -724,42 +628,6 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #endif #endif -/** - * Hangprinter requirements - */ -#if ENABLED(HANGPRINTER) - #if EXTRUDERS > 4 - #error "Marlin supports a maximum of 4 EXTRUDERS when driving a Hangprinter." - #elif ENABLED(CONVENTIONAL_GEOMETRY) - #if ANCHOR_A_Y > 0 - #error "ANCHOR_A_Y should be negative by convention." - #elif (ANCHOR_B_X) * (ANCHOR_C_X) > 0 - #error "ANCHOR_B_X and ANCHOR_C_X should have opposite signs by convention." - #elif ANCHOR_B_Y < 0 - #error "ANCHOR_B_Y should be positive by convention." - #elif ANCHOR_C_Y < 0 - #error "ANCHOR_C_Y should be positive by convention." - #elif ANCHOR_A_Z > 0 - #error "ANCHOR_A_Z should be negative by convention." - #elif ANCHOR_B_Z > 0 - #error "ANCHOR_B_Z should be negative by convention." - #elif ANCHOR_C_Z > 0 - #error "ANCHOR_C_Z should be negative by convention." - #elif ANCHOR_D_Z < 0 - #error "ANCHOR_D_Z should be positive by convention." - #endif - #endif -#elif ENABLED(LINE_BUILDUP_COMPENSATION_FEATURE) - #error "LINE_BUILDUP_COMPENSATION_FEATURE is only compatible with HANGPRINTER." -#endif - -/** - * Mechaduino requirements - */ -#if ENABLED(MECHADUINO_I2C_COMMANDS) && DISABLED(EXPERIMENTAL_I2CBUS) - #error "MECHADUINO_I2C_COMMANDS requires EXPERIMENTAL_I2CBUS to be enabled." -#endif - /** * Probes */ @@ -767,16 +635,30 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, /** * Allow only one probe option to be defined */ -#if 1 < 0 \ - + ENABLED(PROBE_MANUALLY) \ - + ENABLED(FIX_MOUNTED_PROBE) \ - + (HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH)) \ - + ENABLED(BLTOUCH) \ - + ENABLED(SOLENOID_PROBE) \ - + ENABLED(Z_PROBE_ALLEN_KEY) \ - + ENABLED(Z_PROBE_SLED) - #error "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." -#endif +static_assert(1 >= 0 + #if ENABLED(PROBE_MANUALLY) + + 1 + #endif + #if ENABLED(FIX_MOUNTED_PROBE) + + 1 + #endif + #if HAS_Z_SERVO_ENDSTOP && DISABLED(BLTOUCH) + + 1 + #endif + #if ENABLED(BLTOUCH) + + 1 + #endif + #if ENABLED(SOLENOID_PROBE) + + 1 + #endif + #if ENABLED(Z_PROBE_ALLEN_KEY) + + 1 + #endif + #if ENABLED(Z_PROBE_SLED) + + 1 + #endif + , "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." +); #if HAS_BED_PROBE @@ -801,19 +683,11 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, /** * NUM_SERVOS is required for a Z servo probe */ - #if HAS_Z_SERVO_PROBE + #if HAS_Z_SERVO_ENDSTOP #ifndef NUM_SERVOS - #error "You must set NUM_SERVOS for a Z servo probe (Z_PROBE_SERVO_NR)." - #elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0) - #error "SERVO0_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1) - #error "SERVO1_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2) - #error "SERVO2_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3) - #error "SERVO3_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR >= NUM_SERVOS - #error "Z_PROBE_SERVO_NR must be smaller than 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 smaller than NUM_SERVOS." #endif #endif @@ -827,7 +701,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled." #elif !HAS_Z_MIN #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined." - #elif Z_MIN_PROBE_ENDSTOP_INVERTING != Z_MIN_ENDSTOP_INVERTING + #elif ENABLED(Z_MIN_PROBE_ENDSTOP_INVERTING) != ENABLED(Z_MIN_ENDSTOP_INVERTING) #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING." #endif #elif ENABLED(Z_MIN_PROBE_ENDSTOP) @@ -849,21 +723,12 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0." #elif Z_CLEARANCE_BETWEEN_PROBES < 0 #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0." - #elif Z_AFTER_PROBING < 0 - #error "Probes need Z_AFTER_PROBING >= 0." #endif #if MULTIPLE_PROBING && MULTIPLE_PROBING < 2 #error "MULTIPLE_PROBING must be >= 2." #endif - #if Z_PROBE_LOW_POINT > 0 - #error "Z_PROBE_LOW_POINT must be less than or equal to 0." - #endif - - static_assert(int(X_PROBE_OFFSET_FROM_EXTRUDER) == (X_PROBE_OFFSET_FROM_EXTRUDER), "X_PROBE_OFFSET_FROM_EXTRUDER must be an integer value."); - static_assert(int(Y_PROBE_OFFSET_FROM_EXTRUDER) == (Y_PROBE_OFFSET_FROM_EXTRUDER), "Y_PROBE_OFFSET_FROM_EXTRUDER must be an integer value."); - #else /** @@ -882,28 +747,29 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, /** * Allow only one bed leveling option to be defined */ -#if 1 < 0 \ - + ENABLED(AUTO_BED_LEVELING_LINEAR) \ - + ENABLED(AUTO_BED_LEVELING_3POINT) \ - + ENABLED(AUTO_BED_LEVELING_BILINEAR) \ - + ENABLED(AUTO_BED_LEVELING_UBL) \ - + ENABLED(MESH_BED_LEVELING) - #error "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL." -#endif +static_assert(1 >= 0 + #if ENABLED(AUTO_BED_LEVELING_LINEAR) + + 1 + #endif + #if ENABLED(AUTO_BED_LEVELING_3POINT) + + 1 + #endif + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + + 1 + #endif + #if ENABLED(AUTO_BED_LEVELING_UBL) + + 1 + #endif + #if ENABLED(MESH_BED_LEVELING) + + 1 + #endif + , "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL." +); /** * Bed Leveling Requirements */ -#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_3POINT) - static_assert(WITHIN(PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_1_X is outside the probe region."); - static_assert(WITHIN(PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_2_X is outside the probe region."); - static_assert(WITHIN(PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_3_X is outside the probe region."); - static_assert(WITHIN(PROBE_PT_1_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_1_Y is outside the probe region."); - static_assert(WITHIN(PROBE_PT_2_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_2_Y is outside the probe region."); - static_assert(WITHIN(PROBE_PT_3_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_3_Y is outside the probe region."); -#endif - #if ENABLED(AUTO_BED_LEVELING_UBL) /** @@ -919,8 +785,13 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration." #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15) #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15." - #elif !defined(RESTORE_LEVELING_AFTER_G28) - #error "AUTO_BED_LEVELING_UBL used to enable RESTORE_LEVELING_AFTER_G28. To keep this behavior enable RESTORE_LEVELING_AFTER_G28. Otherwise define it as 'false'." + #else + static_assert(WITHIN(UBL_PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X), "UBL_PROBE_PT_1_X can't be reached by the Z probe."); + static_assert(WITHIN(UBL_PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X), "UBL_PROBE_PT_2_X can't be reached by the Z probe."); + static_assert(WITHIN(UBL_PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X), "UBL_PROBE_PT_3_X can't be reached by the Z probe."); + static_assert(WITHIN(UBL_PROBE_PT_1_Y, MIN_PROBE_Y, MAX_PROBE_Y), "UBL_PROBE_PT_1_Y can't be reached by the Z probe."); + static_assert(WITHIN(UBL_PROBE_PT_2_Y, MIN_PROBE_Y, MAX_PROBE_Y), "UBL_PROBE_PT_2_Y can't be reached by the Z probe."); + static_assert(WITHIN(UBL_PROBE_PT_3_Y, MIN_PROBE_Y, MAX_PROBE_Y), "UBL_PROBE_PT_3_Y can't be reached by the Z probe."); #endif #elif OLDSCHOOL_ABL @@ -929,11 +800,15 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, * Auto Bed Leveling */ + #if ENABLED(USE_RAW_KINEMATICS) + #error "USE_RAW_KINEMATICS is not compatible with AUTO_BED_LEVELING" + #endif + /** * Delta and SCARA have limited bed leveling options */ #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR) - #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option." + #error "Only AUTO_BED_LEVELING_BILINEAR currently supports SCARA bed leveling." #endif /** @@ -941,12 +816,28 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, */ #if ABL_GRID - static_assert(LEFT_PROBE_BED_POSITION < RIGHT_PROBE_BED_POSITION, "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION."); - static_assert(FRONT_PROBE_BED_POSITION < BACK_PROBE_BED_POSITION, "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION."); - static_assert(LEFT_PROBE_BED_POSITION >= MIN_PROBE_X, "LEFT_PROBE_BED_POSITION is outside the probe region."); - static_assert(RIGHT_PROBE_BED_POSITION <= MAX_PROBE_X, "RIGHT_PROBE_BED_POSITION is outside the probe region."); - static_assert(FRONT_PROBE_BED_POSITION >= MIN_PROBE_Y, "FRONT_PROBE_BED_POSITION is outside the probe region."); - static_assert(BACK_PROBE_BED_POSITION <= MAX_PROBE_Y, "BACK_PROBE_BED_POSITION is outside the probe region."); + #ifdef DELTA_PROBEABLE_RADIUS + static_assert(LEFT_PROBE_BED_POSITION >= -DELTA_PROBEABLE_RADIUS, "LEFT_PROBE_BED_POSITION must be within DELTA_PROBEABLE_RADIUS."); + static_assert(RIGHT_PROBE_BED_POSITION <= DELTA_PROBEABLE_RADIUS, "RIGHT_PROBE_BED_POSITION must be within DELTA_PROBEABLE_RADIUS."); + static_assert(FRONT_PROBE_BED_POSITION >= -DELTA_PROBEABLE_RADIUS, "FRONT_PROBE_BED_POSITION must be within DELTA_PROBEABLE_RADIUS."); + static_assert(BACK_PROBE_BED_POSITION <= DELTA_PROBEABLE_RADIUS, "BACK_PROBE_BED_POSITION must be within DELTA_PROBEABLE_RADIUS."); + #else + static_assert(LEFT_PROBE_BED_POSITION < RIGHT_PROBE_BED_POSITION, "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION."); + static_assert(FRONT_PROBE_BED_POSITION < BACK_PROBE_BED_POSITION, "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION."); + static_assert(LEFT_PROBE_BED_POSITION >= MIN_PROBE_X, "LEFT_PROBE_BED_POSITION can't be reached by the Z probe."); + static_assert(RIGHT_PROBE_BED_POSITION <= MAX_PROBE_X, "RIGHT_PROBE_BED_POSITION can't be reached by the Z probe."); + static_assert(FRONT_PROBE_BED_POSITION >= MIN_PROBE_Y, "FRONT_PROBE_BED_POSITION can't be reached by the Z probe."); + static_assert(BACK_PROBE_BED_POSITION <= MAX_PROBE_Y, "BACK_PROBE_BED_POSITION can't be reached by the Z probe."); + #endif + + #else // AUTO_BED_LEVELING_3POINT + + static_assert(WITHIN(ABL_PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X), "ABL_PROBE_PT_1_X can't be reached by the Z probe."); + static_assert(WITHIN(ABL_PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X), "ABL_PROBE_PT_2_X can't be reached by the Z probe."); + static_assert(WITHIN(ABL_PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X), "ABL_PROBE_PT_3_X can't be reached by the Z probe."); + static_assert(WITHIN(ABL_PROBE_PT_1_Y, MIN_PROBE_Y, MAX_PROBE_Y), "ABL_PROBE_PT_1_Y can't be reached by the Z probe."); + static_assert(WITHIN(ABL_PROBE_PT_2_Y, MIN_PROBE_Y, MAX_PROBE_Y), "ABL_PROBE_PT_2_Y can't be reached by the Z probe."); + static_assert(WITHIN(ABL_PROBE_PT_3_Y, MIN_PROBE_Y, MAX_PROBE_Y), "ABL_PROBE_PT_3_Y can't be reached by the Z probe."); #endif // AUTO_BED_LEVELING_3POINT @@ -967,9 +858,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #endif -#if HAS_MESH - static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling."); -#elif ENABLED(G26_MESH_VALIDATION) +#if !HAS_MESH && ENABLED(G26_MESH_VALIDATION) #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL." #endif @@ -983,36 +872,34 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #if ENABLED(LCD_BED_LEVELING) #if DISABLED(ULTIPANEL) #error "LCD_BED_LEVELING requires an LCD controller." - #elif !(ENABLED(MESH_BED_LEVELING) || OLDSCHOOL_ABL) - #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING." + #elif !(ENABLED(MESH_BED_LEVELING) || (OLDSCHOOL_ABL && ENABLED(PROBE_MANUALLY))) + #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or ABL with PROBE_MANUALLY." #endif #endif /** - * Homing + * Homing Bump */ #if X_HOME_BUMP_MM < 0 || Y_HOME_BUMP_MM < 0 || Z_HOME_BUMP_MM < 0 #error "[XYZ]_HOME_BUMP_MM must be greater than or equal to 0." #endif -#if ENABLED(CODEPENDENT_XY_HOMING) - #if ENABLED(QUICK_HOME) - #error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING." - #elif IS_KINEMATIC - #error "CODEPENDENT_XY_HOMING requires a Cartesian setup." - #endif -#endif - /** * Make sure Z_SAFE_HOMING point is reachable */ #if ENABLED(Z_SAFE_HOMING) - #if HAS_BED_PROBE - static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, MIN_PROBE_X, MAX_PROBE_X), "Z_SAFE_HOMING_X_POINT is outside the probe region."); - static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, MIN_PROBE_Y, MAX_PROBE_Y), "Z_SAFE_HOMING_Y_POINT is outside the probe region."); - #else - static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, X_MIN_POS, X_MAX_POS), "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle."); - static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle."); + #if !WITHIN(Z_SAFE_HOMING_X_POINT, MIN_PROBE_X, 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 !WITHIN(Z_SAFE_HOMING_Y_POINT, MIN_PROBE_Y, 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 @@ -1021,7 +908,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, */ #if ENABLED(DISABLE_X) || ENABLED(DISABLE_Y) || ENABLED(DISABLE_Z) #if ENABLED(HOME_AFTER_DEACTIVATE) || ENABLED(Z_SAFE_HOMING) - #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING." + #error "DISABLE_[XYZ] not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING." #endif #endif // DISABLE_[XYZ] @@ -1050,12 +937,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, /** * SAV_3DGLCD display options */ -#if ENABLED(SAV_3DGLCD) - #if DISABLED(U8GLIB_SSD1306) && DISABLED(U8GLIB_SH1106) - #error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106." - #elif ENABLED(U8GLIB_SSD1306) && ENABLED(U8GLIB_SH1106) - #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106." - #endif +#if ENABLED(U8GLIB_SSD1306) && ENABLED(U8GLIB_SH1106) + #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106." #endif /** @@ -1127,9 +1010,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "HEATER_0_PIN not defined for this board." #elif !PIN_EXISTS(TEMP_0) && !(defined(MAX6675_SS) && MAX6675_SS >= 0) #error "TEMP_0_PIN not defined for this board." -#elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR))) - #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board." -#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE))) +#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." @@ -1208,13 +1089,6 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both." #endif -/** - * LED Control Menu - */ -#if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS - #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9632, or NEOPIXEL_LED." -#endif - /** * Basic 2-nozzle duplication mode */ @@ -1254,7 +1128,6 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #endif #endif #endif - /** * Endstop Tests */ @@ -1262,51 +1135,51 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #define _PLUG_UNUSED_TEST(AXIS,PLUG) (DISABLED(USE_##PLUG##MIN_PLUG) && DISABLED(USE_##PLUG##MAX_PLUG) && !(ENABLED(AXIS##_DUAL_ENDSTOPS) && WITHIN(AXIS##2_USE_ENDSTOP, _##PLUG##MAX_, _##PLUG##MIN_))) #define _AXIS_PLUG_UNUSED_TEST(AXIS) (_PLUG_UNUSED_TEST(AXIS,X) && _PLUG_UNUSED_TEST(AXIS,Y) && _PLUG_UNUSED_TEST(AXIS,Z)) -#if DISABLED(HANGPRINTER) - // At least 3 endstop plugs must be used - #if _AXIS_PLUG_UNUSED_TEST(X) - #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG." - #elif _AXIS_PLUG_UNUSED_TEST(Y) - #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG." - #elif _AXIS_PLUG_UNUSED_TEST(Z) - #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG." - #endif +// At least 3 endstop plugs must be used +#if _AXIS_PLUG_UNUSED_TEST(X) + #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG." +#endif +#if _AXIS_PLUG_UNUSED_TEST(Y) + #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG." +#endif +#if _AXIS_PLUG_UNUSED_TEST(Z) + #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG." +#endif - // Delta and Cartesian use 3 homing endstops - #if !IS_SCARA - #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG) - #error "Enable USE_XMIN_PLUG when homing X to MIN." - #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG) - #error "Enable USE_XMAX_PLUG when homing X to MAX." - #elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG) - #error "Enable USE_YMIN_PLUG when homing Y to MIN." - #elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG) - #error "Enable USE_YMAX_PLUG when homing Y to MAX." - #endif - #endif - #if Z_HOME_DIR < 0 && DISABLED(USE_ZMIN_PLUG) - #error "Enable USE_ZMIN_PLUG when homing Z to MIN." - #elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG) - #error "Enable USE_ZMAX_PLUG when homing Z to MAX." +// Delta and Cartesian use 3 homing endstops +#if !IS_SCARA + #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG) + #error "Enable USE_XMIN_PLUG when homing X to MIN." + #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG) + #error "Enable USE_XMAX_PLUG when homing X to MAX." + #elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG) + #error "Enable USE_YMIN_PLUG when homing Y to MIN." + #elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG) + #error "Enable USE_YMAX_PLUG when homing Y to MAX." #endif #endif +#if Z_HOME_DIR < 0 && DISABLED(USE_ZMIN_PLUG) + #error "Enable USE_ZMIN_PLUG when homing Z to MIN." +#elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG) + #error "Enable USE_ZMAX_PLUG when homing Z to MAX." +#endif // Dual endstops requirements #if ENABLED(X_DUAL_ENDSTOPS) #if !X2_USE_ENDSTOP #error "You must set X2_USE_ENDSTOP with X_DUAL_ENDSTOPS." - #elif X2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when X2_USE_ENDSTOP is _XMIN_." - #elif X2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when X2_USE_ENDSTOP is _XMAX_." - #elif X2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when X2_USE_ENDSTOP is _YMIN_." - #elif X2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when X2_USE_ENDSTOP is _YMAX_." - #elif X2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when X2_USE_ENDSTOP is _ZMIN_." - #elif X2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when X2_USE_ENDSTOP is _ZMAX_." + #elif X2_USE_ENDSTOP == _X_MIN_ && DISABLED(USE_XMIN_PLUG) + #error "USE_XMIN_PLUG is required when X2_USE_ENDSTOP is _X_MIN_." + #elif X2_USE_ENDSTOP == _X_MAX_ && DISABLED(USE_XMAX_PLUG) + #error "USE_XMAX_PLUG is required when X2_USE_ENDSTOP is _X_MAX_." + #elif X2_USE_ENDSTOP == _Y_MIN_ && DISABLED(USE_YMIN_PLUG) + #error "USE_YMIN_PLUG is required when X2_USE_ENDSTOP is _Y_MIN_." + #elif X2_USE_ENDSTOP == _Y_MAX_ && DISABLED(USE_YMAX_PLUG) + #error "USE_YMAX_PLUG is required when X2_USE_ENDSTOP is _Y_MAX_." + #elif X2_USE_ENDSTOP == _Z_MIN_ && DISABLED(USE_ZMIN_PLUG) + #error "USE_ZMIN_PLUG is required when X2_USE_ENDSTOP is _Z_MIN_." + #elif X2_USE_ENDSTOP == _Z_MAX_ && DISABLED(USE_ZMAX_PLUG) + #error "USE_ZMAX_PLUG is required when X2_USE_ENDSTOP is _Z_MAX_." #elif !HAS_X2_MIN && !HAS_X2_MAX #error "X2_USE_ENDSTOP has been assigned to a nonexistent endstop!" #elif ENABLED(DELTA) @@ -1316,18 +1189,18 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #if ENABLED(Y_DUAL_ENDSTOPS) #if !Y2_USE_ENDSTOP #error "You must set Y2_USE_ENDSTOP with Y_DUAL_ENDSTOPS." - #elif Y2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when Y2_USE_ENDSTOP is _XMIN_." - #elif Y2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when Y2_USE_ENDSTOP is _XMAX_." - #elif Y2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when Y2_USE_ENDSTOP is _YMIN_." - #elif Y2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when Y2_USE_ENDSTOP is _YMAX_." - #elif Y2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when Y2_USE_ENDSTOP is _ZMIN_." - #elif Y2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when Y2_USE_ENDSTOP is _ZMAX_." + #elif Y2_USE_ENDSTOP == _X_MIN_ && DISABLED(USE_XMIN_PLUG) + #error "USE_XMIN_PLUG is required when Y2_USE_ENDSTOP is _X_MIN_." + #elif Y2_USE_ENDSTOP == _X_MAX_ && DISABLED(USE_XMAX_PLUG) + #error "USE_XMAX_PLUG is required when Y2_USE_ENDSTOP is _X_MAX_." + #elif Y2_USE_ENDSTOP == _Y_MIN_ && DISABLED(USE_YMIN_PLUG) + #error "USE_YMIN_PLUG is required when Y2_USE_ENDSTOP is _Y_MIN_." + #elif Y2_USE_ENDSTOP == _Y_MAX_ && DISABLED(USE_YMAX_PLUG) + #error "USE_YMAX_PLUG is required when Y2_USE_ENDSTOP is _Y_MAX_." + #elif Y2_USE_ENDSTOP == _Z_MIN_ && DISABLED(USE_ZMIN_PLUG) + #error "USE_ZMIN_PLUG is required when Y2_USE_ENDSTOP is _Z_MIN_." + #elif Y2_USE_ENDSTOP == _Z_MAX_ && DISABLED(USE_ZMAX_PLUG) + #error "USE_ZMAX_PLUG is required when Y2_USE_ENDSTOP is _Z_MAX_." #elif !HAS_Y2_MIN && !HAS_Y2_MAX #error "Y2_USE_ENDSTOP has been assigned to a nonexistent endstop!" #elif ENABLED(DELTA) @@ -1337,18 +1210,18 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #if ENABLED(Z_DUAL_ENDSTOPS) #if !Z2_USE_ENDSTOP #error "You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS." - #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_." - #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_." - #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_." - #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_." - #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_." - #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_." + #elif Z2_USE_ENDSTOP == _X_MIN_ && DISABLED(USE_XMIN_PLUG) + #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _X_MIN_." + #elif Z2_USE_ENDSTOP == _X_MAX_ && DISABLED(USE_XMAX_PLUG) + #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _X_MAX_." + #elif Z2_USE_ENDSTOP == _Y_MIN_ && DISABLED(USE_YMIN_PLUG) + #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _Y_MIN_." + #elif Z2_USE_ENDSTOP == _Y_MAX_ && DISABLED(USE_YMAX_PLUG) + #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _Y_MAX_." + #elif Z2_USE_ENDSTOP == _Z_MIN_ && DISABLED(USE_ZMIN_PLUG) + #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _Z_MIN_." + #elif Z2_USE_ENDSTOP == _Z_MAX_ && DISABLED(USE_ZMAX_PLUG) + #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _Z_MAX_." #elif !HAS_Z2_MIN && !HAS_Z2_MAX #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!" #elif ENABLED(DELTA) @@ -1359,7 +1232,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, /** * emergency-command parser */ -#if ENABLED(EMERGENCY_PARSER) && !USE_MARLINSERIAL +#if ENABLED(EMERGENCY_PARSER) && defined(USBCON) #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)." #endif @@ -1431,150 +1304,201 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, * SAV_3DGLCD => U8GLIB_SH1106 => ULTIMAKERCONTROLLER * MKS_12864OLED => U8GLIB_SH1106 => ULTIMAKERCONTROLLER * MKS_12864OLED_SSD1306 => U8GLIB_SSD1306 => ULTIMAKERCONTROLLER - * MKS_MINI_12864 => MINIPANEL * miniVIKI => ULTIMAKERCONTROLLER * VIKI2 => ULTIMAKERCONTROLLER * ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER * PANEL_ONE => ULTIMAKERCONTROLLER */ -#if 1 < 0 \ - + ( ENABLED(ULTIMAKERCONTROLLER) \ +static_assert(1 >= 0 + #if ENABLED(ULTIMAKERCONTROLLER) \ && DISABLED(SAV_3DGLCD) \ && DISABLED(miniVIKI) \ && DISABLED(VIKI2) \ && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ && DISABLED(PANEL_ONE) \ && DISABLED(MKS_12864OLED) \ - && DISABLED(MKS_12864OLED_SSD1306) ) \ - + ( ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \ + && DISABLED(MKS_12864OLED_SSD1306) + + 1 + #endif + #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \ && DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \ && DISABLED(LCD_FOR_MELZI) \ && DISABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \ && DISABLED(MKS_12864OLED) \ - && DISABLED(MKS_12864OLED_SSD1306) ) \ - + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(BQ_LCD_SMART_CONTROLLER)) \ - + ENABLED(LCD_FOR_MELZI) \ - + ENABLED(MKS_12864OLED) \ - + ENABLED(MKS_12864OLED_SSD1306) \ - + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \ - + ENABLED(CARTESIO_UI) \ - + ENABLED(PANEL_ONE) \ - + ENABLED(MAKRPANEL) \ - + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \ - + ENABLED(VIKI2) \ - + ENABLED(miniVIKI) \ - + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - + ENABLED(G3D_PANEL) \ - + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \ - + ENABLED(MKS_MINI_12864) \ - + (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(CARTESIO_UI) && DISABLED(ZONESTAR_LCD)) \ - + ENABLED(RIGIDBOT_PANEL) \ - + ENABLED(RA_CONTROL_PANEL) \ - + ENABLED(LCD_SAINSMART_I2C_1602) \ - + ENABLED(LCD_SAINSMART_I2C_2004) \ - + ENABLED(LCM1602) \ - + ENABLED(LCD_I2C_PANELOLU2) \ - + ENABLED(LCD_I2C_VIKI) \ - + (ENABLED(U8GLIB_SSD1306) && DISABLED(OLED_PANEL_TINYBOY2) && DISABLED(MKS_12864OLED_SSD1306)) \ - + ENABLED(SAV_3DLCD) \ - + ENABLED(BQ_LCD_SMART_CONTROLLER) \ - + ENABLED(SAV_3DGLCD) \ - + ENABLED(OLED_PANEL_TINYBOY2) \ - + ENABLED(ZONESTAR_LCD) \ - + ENABLED(ULTI_CONTROLLER) - #error "Please select no more than one LCD controller option." + && DISABLED(MKS_12864OLED_SSD1306) + + 1 + #endif + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \ + && DISABLED(BQ_LCD_SMART_CONTROLLER) + + 1 + #endif + #if ENABLED(LCD_FOR_MELZI) + + 1 + #endif + #if ENABLED(MKS_12864OLED) + + 1 + #endif + #if ENABLED(MKS_12864OLED_SSD1306) + + 1 + #endif + #if ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) + + 1 + #endif + #if ENABLED(CARTESIO_UI) + + 1 + #endif + #if ENABLED(PANEL_ONE) + + 1 + #endif + #if ENABLED(MAKRPANEL) + + 1 + #endif + #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + 1 + #endif + #if ENABLED(VIKI2) + + 1 + #endif + #if ENABLED(miniVIKI) + + 1 + #endif + #if ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) + + 1 + #endif + #if ENABLED(G3D_PANEL) + + 1 + #endif + #if ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864) + + 1 + #endif + #if ENABLED(MKS_MINI_12864) + + 1 + #endif + #if ENABLED(REPRAPWORLD_KEYPAD) \ + && DISABLED(CARTESIO_UI) \ + && DISABLED(ZONESTAR_LCD) + + 1 + #endif + #if ENABLED(RIGIDBOT_PANEL) + + 1 + #endif + #if ENABLED(RA_CONTROL_PANEL) + + 1 + #endif + #if ENABLED(LCD_I2C_SAINSMART_YWROBOT) + + 1 + #endif + #if ENABLED(LCM1602) + + 1 + #endif + #if ENABLED(LCD_I2C_PANELOLU2) + + 1 + #endif + #if ENABLED(LCD_I2C_VIKI) + + 1 + #endif + #if ENABLED(U8GLIB_SSD1306) && DISABLED(OLED_PANEL_TINYBOY2) && DISABLED(MKS_12864OLED_SSD1306) + + 1 + #endif + #if ENABLED(SAV_3DLCD) + + 1 + #endif + #if ENABLED(BQ_LCD_SMART_CONTROLLER) + + 1 + #endif + #if ENABLED(SAV_3DGLCD) + + 1 + #endif + #if ENABLED(OLED_PANEL_TINYBOY2) + + 1 + #endif + #if ENABLED(ZONESTAR_LCD) + + 1 + #endif + , "Please select no more than one LCD controller option." +); + +/** + * Make sure HAVE_TMCDRIVER is warranted + */ +#if ENABLED(HAVE_TMCDRIVER) && !( \ + ENABLED( X_IS_TMC ) \ + || ENABLED( X2_IS_TMC ) \ + || ENABLED( Y_IS_TMC ) \ + || ENABLED( Y2_IS_TMC ) \ + || ENABLED( Z_IS_TMC ) \ + || ENABLED( Z2_IS_TMC ) \ + || ENABLED( E0_IS_TMC ) \ + || ENABLED( E1_IS_TMC ) \ + || ENABLED( E2_IS_TMC ) \ + || ENABLED( E3_IS_TMC ) \ + || ENABLED( E4_IS_TMC ) \ + ) + #error "HAVE_TMCDRIVER requires at least one TMC stepper to be set." #endif /** - * Check existing CS pins against enabled TMC SPI drivers. + * Make sure HAVE_TMC2130 is warranted */ -#if AXIS_DRIVER_TYPE(X, TMC2130) && !PIN_EXISTS(X_CS) - #error "X_CS_PIN is required for TMC2130. Define X_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(X2, TMC2130) && !PIN_EXISTS(X2_CS) - #error "X2_CS_PIN is required for X2. Define X2_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(Y, TMC2130) && !PIN_EXISTS(Y_CS) - #error "Y_CS_PIN is required for TMC2130. Define Y_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(Y2, TMC2130) && !PIN_EXISTS(Y2_CS) - #error "Y2_CS_PIN is required for TMC2130. Define Y2_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(Z, TMC2130) && !PIN_EXISTS(Z_CS) - #error "Z_CS_PIN is required for TMC2130. Define Z_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(Z2, TMC2130) && !PIN_EXISTS(Z2_CS) - #error "Z2_CS_PIN is required for TMC2130. Define Z2_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E0, TMC2130) && !PIN_EXISTS(E0_CS) - #error "E0_CS_PIN is required for TMC2130. Define E0_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E1, TMC2130) && !PIN_EXISTS(E1_CS) - #error "E1_CS_PIN is required for TMC2130. Define E1_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E2, TMC2130) && !PIN_EXISTS(E2_CS) - #error "E2_CS_PIN is required for TMC2130. Define E2_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E3, TMC2130) && !PIN_EXISTS(E3_CS) - #error "E3_CS_PIN is required for TMC2130. Define E3_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E4, TMC2130) && !PIN_EXISTS(E4_CS) - #error "E4_CS_PIN is required for TMC2130. Define E4_CS_PIN in Configuration_adv.h." -#endif - -/** - * TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI) - */ -#if HAS_DRIVER(TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \ - defined(X_HARDWARE_SERIAL ) \ - || defined(X2_HARDWARE_SERIAL) \ - || defined(Y_HARDWARE_SERIAL ) \ - || defined(Y2_HARDWARE_SERIAL) \ - || defined(Z_HARDWARE_SERIAL ) \ - || defined(Z2_HARDWARE_SERIAL) \ - || defined(E0_HARDWARE_SERIAL) \ - || defined(E1_HARDWARE_SERIAL) \ - || defined(E2_HARDWARE_SERIAL) \ - || defined(E3_HARDWARE_SERIAL) \ - || defined(E4_HARDWARE_SERIAL) ) - #error "select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE." -#endif - -#if ENABLED(SENSORLESS_HOMING) - // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop - // is necessary in order to reset the stallGuard indication between the initial movement of all three - // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of - // clearing the stallGuard activated status is found. - #if ENABLED(DELTA) && !ENABLED(STEALTHCHOP) - #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP." - #elif X_SENSORLESS && X_HOME_DIR == -1 && (!X_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMIN)) - #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMIN when homing to X_MIN." - #elif X_SENSORLESS && X_HOME_DIR == 1 && (!X_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMAX)) - #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMAX when homing to X_MAX." - #elif Y_SENSORLESS && Y_HOME_DIR == -1 && (!Y_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMIN)) - #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMIN when homing to Y_MIN." - #elif Y_SENSORLESS && Y_HOME_DIR == 1 && (!Y_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMAX)) - #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMAX when homing to Y_MAX." - #elif Z_SENSORLESS && Z_HOME_DIR == -1 && (!Z_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMIN)) - #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMIN when homing to Z_MIN." - #elif Z_SENSORLESS && Z_HOME_DIR == 1 && (!Z_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMAX)) - #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMAX when homing to Z_MAX." - #elif ENABLED(ENDSTOP_NOISE_FILTER) - #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_FILTER." +#if ENABLED(HAVE_TMC2130) + #if !( ENABLED( X_IS_TMC2130 ) \ + || ENABLED( X2_IS_TMC2130 ) \ + || ENABLED( Y_IS_TMC2130 ) \ + || ENABLED( Y2_IS_TMC2130 ) \ + || ENABLED( Z_IS_TMC2130 ) \ + || ENABLED( Z2_IS_TMC2130 ) \ + || ENABLED( E0_IS_TMC2130 ) \ + || ENABLED( E1_IS_TMC2130 ) \ + || ENABLED( E2_IS_TMC2130 ) \ + || ENABLED( E3_IS_TMC2130 ) \ + || ENABLED( E4_IS_TMC2130 ) ) + #error "HAVE_TMC2130 requires at least one TMC2130 stepper to be set." + #elif ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP) + #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD." + #elif defined(AUTOMATIC_CURRENT_CONTROL) + #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration." #endif #endif -// Sensorless homing is required for both combined steppers in an H-bot -#if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS - #error "CoreXY requires both X and Y to use sensorless homing if either does." -#elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS - #error "CoreXZ requires both X and Z to use sensorless homing if either does." -#elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS - #error "CoreYZ requires both Y and Z to use sensorless homing if either does." +/** + * Make sure HAVE_TMC2208 is warranted + */ + +#if ENABLED(HAVE_TMC2208) && !( \ + ENABLED( X_IS_TMC2208 ) \ + || ENABLED( X2_IS_TMC2208 ) \ + || ENABLED( Y_IS_TMC2208 ) \ + || ENABLED( Y2_IS_TMC2208 ) \ + || ENABLED( Z_IS_TMC2208 ) \ + || ENABLED( Z2_IS_TMC2208 ) \ + || ENABLED( E0_IS_TMC2208 ) \ + || ENABLED( E1_IS_TMC2208 ) \ + || ENABLED( E2_IS_TMC2208 ) \ + || ENABLED( E3_IS_TMC2208 ) ) + #error "HAVE_TMC2208 requires at least one TMC2208 stepper to be set." #endif #if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP) #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD." #endif -#if ENABLED(TMC_Z_CALIBRATION) && !AXIS_IS_TMC(Z) && !AXIS_IS_TMC(Z2) - #error "TMC_Z_CALIBRATION requires at least one TMC driver on Z axis" -#endif -#if ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD - #error "SENSORLESS_HOMING requires TMC2130 or TMC2660 stepper drivers." -#endif -#if ENABLED(STEALTHCHOP) && !HAS_STEALTHCHOP - #error "STEALTHCHOP requires TMC2130 or TMC2208 stepper drivers." +/** + * Make sure HAVE_L6470DRIVER is warranted + */ +#if ENABLED(HAVE_L6470DRIVER) && !( \ + ENABLED( X_IS_L6470 ) \ + || ENABLED( X2_IS_L6470 ) \ + || ENABLED( Y_IS_L6470 ) \ + || ENABLED( Y2_IS_L6470 ) \ + || ENABLED( Z_IS_L6470 ) \ + || ENABLED( Z2_IS_L6470 ) \ + || ENABLED( E0_IS_L6470 ) \ + || ENABLED( E1_IS_L6470 ) \ + || ENABLED( E2_IS_L6470 ) \ + || ENABLED( E3_IS_L6470 ) \ + || ENABLED( E4_IS_L6470 ) \ + ) + #error "HAVE_L6470DRIVER requires at least one L6470 stepper to be set." #endif /** @@ -1588,24 +1512,17 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #endif /** - * Require 5/4 or more elements in per-axis initializers + * Require 4 or more elements in per-axis initializers */ -#if ENABLED(HANGPRINTER) - #define MIN_ELEMENTS "5" -#else - #define MIN_ELEMENTS "4" -#endif - constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT, sanity_arr_2[] = DEFAULT_MAX_FEEDRATE, sanity_arr_3[] = DEFAULT_MAX_ACCELERATION; - -static_assert(COUNT(sanity_arr_1) >= NUM_AXIS, "DEFAULT_AXIS_STEPS_PER_UNIT requires " MIN_ELEMENTS " (or more) elements for HANGPRINTER."); -static_assert(COUNT(sanity_arr_2) >= NUM_AXIS, "DEFAULT_MAX_FEEDRATE requires " MIN_ELEMENTS " (or more) elements for HANGPRINTER."); -static_assert(COUNT(sanity_arr_3) >= NUM_AXIS, "DEFAULT_MAX_ACCELERATION requires " MIN_ELEMENTS " (or more) elements for HANGPRINTER."); -static_assert(COUNT(sanity_arr_1) <= NUM_AXIS_N, "DEFAULT_AXIS_STEPS_PER_UNIT has too many elements."); -static_assert(COUNT(sanity_arr_2) <= NUM_AXIS_N, "DEFAULT_MAX_FEEDRATE has too many elements."); -static_assert(COUNT(sanity_arr_3) <= NUM_AXIS_N, "DEFAULT_MAX_ACCELERATION has too many elements."); +static_assert(COUNT(sanity_arr_1) >= XYZE, "DEFAULT_AXIS_STEPS_PER_UNIT requires 4 (or more) elements."); +static_assert(COUNT(sanity_arr_2) >= XYZE, "DEFAULT_MAX_FEEDRATE requires 4 (or more) elements."); +static_assert(COUNT(sanity_arr_3) >= XYZE, "DEFAULT_MAX_ACCELERATION requires 4 (or more) elements."); +static_assert(COUNT(sanity_arr_1) <= XYZE_N, "DEFAULT_AXIS_STEPS_PER_UNIT has too many elements."); +static_assert(COUNT(sanity_arr_2) <= XYZE_N, "DEFAULT_MAX_FEEDRATE has too many elements."); +static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too many elements."); /** * Sanity checks for Spindle / Laser @@ -1680,10 +1597,6 @@ static_assert(COUNT(sanity_arr_3) <= NUM_AXIS_N, "DEFAULT_MAX_ACCELERATION has t #error "LED_CONTROL_MENU requires an LCD controller." #endif -#if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED) - #error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED." -#endif - #if ENABLED(SKEW_CORRECTION) #if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD)) #error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD." @@ -1698,8 +1611,4 @@ static_assert(COUNT(sanity_arr_3) <= NUM_AXIS_N, "DEFAULT_MAX_ACCELERATION has t #endif #endif -#if ENABLED(POWER_LOSS_RECOVERY) && !ENABLED(ULTIPANEL) - #error "POWER_LOSS_RECOVERY currently requires an LCD Controller." -#endif - #endif // _SANITYCHECK_H_ diff --git a/Marlin/Sd2Card.cpp b/Marlin/Sd2Card.cpp index 118b83c..6683e4b 100644 --- a/Marlin/Sd2Card.cpp +++ b/Marlin/Sd2Card.cpp @@ -297,7 +297,7 @@ bool Sd2Card::eraseSingleBlockEnable() { * \return true for success, false for failure. * The reason for failure can be determined by calling errorCode() and errorData(). */ -bool Sd2Card::init(uint8_t sckRateID, pin_t chipSelectPin) { +bool Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) { errorCode_ = type_ = 0; chipSelectPin_ = chipSelectPin; // 16-bit init start time allows over a minute @@ -399,28 +399,27 @@ bool Sd2Card::readBlock(uint32_t blockNumber, uint8_t* dst) { #if ENABLED(SD_CHECK_AND_RETRY) uint8_t retryCnt = 3; - for (;;) { + for(;;) { if (cardCommand(CMD17, blockNumber)) error(SD_CARD_ERROR_CMD17); else if (readData(dst, 512)) return true; - chipSelectHigh(); if (!--retryCnt) break; + chipSelectHigh(); cardCommand(CMD12, 0); // Try sending a stop command, ignore the result. errorCode_ = 0; } - return false; #else - if (cardCommand(CMD17, blockNumber)) { + if (cardCommand(CMD17, blockNumber)) error(SD_CARD_ERROR_CMD17); - chipSelectHigh(); - return false; - } else return readData(dst, 512); #endif + + chipSelectHigh(); + return false; } /** diff --git a/Marlin/Sd2Card.h b/Marlin/Sd2Card.h index c831f23..9849980 100644 --- a/Marlin/Sd2Card.h +++ b/Marlin/Sd2Card.h @@ -140,7 +140,7 @@ class Sd2Card { * \return true for success or false for failure. */ bool init(uint8_t sckRateID = SPI_FULL_SPEED, - pin_t chipSelectPin = SD_CHIP_SELECT_PIN); + uint8_t chipSelectPin = SD_CHIP_SELECT_PIN); bool readBlock(uint32_t block, uint8_t* dst); /** diff --git a/Marlin/SdBaseFile.cpp b/Marlin/SdBaseFile.cpp index 3754fef..c1d8012 100644 --- a/Marlin/SdBaseFile.cpp +++ b/Marlin/SdBaseFile.cpp @@ -339,38 +339,38 @@ int8_t SdBaseFile::lsPrintNext(uint8_t flags, uint8_t indent) { && DIR_IS_FILE_OR_SUBDIR(&dir)) break; } // indent for dir level - for (uint8_t i = 0; i < indent; i++) SERIAL_CHAR(' '); + for (uint8_t i = 0; i < indent; i++) MYSERIAL.write(' '); // print name for (uint8_t i = 0; i < 11; i++) { if (dir.name[i] == ' ')continue; if (i == 8) { - SERIAL_CHAR('.'); + MYSERIAL.write('.'); w++; } - SERIAL_CHAR(dir.name[i]); + MYSERIAL.write(dir.name[i]); w++; } if (DIR_IS_SUBDIR(&dir)) { - SERIAL_CHAR('/'); + MYSERIAL.write('/'); w++; } if (flags & (LS_DATE | LS_SIZE)) { - while (w++ < 14) SERIAL_CHAR(' '); + while (w++ < 14) MYSERIAL.write(' '); } // print modify date/time if requested if (flags & LS_DATE) { - SERIAL_CHAR(' '); + MYSERIAL.write(' '); printFatDate(dir.lastWriteDate); - SERIAL_CHAR(' '); + MYSERIAL.write(' '); printFatTime(dir.lastWriteTime); } // print size if requested if (!DIR_IS_SUBDIR(&dir) && (flags & LS_SIZE)) { - SERIAL_CHAR(' '); - SERIAL_ECHO(dir.fileSize); + MYSERIAL.write(' '); + MYSERIAL.print(dir.fileSize); } - SERIAL_EOL(); + MYSERIAL.println(); return DIR_IS_FILE(&dir) ? 1 : 2; } @@ -601,7 +601,7 @@ bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t ofla // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { - index = 0xF & (dirFile->curPosition_ >> 5); + index = 0XF & (dirFile->curPosition_ >> 5); p = dirFile->readDirCache(); if (!p) return false; @@ -705,7 +705,7 @@ bool SdBaseFile::open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag) { return false; } // open cached entry - return openCachedEntry(index & 0xF, oflag); + return openCachedEntry(index & 0XF, oflag); } // open a cached directory entry. Assumes vol_ is initialized @@ -775,7 +775,7 @@ bool SdBaseFile::openNext(SdBaseFile* dirFile, uint8_t oflag) { vol_ = dirFile->vol_; while (1) { - index = 0xF & (dirFile->curPosition_ >> 5); + index = 0XF & (dirFile->curPosition_ >> 5); // read entry into cache p = dirFile->readDirCache(); @@ -902,10 +902,11 @@ int SdBaseFile::peek() { return c; } + // print uint8_t with width 2 -static void print2u(const uint8_t v) { - if (v < 10) SERIAL_CHAR('0'); - SERIAL_ECHO_F(v, DEC); +static void print2u(uint8_t v) { + if (v < 10) MYSERIAL.write('0'); + MYSERIAL.print(v, DEC); } /** @@ -926,10 +927,10 @@ static void print2u(const uint8_t v) { * \param[in] fatDate The date field from a directory entry. */ void SdBaseFile::printFatDate(uint16_t fatDate) { - SERIAL_ECHO(FAT_YEAR(fatDate)); - SERIAL_CHAR('-'); + MYSERIAL.print(FAT_YEAR(fatDate)); + MYSERIAL.write('-'); print2u(FAT_MONTH(fatDate)); - SERIAL_CHAR('-'); + MYSERIAL.write('-'); print2u(FAT_DAY(fatDate)); } @@ -944,9 +945,9 @@ void SdBaseFile::printFatDate(uint16_t fatDate) { */ void SdBaseFile::printFatTime(uint16_t fatTime) { print2u(FAT_HOUR(fatTime)); - SERIAL_CHAR(':'); + MYSERIAL.write(':'); print2u(FAT_MINUTE(fatTime)); - SERIAL_CHAR(':'); + MYSERIAL.write(':'); print2u(FAT_SECOND(fatTime)); } @@ -958,7 +959,7 @@ void SdBaseFile::printFatTime(uint16_t fatTime) { bool SdBaseFile::printName() { char name[FILENAME_LENGTH]; if (!getFilename(name)) return false; - SERIAL_ECHO(name); + MYSERIAL.print(name); return true; } @@ -1054,9 +1055,8 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { // if not a directory file or miss-positioned return an error if (!isDir() || (0x1F & curPosition_)) return -1; - // If we have a longFilename buffer, mark it as invalid. - // If a long filename is found it will be filled automatically. - if (longFilename) longFilename[0] = '\0'; + //If we have a longFilename buffer, mark it as invalid. If we find a long filename it will be filled automaticly. + if (longFilename != NULL) longFilename[0] = '\0'; while (1) { @@ -1066,15 +1066,12 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { // last entry if DIR_NAME_FREE if (dir->name[0] == DIR_NAME_FREE) return 0; - // skip deleted entry and entry for . and .. - if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') { - if (longFilename) longFilename[0] = '\0'; // Invalidate erased file long name, if any - continue; - } + // skip empty entries and entry for . and .. + if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; // Fill the long filename if we have a long filename entry. // Long filename entries are stored before the short filename. - if (longFilename && DIR_IS_LONG_NAME(dir)) { + if (longFilename != NULL && DIR_IS_LONG_NAME(dir)) { vfat_t* VFAT = (vfat_t*)dir; // Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0 if (VFAT->firstClusterLow == 0) { @@ -1103,7 +1100,7 @@ dir_t* SdBaseFile::readDirCache() { if (!isDir()) return 0; // index of entry in cache - i = (curPosition_ >> 5) & 0xF; + i = (curPosition_ >> 5) & 0XF; // use read to locate and cache block if (read() < 0) return 0; @@ -1725,4 +1722,8 @@ int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) { return -1; } +#if ALLOW_DEPRECATED_FUNCTIONS + void (*SdBaseFile::oldDateTime_)(uint16_t &date, uint16_t &time) = 0; +#endif + #endif // SDSUPPORT diff --git a/Marlin/SdBaseFile.h b/Marlin/SdBaseFile.h index 12216bd..425c65f 100644 --- a/Marlin/SdBaseFile.h +++ b/Marlin/SdBaseFile.h @@ -37,8 +37,6 @@ #include "SdFatConfig.h" #include "SdVolume.h" -#include - /** * \struct filepos_t * \brief internal type for istream @@ -385,6 +383,119 @@ class SdBaseFile { bool open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag); bool openCachedEntry(uint8_t cacheIndex, uint8_t oflags); dir_t* readDirCache(); + +// Deprecated functions +#if ALLOW_DEPRECATED_FUNCTIONS + public: + + /** + * \deprecated Use: + * bool contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock); + * \param[out] bgnBlock the first block address for the file. + * \param[out] endBlock the last block address for the file. + * \return true for success or false for failure. + */ + bool contiguousRange(uint32_t& bgnBlock, uint32_t& endBlock) { + return contiguousRange(&bgnBlock, &endBlock); + } + + /** + * \deprecated Use: + * bool createContiguous(SdBaseFile* dirFile, const char* path, uint32_t size) + * \param[in] dirFile The directory where the file will be created. + * \param[in] path A path with a valid DOS 8.3 file name. + * \param[in] size The desired file size. + * \return true for success or false for failure. + */ + bool createContiguous(SdBaseFile& dirFile, const char* path, uint32_t size) { + return createContiguous(&dirFile, path, size); + } + + /** + * \deprecated Use: + * static void dateTimeCallback( + * void (*dateTime)(uint16_t* date, uint16_t* time)); + * \param[in] dateTime The user's call back function. + */ + static void dateTimeCallback( + void (*dateTime)(uint16_t &date, uint16_t &time)) { + oldDateTime_ = dateTime; + dateTime_ = dateTime ? oldToNew : 0; + } + + /** + * \deprecated Use: + * bool open(SdBaseFile* dirFile, const char* path, uint8_t oflag); + * \param[in] dirFile An open SdFat instance for the directory containing the + * file to be opened. + * \param[in] path A path with a valid 8.3 DOS name for the file. + * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive + * OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC. + * \return true for success or false for failure. + */ + bool open(SdBaseFile& dirFile, const char* path, uint8_t oflag) { + return open(&dirFile, path, oflag); + } + + /** + * \deprecated Do not use in new apps + * \param[in] dirFile An open SdFat instance for the directory containing the + * file to be opened. + * \param[in] path A path with a valid 8.3 DOS name for a file to be opened. + * \return true for success or false for failure. + */ + bool open(SdBaseFile& dirFile, const char* path) { + return open(dirFile, path, O_RDWR); + } + + /** + * \deprecated Use: + * bool open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag); + * \param[in] dirFile An open SdFat instance for the directory. + * \param[in] index The \a index of the directory entry for the file to be + * opened. The value for \a index is (directory file position)/32. + * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive + * OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC. + * \return true for success or false for failure. + */ + bool open(SdBaseFile& dirFile, uint16_t index, uint8_t oflag) { + return open(&dirFile, index, oflag); + } + + /** + * \deprecated Use: bool openRoot(SdVolume* vol); + * \param[in] vol The FAT volume containing the root directory to be opened. + * \return true for success or false for failure. + */ + bool openRoot(SdVolume& vol) { return openRoot(&vol); } + + /** + * \deprecated Use: int8_t readDir(dir_t* dir); + * \param[out] dir The dir_t struct that will receive the data. + * \return bytes read for success zero for eof or -1 for failure. + */ + int8_t readDir(dir_t& dir, char* longFilename) { + return readDir(&dir, longFilename); + } + + /** + * \deprecated Use: + * static uint8_t remove(SdBaseFile* dirFile, const char* path); + * \param[in] dirFile The directory that contains the file. + * \param[in] path The name of the file to be removed. + * \return true for success or false for failure. + */ + static bool remove(SdBaseFile& dirFile, const char* path) { return remove(&dirFile, path); } + + private: + static void (*oldDateTime_)(uint16_t &date, uint16_t &time); + static void oldToNew(uint16_t * const date, uint16_t * const time) { + uint16_t d, t; + oldDateTime_(d, t); + *date = d; + *time = t; + } +#endif // ALLOW_DEPRECATED_FUNCTIONS }; #endif // _SDBASEFILE_H_ diff --git a/Marlin/SdFatConfig.h b/Marlin/SdFatConfig.h index cfa5e34..606a66f 100644 --- a/Marlin/SdFatConfig.h +++ b/Marlin/SdFatConfig.h @@ -61,6 +61,11 @@ */ #define ENDL_CALLS_FLUSH 0 +/** + * Allow use of deprecated functions if ALLOW_DEPRECATED_FUNCTIONS is nonzero + */ +#define ALLOW_DEPRECATED_FUNCTIONS 1 + /** * Allow FAT12 volumes if FAT12_SUPPORT is nonzero. * FAT12 has not been well tested. diff --git a/Marlin/SdFatUtil.cpp b/Marlin/SdFatUtil.cpp index 2bd471b..1d8cdb4 100644 --- a/Marlin/SdFatUtil.cpp +++ b/Marlin/SdFatUtil.cpp @@ -63,7 +63,7 @@ int SdFatUtil::FreeRam() { * \param[in] str Pointer to string stored in flash memory. */ void SdFatUtil::print_P(PGM_P str) { - for (uint8_t c; (c = pgm_read_byte(str)); str++) SERIAL_CHAR(c); + for (uint8_t c; (c = pgm_read_byte(str)); str++) MYSERIAL.write(c); } /** @@ -72,7 +72,7 @@ void SdFatUtil::print_P(PGM_P str) { * \param[in] pr Print object for output. * \param[in] str Pointer to string stored in flash memory. */ -void SdFatUtil::println_P(PGM_P str) { print_P(str); SERIAL_EOL(); } +void SdFatUtil::println_P(PGM_P str) { print_P(str); MYSERIAL.println(); } /** * %Print a string in flash memory to Serial. diff --git a/Marlin/SdVolume.cpp b/Marlin/SdVolume.cpp index df781cb..bf8abc5 100644 --- a/Marlin/SdVolume.cpp +++ b/Marlin/SdVolume.cpp @@ -204,7 +204,7 @@ bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { index &= 0x1FF; uint8_t tmp = value; if (cluster & 1) { - tmp = (cacheBuffer_.data[index] & 0xF) | tmp << 4; + tmp = (cacheBuffer_.data[index] & 0XF) | tmp << 4; } cacheBuffer_.data[index] = tmp; index++; diff --git a/Marlin/Version.h b/Marlin/Version.h index c34d0ee..2a6b30c 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -35,20 +35,20 @@ /** * Marlin release version identifier */ - #define SHORT_BUILD_VERSION "1.1.9" + #define SHORT_BUILD_VERSION "1.1.8" /** * 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, davidramiro)" + #define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (davidramiro, Github)" /** * 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 "2019-01-22" + #define STRING_DISTRIBUTION_DATE "2019-01-31 12:00" /** * Required minimum Configuration.h and Configuration_adv.h file versions. @@ -57,8 +57,8 @@ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option on * the configuration files. */ - #define REQUIRED_CONFIGURATION_H_VERSION 010109 - #define REQUIRED_CONFIGURATION_ADV_H_VERSION 010109 + #define REQUIRED_CONFIGURATION_H_VERSION 010107 + #define REQUIRED_CONFIGURATION_ADV_H_VERSION 010107 /** * The protocol for communication to the host. Protocol indicates communication @@ -70,7 +70,7 @@ /** * Defines a generic printer name to be output to the LCD after booting Marlin. */ - #define MACHINE_NAME "Anycubic i3 Mega" + #define MACHINE_NAME "3D Printer" /** * The SOURCE_CODE_URL is the location where users will find the Marlin Source diff --git a/Marlin/boards.h b/Marlin/boards.h index a7aceff..e31cbf4 100644 --- a/Marlin/boards.h +++ b/Marlin/boards.h @@ -58,10 +58,8 @@ #define BOARD_K8400 79 // Velleman K8400 Controller (derived from 3Drag Controller) #define BOARD_BAM_DICE 401 // 2PrintBeta BAM&DICE with STK drivers #define BOARD_BAM_DICE_DUE 402 // 2PrintBeta BAM&DICE Due with STK drivers -#define BOARD_MKS_BASE 40 // MKS BASE v1.0 -#define BOARD_MKS_BASE_15 405 // MKS v1.5 with Allegro A4982 stepper drivers -#define BOARD_MKS_BASE_HEROIC 41 // MKS BASE 1.0 with Heroic HR4982 stepper drivers -#define BOARD_MKS_GEN_13 47 // MKS GEN v1.3 or 1.4 +#define BOARD_MKS_BASE 40 // MKS BASE 1.0 +#define BOARD_MKS_13 47 // MKS v1.3 or 1.4 (maybe higher) #define BOARD_MKS_GEN_L 53 // MKS GEN L #define BOARD_ZRIB_V20 504 // zrib V2.0 control board (Chinese knock off RAMPS replica) #define BOARD_FELIX2 37 // Felix 2.0+ Electronics Board (RAMPS like) @@ -76,9 +74,6 @@ #define BOARD_RUMBA 80 // Rumba #define BOARD_BQ_ZUM_MEGA_3D 503 // bq ZUM Mega 3D #define BOARD_MAKEBOARD_MINI 431 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake -#define BOARD_TRIGORILLA_13 343 // TriGorilla Anycubic version 1.3 based on RAMPS EFB -#define BOARD_TRIGORILLA_14 443 // TriGorilla Anycubic version 1.4 based on RAMPS EFB -#define BOARD_RAMPS_ENDER_4 243 // Creality: Ender-4, CR-8 // // Other ATmega1280, ATmega2560 @@ -96,8 +91,6 @@ #define BOARD_RAMBO 301 // Rambo #define BOARD_MINIRAMBO 302 // Mini-Rambo #define BOARD_MINIRAMBO_10A 303 // Mini-Rambo 1.0a -#define BOARD_EINSY_RAMBO 304 // Einsy Rambo -#define BOARD_EINSY_RETRO 305 // Einsy Retro #define BOARD_ELEFU_3 21 // Elefu Ra Board (v3) #define BOARD_LEAPFROG 999 // Leapfrog #define BOARD_MEGACONTROLLER 310 // Mega controller @@ -121,11 +114,8 @@ #define BOARD_MELZI 63 // Melzi #define BOARD_MELZI_MAKR3D 66 // Melzi with ATmega1284 (MaKr3d version) #define BOARD_MELZI_CREALITY 89 // Melzi Creality3D board (for CR-10 etc) -#define BOARD_MELZI_MALYAN 92 // Melzi Malyan M150 board -#define BOARD_MELZI_TRONXY 505 // Tronxy X5S #define BOARD_STB_11 64 // STB V1.1 #define BOARD_AZTEEG_X1 65 // Azteeg X1 -#define BOARD_ANET_10 69 // Anet 1.0 (Melzi clone) // // Other ATmega644P, ATmega644, ATmega1284P @@ -142,6 +132,7 @@ #define BOARD_OMCA_A 90 // Alpha OMCA board #define BOARD_OMCA 91 // Final OMCA board #define BOARD_SETHI 20 // Sethi 3D_1 +#define BOARD_ANET_10 69 // Anet 1.0 (Melzi clone) // // Teensyduino - AT90USB1286, AT90USB1286P @@ -156,6 +147,8 @@ #define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286) - CLI compile: HARDWARE_MOTHERBOARD=84 make #define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board +#define BOARD_TRIGORILLA 998 // Tigorilla + #define MB(board) (MOTHERBOARD==BOARD_##board) #endif // __BOARDS_H diff --git a/Marlin/buzzer.h b/Marlin/buzzer.h index d36447d..530b729 100644 --- a/Marlin/buzzer.h +++ b/Marlin/buzzer.h @@ -104,7 +104,7 @@ class Buzzer { * @param duration Duration of the tone in milliseconds * @param frequency Frequency of the tone in hertz */ - void tone(const uint16_t &duration, const uint16_t &frequency=0) { + void tone(const uint16_t &duration, const uint16_t &frequency = 0) { while (buffer.isFull()) { this->tick(); thermalManager.manage_heater(); diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index 082da72..4d56438 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -29,11 +29,8 @@ #include "ultralcd.h" #include "stepper.h" #include "language.h" -#include "printcounter.h" -#if ENABLED(POWER_LOSS_RECOVERY) - #include "power_loss_recovery.h" -#endif +#define LONGEST_FILENAME (longFilename[0] ? longFilename : filename) CardReader::CardReader() { #if ENABLED(SDCARD_SORT_ALPHA) @@ -52,13 +49,15 @@ CardReader::CardReader() { workDirDepth = 0; ZERO(workDirParents); - // Disable autostart until card is initialized - autostart_index = -1; + autostart_stilltocheck = true; //the SD start is delayed, because otherwise the serial cannot answer fast enough to make contact with the host software. + autostart_index = 0; //power to SD reader #if SDPOWER > -1 OUT_WRITE(SDPOWER, HIGH); - #endif + #endif // SDPOWER + + next_autostart_ms = millis() + 5000; } char *createFilename(char *buffer, const dir_t &p) { //buffer > 12characters @@ -86,25 +85,25 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m uint8_t cnt = 0; // Read the next entry from a directory - while (parent.readDir(&p, longFilename) > 0) { + while (parent.readDir(p, longFilename) > 0) { // If the entry is a directory and the action is LS_SerialPrint if (DIR_IS_SUBDIR(&p) && lsAction != LS_Count && lsAction != LS_GetFilename) { // Get the short name for the item, which we know is a folder - char dosFilename[FILENAME_LENGTH]; - createFilename(dosFilename, p); + char lfilename[FILENAME_LENGTH]; + createFilename(lfilename, p); // Allocate enough stack space for the full path to a folder, trailing slash, and nul - const bool prepend_is_empty = (!prepend || prepend[0] == '\0'); - const int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(dosFilename) + 1 + 1; + bool prepend_is_empty = (prepend[0] == '\0'); + int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; char path[len]; // Append the FOLDERNAME12/ to the passed string. // It contains the full path to the "parent" argument. // We now have the full path to the item in this folder. strcpy(path, prepend_is_empty ? "/" : prepend); // root slash if prepend is empty - strcat(path, dosFilename); // FILENAME_LENGTH-1 characters maximum + strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum strcat(path, "/"); // 1 character // Serial.print(path); @@ -112,11 +111,11 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m // Get a new directory object using the full path // and dive recursively into it. SdFile dir; - if (!dir.open(&parent, dosFilename, O_READ)) { + if (!dir.open(parent, lfilename, O_READ)) { if (lsAction == LS_SerialPrint) { SERIAL_ECHO_START(); SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); - SERIAL_ECHOLN(dosFilename); + SERIAL_ECHOLN(lfilename); } } lsDive(path, dir); @@ -141,7 +140,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m case LS_SerialPrint: createFilename(filename, p); - if (prepend) SERIAL_PROTOCOL(prepend); + SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); SERIAL_PROTOCOLCHAR(' '); SERIAL_PROTOCOLLN(p.fileSize); @@ -164,7 +163,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m void CardReader::ls() { lsAction = LS_SerialPrint; root.rewind(); - lsDive(NULL, root); + lsDive("", root); } #if ENABLED(LONG_FILENAME_HOST_SUPPORT) @@ -199,7 +198,7 @@ void CardReader::ls() { // Find the item, setting the long filename diveDir.rewind(); - lsDive(NULL, diveDir, segment); + lsDive("", diveDir, segment); // Print /LongNamePart to serial output SERIAL_PROTOCOLCHAR('/'); @@ -212,7 +211,7 @@ void CardReader::ls() { // Open the sub-item as the new dive parent SdFile dir; - if (!dir.open(&diveDir, segment, O_READ)) { + if (!dir.open(diveDir, segment, O_READ)) { SERIAL_EOL(); SERIAL_ECHO_START(); SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); @@ -230,28 +229,6 @@ void CardReader::ls() { #endif // LONG_FILENAME_HOST_SUPPORT -/** - * Echo the DOS 8.3 filename (and long filename, if any) - */ -void CardReader::printFilename() { - if (file.isOpen()) { - char dosFilename[FILENAME_LENGTH]; - file.getFilename(dosFilename); - SERIAL_ECHO(dosFilename); - #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - getfilename(0, dosFilename); - if (longFilename[0]) { - SERIAL_ECHO(' '); - SERIAL_ECHO(longFilename); - } - #endif - } - else - SERIAL_ECHOPGM("(no file)"); - - SERIAL_EOL(); -} - void CardReader::initsd() { cardOK = false; if (root.isOpen()) root.close(); @@ -260,16 +237,16 @@ void CardReader::initsd() { #define SPI_SPEED SPI_FULL_SPEED #endif - if (!sd2card.init(SPI_SPEED, SDSS) + if (!card.init(SPI_SPEED, SDSS) #if defined(LCD_SDSS) && (LCD_SDSS != SDSS) - && !sd2card.init(SPI_SPEED, LCD_SDSS) + && !card.init(SPI_SPEED, LCD_SDSS) #endif ) { - //if (!sd2card.init(SPI_HALF_SPEED,SDSS)) + //if (!card.init(SPI_HALF_SPEED,SDSS)) SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(MSG_SD_INIT_FAIL); } - else if (!volume.init(&sd2card)) { + else if (!volume.init(&card)) { SERIAL_ERROR_START(); SERIAL_ERRORLNPGM(MSG_SD_VOL_INIT_FAIL); } @@ -285,6 +262,17 @@ void CardReader::initsd() { setroot(); } +void CardReader::setroot() { + /*if (!workDir.openRoot(&volume)) { + SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); + }*/ + workDir = root; + curDir = &workDir; + #if ENABLED(SDCARD_SORT_ALPHA) + presort(); + #endif +} + void CardReader::release() { sdprinting = false; cardOK = false; @@ -294,37 +282,27 @@ void CardReader::openAndPrintFile(const char *name) { char cmd[4 + strlen(name) + 1]; // Room for "M23 ", filename, and null sprintf_P(cmd, PSTR("M23 %s"), name); for (char *c = &cmd[4]; *c; c++) *c = tolower(*c); - enqueue_and_echo_command_now(cmd); + enqueue_and_echo_command(cmd); enqueue_and_echo_commands_P(PSTR("M24")); } void CardReader::startFileprint() { if (cardOK) { sdprinting = true; - #if SD_RESORT + #if ENABLED(SDCARD_SORT_ALPHA) flush_presort(); #endif } } -void CardReader::stopSDPrint( - #if SD_RESORT - const bool re_sort/*=false*/ - #endif -) { - #if ENABLED(ADVANCED_PAUSE_FEATURE) - did_pause_print = 0; - #endif - sdprinting = abort_sd_printing = false; +void CardReader::stopSDPrint() { + sdprinting = false; if (isFileOpen()) file.close(); - #if SD_RESORT - if (re_sort) presort(); - #endif } -void CardReader::openLogFile(char * const path) { +void CardReader::openLogFile(char* name) { logging = true; - openFile(path, false); + openFile(name, false); } void appendAtom(SdFile &file, char *& dst, uint8_t &cnt) { @@ -347,7 +325,7 @@ void CardReader::getAbsFilename(char *t) { *t = '\0'; } -void CardReader::openFile(char * const path, const bool read, const bool subcall/*=false*/) { +void CardReader::openFile(char* name, const bool read, const bool subcall/*=false*/) { if (!cardOK) return; @@ -357,7 +335,7 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) { SERIAL_ERROR_START(); SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:"); - SERIAL_ERRORLN((int)SD_PROCEDURE_DEPTH); + SERIAL_ERRORLN(SD_PROCEDURE_DEPTH); kill(PSTR(MSG_KILLED)); return; } @@ -367,7 +345,7 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall filespos[file_subcall_ctr] = sdpos; SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("SUBROUTINE CALL target:\"", path); + SERIAL_ECHOPAIR("SUBROUTINE CALL target:\"", name); SERIAL_ECHOPAIR("\" parent:\"", proc_filenames[file_subcall_ctr]); SERIAL_ECHOLNPAIR("\" pos", sdpos); file_subcall_ctr++; @@ -388,14 +366,49 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall SERIAL_ECHO_START(); SERIAL_ECHOPGM("Now "); serialprintPGM(doing == 1 ? PSTR("doing") : PSTR("fresh")); - SERIAL_ECHOLNPAIR(" file: ", path); + SERIAL_ECHOLNPAIR(" file: ", name); } stopSDPrint(); - SdFile *curDir; - const char * const fname = diveToFile(curDir, path, false); - if (!fname) return; + SdFile myDir; + curDir = &root; + char *fname = name; + char *dirname_start, *dirname_end; + + if (name[0] == '/') { + dirname_start = &name[1]; + while (dirname_start != NULL) { + dirname_end = strchr(dirname_start, '/'); + //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'; + if (!myDir.open(curDir, subdirname, O_READ)) { + SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); + SERIAL_PROTOCOL(subdirname); + SERIAL_PROTOCOLCHAR('.'); + return; + } + else { + //SERIAL_ECHOLNPGM("dive ok"); + } + + curDir = &myDir; + dirname_start = dirname_end + 1; + } + else { // the remainder after all /fsa/fdsa/ is the filename + fname = dirname_start; + //SERIAL_ECHOLNPGM("remainder"); + //SERIAL_ECHOLN(fname); + break; + } + } + } + else + curDir = &workDir; // Relative paths start in current directory if (read) { if (file.open(curDir, fname, O_READ)) { @@ -404,12 +417,8 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall SERIAL_PROTOCOLPAIR(MSG_SD_FILE_OPENED, fname); SERIAL_PROTOCOLLNPAIR(MSG_SD_SIZE, filesize); SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED); - getfilename(0, fname); lcd_setstatus(longFilename[0] ? longFilename : fname); - //if (longFilename[0]) { - // SERIAL_PROTOCOLPAIR(MSG_SD_FILE_LONG_NAME, longFilename); - //} } else { SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname); @@ -425,7 +434,7 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall } else { saving = true; - SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, path); + SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, name); lcd_setstatus(fname); } } @@ -436,9 +445,40 @@ void CardReader::removeFile(const char * const name) { stopSDPrint(); - SdFile *curDir; - const char * const fname = diveToFile(curDir, name, false); - if (!fname) return; + SdFile myDir; + curDir = &root; + const char *fname = name; + + char *dirname_start, *dirname_end; + if (name[0] == '/') { + dirname_start = strchr(name, '/') + 1; + while (dirname_start != NULL) { + dirname_end = strchr(dirname_start, '/'); + //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_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, subdirname); + SERIAL_PROTOCOLCHAR('.'); + SERIAL_EOL(); + return; + } + + curDir = &myDir; + dirname_start = dirname_end + 1; + } + else { + fname = dirname_start; + break; + } + } + } + else // Relative paths are rooted in the current directory + curDir = &workDir; if (file.remove(curDir, fname)) { SERIAL_PROTOCOLPGM("File deleted:"); @@ -456,7 +496,7 @@ void CardReader::removeFile(const char * const name) { } void CardReader::getStatus() { - if (cardOK && sdprinting) { + if (cardOK) { SERIAL_PROTOCOLPGM(MSG_SD_PRINTING_BYTE); SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOLCHAR('/'); @@ -486,46 +526,40 @@ void CardReader::write_command(char *buf) { } } -// -// Run the next autostart file. Called: -// - On boot after successful card init -// - After finishing the previous autostart file -// - From the LCD command to run the autostart file -// +void CardReader::checkautostart(bool force) { + if (!force && (!autostart_stilltocheck || PENDING(millis(), next_autostart_ms))) + return; -void CardReader::checkautostart() { + autostart_stilltocheck = false; - if (autostart_index < 0 || sdprinting) return; + if (!cardOK) { + initsd(); + if (!cardOK) return; // fail + } - if (!cardOK) initsd(); + char autoname[10]; + sprintf_P(autoname, PSTR("auto%i.g"), autostart_index); + for (int8_t i = 0; i < (int8_t)strlen(autoname); i++) autoname[i] = tolower(autoname[i]); - if (cardOK - #if ENABLED(POWER_LOSS_RECOVERY) - && !jobRecoverFileExists() // Don't run auto#.g when a resume file exists - #endif - ) { - char autoname[10]; - sprintf_P(autoname, PSTR("auto%i.g"), int(autostart_index)); - dir_t p; - root.rewind(); - while (root.readDir(&p, NULL) > 0) { - for (int8_t i = (int8_t)strlen((char*)p.name); i--;) p.name[i] = tolower(p.name[i]); - if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) { - openAndPrintFile(autoname); - autostart_index++; - return; - } + dir_t p; + + root.rewind(); + + bool found = false; + while (root.readDir(p, NULL) > 0) { + for (int8_t i = (int8_t)strlen((char*)p.name); i--;) p.name[i] = tolower(p.name[i]); + if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) { + openAndPrintFile(autoname); + found = true; } } - autostart_index = -1; + if (!found) + autostart_index = -1; + else + autostart_index++; } -void CardReader::beginautostart() { - autostart_index = 0; - setroot(); -} - -void CardReader::closefile(const bool store_location) { +void CardReader::closefile(bool store_location) { file.sync(); file.close(); saving = logging = false; @@ -538,7 +572,6 @@ void CardReader::closefile(const bool store_location) { /** * Get the name of a file in the current directory by index - * with optional name to match. */ void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) { #if ENABLED(SDSORT_CACHE_NAMES) @@ -555,59 +588,35 @@ void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) { return; } #endif // SDSORT_CACHE_NAMES + curDir = &workDir; lsAction = LS_GetFilename; nrFile_index = nr; - workDir.rewind(); - lsDive(NULL, workDir, match); + curDir->rewind(); + lsDive("", *curDir, match); } uint16_t CardReader::getnrfilenames() { + curDir = &workDir; lsAction = LS_Count; nrFiles = 0; - workDir.rewind(); - lsDive(NULL, workDir); + curDir->rewind(); + lsDive("", *curDir); //SERIAL_ECHOLN(nrFiles); return nrFiles; } -/** - * Dive to the given file path, with optional echo. - * On exit set curDir and return the name part of the path. - * A NULL result indicates an unrecoverable error. - */ -const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, const bool echo) { - SdFile myDir; - if (path[0] != '/') { curDir = &workDir; return path; } - - curDir = &root; - const char *dirname_start = &path[1]; - while (dirname_start) { - char * const dirname_end = strchr(dirname_start, '/'); - if (dirname_end <= dirname_start) break; - const uint8_t len = dirname_end - dirname_start; - char dosSubdirname[len + 1]; - strncpy(dosSubdirname, dirname_start, len); - dosSubdirname[len] = 0; - - if (echo) SERIAL_ECHOLN(dosSubdirname); - - if (!myDir.open(curDir, dosSubdirname, O_READ)) { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, dosSubdirname); - SERIAL_PROTOCOLCHAR('.'); - SERIAL_EOL(); - return NULL; - } - curDir = &myDir; - dirname_start = dirname_end + 1; - } - return dirname_start; -} - void CardReader::chdir(const char * relpath) { SdFile newDir; - SdFile *parent = workDir.isOpen() ? &workDir : &root; + SdFile *parent = &root; - if (newDir.open(parent, relpath, O_READ)) { + if (workDir.isOpen()) parent = &workDir; + + if (!newDir.open(*parent, relpath, O_READ)) { + SERIAL_ECHO_START(); + SERIAL_ECHOPGM(MSG_SD_CANT_ENTER_SUBDIR); + SERIAL_ECHOLN(relpath); + } + else { workDir = newDir; if (workDirDepth < MAX_DIR_DEPTH) workDirParents[workDirDepth++] = workDir; @@ -615,11 +624,6 @@ void CardReader::chdir(const char * relpath) { presort(); #endif } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SD_CANT_ENTER_SUBDIR); - SERIAL_ECHOLN(relpath); - } } int8_t CardReader::updir() { @@ -632,16 +636,6 @@ int8_t CardReader::updir() { return workDirDepth; } -void CardReader::setroot() { - /*if (!workDir.openRoot(&volume)) { - SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); - }*/ - workDir = root; - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif -} - #if ENABLED(SDCARD_SORT_ALPHA) /** @@ -666,14 +660,14 @@ void CardReader::setroot() { */ void CardReader::presort() { - // Throw away old sort index - flush_presort(); - // Sorting may be turned off #if ENABLED(SDSORT_GCODE) if (!sort_alpha) return; #endif + // Throw away old sort index + flush_presort(); + // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); if (fileCnt > 0) { @@ -729,7 +723,7 @@ void CardReader::setroot() { getfilename(i); #if ENABLED(SDSORT_DYNAMIC_RAM) // Use dynamic method to copy long filename - sortnames[i] = strdup(longest_filename()); + sortnames[i] = strdup(LONGEST_FILENAME); #if ENABLED(SDSORT_CACHE_NAMES) // When caching also store the short name, since // we're replacing the getfilename() behavior. @@ -738,10 +732,10 @@ void CardReader::setroot() { #else // Copy filenames into the static array #if SORTED_LONGNAME_MAXLEN != LONG_FILENAME_LENGTH - strncpy(sortnames[i], longest_filename(), SORTED_LONGNAME_MAXLEN); + strncpy(sortnames[i], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN); sortnames[i][SORTED_LONGNAME_MAXLEN - 1] = '\0'; #else - strncpy(sortnames[i], longest_filename(), SORTED_LONGNAME_MAXLEN); + strncpy(sortnames[i], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN); #endif #if ENABLED(SDSORT_CACHE_NAMES) strcpy(sortshort[i], filename); @@ -789,12 +783,12 @@ void CardReader::setroot() { // throughout the loop. Slow if there are many. #if DISABLED(SDSORT_USES_RAM) getfilename(o1); - strcpy(name1, longest_filename()); // save (or getfilename below will trounce it) + strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; #endif getfilename(o2); - char *name2 = longest_filename(); // use the string in-place + char *name2 = LONGEST_FILENAME; // use the string in-place #endif // !SDSORT_USES_RAM // Sort the current pair according to settings. @@ -832,7 +826,7 @@ void CardReader::setroot() { getfilename(0); #if ENABLED(SDSORT_DYNAMIC_RAM) sortnames = new char*[1]; - sortnames[0] = strdup(longest_filename()); // malloc + sortnames[0] = strdup(LONGEST_FILENAME); // malloc #if ENABLED(SDSORT_CACHE_NAMES) sortshort = new char*[1]; sortshort[0] = strdup(filename); // malloc @@ -840,10 +834,10 @@ void CardReader::setroot() { isDir = new uint8_t[1]; #else #if SORTED_LONGNAME_MAXLEN != LONG_FILENAME_LENGTH - strncpy(sortnames[0], longest_filename(), SORTED_LONGNAME_MAXLEN); + strncpy(sortnames[0], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN); sortnames[0][SORTED_LONGNAME_MAXLEN - 1] = '\0'; #else - strncpy(sortnames[0], longest_filename(), SORTED_LONGNAME_MAXLEN); + strncpy(sortnames[0], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN); #endif #if ENABLED(SDSORT_CACHE_NAMES) strcpy(sortshort[0], filename); @@ -887,7 +881,7 @@ uint16_t CardReader::get_num_Files() { } void CardReader::printingHasFinished() { - planner.synchronize(); + stepper.synchronize(); file.close(); if (file_subcall_ctr > 0) { // Heading up to a parent file that called current as a procedure. file_subcall_ctr--; @@ -897,13 +891,8 @@ void CardReader::printingHasFinished() { } else { sdprinting = false; - - #if ENABLED(POWER_LOSS_RECOVERY) - removeJobRecoveryFile(); - #endif - #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) - planner.finish_and_disable(); + stepper.cleaning_buffer_counter = 1; // The command will fire from the Stepper ISR #endif print_job_timer.stop(); if (print_job_timer.duration() > 60) @@ -911,77 +900,11 @@ void CardReader::printingHasFinished() { #if ENABLED(SDCARD_SORT_ALPHA) presort(); #endif - #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY) - progress_bar_percent = 0; - #endif + #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) lcd_reselect_last_file(); #endif } } -#if ENABLED(AUTO_REPORT_SD_STATUS) - uint8_t CardReader::auto_report_sd_interval = 0; - millis_t CardReader::next_sd_report_ms; - - void CardReader::auto_report_sd_status() { - millis_t current_ms = millis(); - if (auto_report_sd_interval && ELAPSED(current_ms, next_sd_report_ms)) { - next_sd_report_ms = current_ms + 1000UL * auto_report_sd_interval; - getStatus(); - } - } -#endif // AUTO_REPORT_SD_STATUS - -#if ENABLED(POWER_LOSS_RECOVERY) - - char job_recovery_file_name[4] = "bin"; - - void CardReader::openJobRecoveryFile(const bool read) { - if (!cardOK) return; - if (jobRecoveryFile.isOpen()) return; - if (!jobRecoveryFile.open(&root, job_recovery_file_name, read ? O_READ : O_CREAT | O_WRITE | O_TRUNC | O_SYNC)) { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, job_recovery_file_name); - SERIAL_PROTOCOLCHAR('.'); - SERIAL_EOL(); - } - else if (!read) - SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, job_recovery_file_name); - } - - void CardReader::closeJobRecoveryFile() { jobRecoveryFile.close(); } - - bool CardReader::jobRecoverFileExists() { - const bool exists = jobRecoveryFile.open(&root, job_recovery_file_name, O_READ); - if (exists) jobRecoveryFile.close(); - return exists; - } - - int16_t CardReader::saveJobRecoveryInfo() { - jobRecoveryFile.seekSet(0); - const int16_t ret = jobRecoveryFile.write(&job_recovery_info, sizeof(job_recovery_info)); - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - if (ret == -1) SERIAL_PROTOCOLLNPGM("Power-loss file write failed."); - #endif - return ret; - } - - int16_t CardReader::loadJobRecoveryInfo() { - return jobRecoveryFile.read(&job_recovery_info, sizeof(job_recovery_info)); - } - - void CardReader::removeJobRecoveryFile() { - job_recovery_info.valid_head = job_recovery_info.valid_foot = job_recovery_commands_count = 0; - if (jobRecoverFileExists()) { - closefile(); - removeFile(job_recovery_file_name); - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - SERIAL_PROTOCOLPGM("Power-loss file delete"); - serialprintPGM(jobRecoverFileExists() ? PSTR(" failed.\n") : PSTR("d.\n")); - #endif - } - } - -#endif // POWER_LOSS_RECOVERY - #endif // SDSUPPORT diff --git a/Marlin/cardreader.h b/Marlin/cardreader.h index c043470..5bcdd2b 100644 --- a/Marlin/cardreader.h +++ b/Marlin/cardreader.h @@ -27,11 +27,11 @@ #if ENABLED(SDSUPPORT) -#define SD_RESORT ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_DYNAMIC_RAM) - #define MAX_DIR_DEPTH 10 // Maximum folder depth #include "SdFile.h" +#include "types.h" +#include "enum.h" class CardReader { public: @@ -39,25 +39,22 @@ public: void initsd(); void write_command(char *buf); + // Files auto[0-9].g on the sd card are performed in sequence. + // This is to delay autostart and hence the initialisation of + // the sd card to some seconds after the normal init, so the + // device is available soon after a reset. - void beginautostart(); - void checkautostart(); - - void openFile(char * const path, const bool read, const bool subcall=false); - void openLogFile(char * const path); + void checkautostart(bool x); + void openFile(char* name, const bool read, const bool subcall=false); + void openLogFile(char* name); void removeFile(const char * const name); - void closefile(const bool store_location=false); + void closefile(bool store_location=false); void release(); void openAndPrintFile(const char *name); void startFileprint(); - void stopSDPrint( - #if SD_RESORT - const bool re_sort=false - #endif - ); + void stopSDPrint(); void getStatus(); void printingHasFinished(); - void printFilename(); #if ENABLED(LONG_FILENAME_HOST_SUPPORT) void printLongPath(char *path); @@ -73,8 +70,6 @@ public: int8_t updir(); void setroot(); - const char* diveToFile(SdFile*& curDir, const char * const path, const bool echo); - uint16_t get_num_Files(); #if ENABLED(SDCARD_SORT_ALPHA) @@ -87,41 +82,20 @@ public: #endif #endif - #if ENABLED(POWER_LOSS_RECOVERY) - void openJobRecoveryFile(const bool read); - void closeJobRecoveryFile(); - bool jobRecoverFileExists(); - int16_t saveJobRecoveryInfo(); - int16_t loadJobRecoveryInfo(); - void removeJobRecoveryFile(); - #endif - FORCE_INLINE void pauseSDPrint() { sdprinting = false; } FORCE_INLINE bool isFileOpen() { return file.isOpen(); } FORCE_INLINE bool eof() { return sdpos >= filesize; } FORCE_INLINE int16_t get() { sdpos = file.curPosition(); return (int16_t)file.read(); } - FORCE_INLINE void setIndex(const uint32_t index) { sdpos = index; file.seekSet(index); } - FORCE_INLINE uint32_t getIndex() { return sdpos; } + FORCE_INLINE void setIndex(long index) { sdpos = index; file.seekSet(index); } FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; } - #if ENABLED(AUTO_REPORT_SD_STATUS) - void auto_report_sd_status(void); - FORCE_INLINE void set_auto_report_interval(uint8_t v) { - NOMORE(v, 60); - auto_report_sd_interval = v; - next_sd_report_ms = millis() + 1000UL * v; - } - #endif - - FORCE_INLINE char* longest_filename() { return longFilename[0] ? longFilename : filename; } - public: - bool saving, logging, sdprinting, cardOK, filenameIsDir, abort_sd_printing; + bool saving, logging, sdprinting, cardOK, filenameIsDir; char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH]; - int8_t autostart_index; + int autostart_index; private: - SdFile root, workDir, workDirParents[MAX_DIR_DEPTH]; + SdFile root, *curDir, workDir, workDirParents[MAX_DIR_DEPTH]; uint8_t workDirDepth; // Sort files and folders alphabetically. @@ -174,14 +148,10 @@ private: #endif // SDCARD_SORT_ALPHA - Sd2Card sd2card; + Sd2Card card; SdVolume volume; SdFile file; - #if ENABLED(POWER_LOSS_RECOVERY) - SdFile jobRecoveryFile; - #endif - #define SD_PROCEDURE_DEPTH 1 #define MAXPATHNAMELENGTH (FILENAME_LENGTH*MAX_DIR_DEPTH + MAX_DIR_DEPTH + 1) uint8_t file_subcall_ctr; @@ -189,6 +159,9 @@ private: char proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; uint32_t filesize, sdpos; + millis_t next_autostart_ms; + bool autostart_stilltocheck; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware. + LsAction lsAction; //stored for recursion. uint16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory. char* diveDirName; @@ -197,22 +170,17 @@ private: #if ENABLED(SDCARD_SORT_ALPHA) void flush_presort(); #endif - - #if ENABLED(AUTO_REPORT_SD_STATUS) - static uint8_t auto_report_sd_interval; - static millis_t next_sd_report_ms; - #endif }; #if PIN_EXISTS(SD_DETECT) #if ENABLED(SD_DETECT_INVERTED) - #define IS_SD_INSERTED() READ(SD_DETECT_PIN) + #define IS_SD_INSERTED (READ(SD_DETECT_PIN) == HIGH) #else - #define IS_SD_INSERTED() !READ(SD_DETECT_PIN) + #define IS_SD_INSERTED (READ(SD_DETECT_PIN) == LOW) #endif #else // No card detect line? Assume the card is inserted. - #define IS_SD_INSERTED() true + #define IS_SD_INSERTED true #endif extern CardReader card; @@ -220,11 +188,11 @@ extern CardReader card; #endif // SDSUPPORT #if ENABLED(SDSUPPORT) - #define IS_SD_PRINTING() card.sdprinting - #define IS_SD_FILE_OPEN() card.isFileOpen() + #define IS_SD_PRINTING (card.sdprinting) + #define IS_SD_FILE_OPEN (card.isFileOpen()) #else - #define IS_SD_PRINTING() false - #define IS_SD_FILE_OPEN() false + #define IS_SD_PRINTING (false) + #define IS_SD_FILE_OPEN (false) #endif #endif // _CARDREADER_H_ diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 6ec8f53..2da7cbf 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -36,15 +36,160 @@ * */ -// Change EEPROM version if the structure changes -#define EEPROM_VERSION "V55" +#define EEPROM_VERSION "V47" + +// Change EEPROM version if these are changed: #define EEPROM_OFFSET 100 -// Check the integrity of data offsets. -// Can be disabled for production build. -//#define DEBUG_EEPROM_READWRITE - +/** + * V47 EEPROM Layout: + * + * 100 Version (char x4) + * 104 EEPROM CRC16 (uint16_t) + * + * 106 E_STEPPERS (uint8_t) + * 107 M92 XYZE planner.axis_steps_per_mm (float x4 ... x8) + 64 + * 123 M203 XYZE planner.max_feedrate_mm_s (float x4 ... x8) + 64 + * 139 M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4 ... x8) + 64 + * 155 M204 P planner.acceleration (float) + * 159 M204 R planner.retract_acceleration (float) + * 163 M204 T planner.travel_acceleration (float) + * 167 M205 S planner.min_feedrate_mm_s (float) + * 171 M205 T planner.min_travel_feedrate_mm_s (float) + * 175 M205 B planner.min_segment_time_us (ulong) + * 179 M205 X planner.max_jerk[X_AXIS] (float) + * 183 M205 Y planner.max_jerk[Y_AXIS] (float) + * 187 M205 Z planner.max_jerk[Z_AXIS] (float) + * 191 M205 E planner.max_jerk[E_AXIS] (float) + * 195 M206 XYZ home_offset (float x3) + * 207 M218 XYZ hotend_offset (float x3 per additional hotend) +16 + * + * Global Leveling: 4 bytes + * 219 z_fade_height (float) + * + * MESH_BED_LEVELING: 43 bytes + * 223 M420 S planner.leveling_active (bool) + * 224 mbl.z_offset (float) + * 228 GRID_MAX_POINTS_X (uint8_t) + * 229 GRID_MAX_POINTS_Y (uint8_t) + * 230 G29 S3 XYZ z_values[][] (float x9, up to float x81) +288 + * + * HAS_BED_PROBE: 4 bytes + * 266 M851 zprobe_zoffset (float) + * + * ABL_PLANAR: 36 bytes + * 270 planner.bed_level_matrix (matrix_3x3 = float x9) + * + * AUTO_BED_LEVELING_BILINEAR: 46 bytes + * 306 GRID_MAX_POINTS_X (uint8_t) + * 307 GRID_MAX_POINTS_Y (uint8_t) + * 308 bilinear_grid_spacing (int x2) + * 312 G29 L F bilinear_start (int x2) + * 316 z_values[][] (float x9, up to float x256) +988 + * + * AUTO_BED_LEVELING_UBL: 2 bytes + * 352 G29 A planner.leveling_active (bool) + * 353 G29 S ubl.storage_slot (int8_t) + * + * DELTA: 44 bytes + * 354 M666 H delta_height (float) + * 358 M666 XYZ delta_endstop_adj (float x3) + * 370 M665 R delta_radius (float) + * 374 M665 L delta_diagonal_rod (float) + * 378 M665 S delta_segments_per_second (float) + * 382 M665 B delta_calibration_radius (float) + * 386 M665 X delta_tower_angle_trim[A] (float) + * 390 M665 Y delta_tower_angle_trim[B] (float) + * 394 M665 Z delta_tower_angle_trim[C] (float) + * + * [XYZ]_DUAL_ENDSTOPS: 12 bytes + * 354 M666 X x_endstop_adj (float) + * 358 M666 Y y_endstop_adj (float) + * 362 M666 Z z_endstop_adj (float) + * + * ULTIPANEL: 6 bytes + * 398 M145 S0 H lcd_preheat_hotend_temp (int x2) + * 402 M145 S0 B lcd_preheat_bed_temp (int x2) + * 406 M145 S0 F lcd_preheat_fan_speed (int x2) + * + * PIDTEMP: 82 bytes + * 410 M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] (float x4) + * 426 M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1] (float x4) + * 442 M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2] (float x4) + * 458 M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4) + * 474 M301 E4 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4) + * 490 M301 L lpq_len (int) + * + * PIDTEMPBED: 12 bytes + * 492 M304 PID bedKp, .bedKi, .bedKd (float x3) + * + * DOGLCD: 2 bytes + * 504 M250 C lcd_contrast (uint16_t) + * + * FWRETRACT: 33 bytes + * 506 M209 S autoretract_enabled (bool) + * 507 M207 S retract_length (float) + * 511 M207 F retract_feedrate_mm_s (float) + * 515 M207 Z retract_zlift (float) + * 519 M208 S retract_recover_length (float) + * 523 M208 F retract_recover_feedrate_mm_s (float) + * 527 M207 W swap_retract_length (float) + * 531 M208 W swap_retract_recover_length (float) + * 535 M208 R swap_retract_recover_feedrate_mm_s (float) + * + * Volumetric Extrusion: 21 bytes + * 539 M200 D parser.volumetric_enabled (bool) + * 540 M200 T D planner.filament_size (float x5) (T0..3) + * + * HAS_TRINAMIC: 22 bytes + * 560 M906 X Stepper X current (uint16_t) + * 562 M906 Y Stepper Y current (uint16_t) + * 564 M906 Z Stepper Z current (uint16_t) + * 566 M906 X2 Stepper X2 current (uint16_t) + * 568 M906 Y2 Stepper Y2 current (uint16_t) + * 570 M906 Z2 Stepper Z2 current (uint16_t) + * 572 M906 E0 Stepper E0 current (uint16_t) + * 574 M906 E1 Stepper E1 current (uint16_t) + * 576 M906 E2 Stepper E2 current (uint16_t) + * 578 M906 E3 Stepper E3 current (uint16_t) + * 580 M906 E4 Stepper E4 current (uint16_t) + * + * SENSORLESS HOMING 4 bytes + * 582 M914 X Stepper X and X2 threshold (int16_t) + * 584 M914 Y Stepper Y and Y2 threshold (int16_t) + * + * LIN_ADVANCE: 8 bytes + * 586 M900 K extruder_advance_k (float) + * 590 M900 WHD advance_ed_ratio (float) + * + * HAS_MOTOR_CURRENT_PWM: + * 594 M907 X Stepper XY current (uint32_t) + * 598 M907 Z Stepper Z current (uint32_t) + * 602 M907 E Stepper E current (uint32_t) + * + * CNC_COORDINATE_SYSTEMS 108 bytes + * 606 G54-G59.3 coordinate_system (float x 27) + * + * SKEW_CORRECTION: 12 bytes + * 714 M852 I planner.xy_skew_factor (float) + * 718 M852 J planner.xz_skew_factor (float) + * 722 M852 K planner.yz_skew_factor (float) + * + * 726 Minimum end-point + * 2255 (726 + 208 + 36 + 9 + 288 + 988) Maximum end-point + * + * ======================================================================== + * meshes_begin (between max and min end-point, directly above) + * -- MESHES -- + * meshes_end + * -- MAT (Mesh Allocation Table) -- 128 bytes (placeholder size) + * mat_end = E2END (0xFFF) + * + */ #include "configuration_store.h" + +MarlinSettings settings; + #include "Marlin.h" #include "language.h" #include "endstops.h" @@ -52,8 +197,7 @@ #include "temperature.h" #include "ultralcd.h" #include "stepper.h" -#include "parser.h" -#include "vector_3.h" +#include "gcode.h" #if ENABLED(MESH_BED_LEVELING) #include "mesh_bed_leveling.h" @@ -61,238 +205,23 @@ #if HAS_TRINAMIC #include "stepper_indirection.h" - #include "tmc_util.h" - #define TMC_GET_PWMTHRS(A,Q) _tmc_thrs(stepper##Q.microsteps(), stepper##Q.TPWMTHRS(), planner.axis_steps_per_mm[_AXIS(A)]) #endif #if ENABLED(AUTO_BED_LEVELING_UBL) #include "ubl.h" #endif -#if ENABLED(FWRETRACT) - #include "fwretract.h" -#endif - -#if ENABLED(PID_EXTRUSION_SCALING) - #define LPQ_LEN thermalManager.lpq_len -#endif - -#pragma pack(push, 1) // No padding between variables - -typedef struct PID { float Kp, Ki, Kd; } PID; -typedef struct PIDC { float Kp, Ki, Kd, Kc; } PIDC; - -/** - * Current EEPROM Layout - * - * Keep this data structure up to date so - * EEPROM size is known at compile time! - */ -typedef struct SettingsDataStruct { - char version[4]; // Vnn\0 - uint16_t crc; // Data Checksum - - // - // DISTINCT_E_FACTORS - // - uint8_t esteppers; // NUM_AXIS_N - MOV_AXIS - - uint32_t planner_max_acceleration_mm_per_s2[NUM_AXIS_N], // M201 XYZE/ABCDE planner.max_acceleration_mm_per_s2[NUM_AXIS_N] - planner_min_segment_time_us; // M205 Q planner.min_segment_time_us - float planner_axis_steps_per_mm[NUM_AXIS_N], // M92 XYZE/ABCDE planner.axis_steps_per_mm[NUM_AXIS_N] - planner_max_feedrate_mm_s[NUM_AXIS_N], // M203 XYZE/ABCDE planner.max_feedrate_mm_s[NUM_AXIS_N] - planner_acceleration, // M204 P planner.acceleration - planner_retract_acceleration, // M204 R planner.retract_acceleration - planner_travel_acceleration, // M204 T planner.travel_acceleration - planner_min_feedrate_mm_s, // M205 S planner.min_feedrate_mm_s - planner_min_travel_feedrate_mm_s, // M205 T planner.min_travel_feedrate_mm_s - planner_max_jerk[NUM_AXIS], // M205 XYZE/ABCDE planner.max_jerk[NUM_AXIS] - planner_junction_deviation_mm; // M205 J planner.junction_deviation_mm - - float home_offset[XYZ]; // M206 XYZ - - #if HOTENDS > 1 - float hotend_offset[XYZ][HOTENDS - 1]; // M218 XYZ - #endif - - // - // ENABLE_LEVELING_FADE_HEIGHT - // - float planner_z_fade_height; // M420 Zn planner.z_fade_height - - // - // MESH_BED_LEVELING - // - float mbl_z_offset; // mbl.z_offset - uint8_t mesh_num_x, mesh_num_y; // GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - #if ENABLED(MESH_BED_LEVELING) - float mbl_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; // mbl.z_values - #else - float mbl_z_values[3][3]; - #endif - - // - // HAS_BED_PROBE - // - float zprobe_zoffset; // M851 Z - - // - // ABL_PLANAR - // - matrix_3x3 planner_bed_level_matrix; // planner.bed_level_matrix - - // - // AUTO_BED_LEVELING_BILINEAR - // - uint8_t grid_max_x, grid_max_y; // GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - int bilinear_grid_spacing[2], - bilinear_start[2]; // G29 L F - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; // G29 - #else - float z_values[3][3]; - #endif - - // - // AUTO_BED_LEVELING_UBL - // - bool planner_leveling_active; // M420 S planner.leveling_active - int8_t ubl_storage_slot; // ubl.storage_slot - - // - // DELTA / [XYZ]_DUAL_ENDSTOPS - // - #if ENABLED(DELTA) - - float delta_height, // M666 H - delta_endstop_adj[ABC], // M666 XYZ - delta_radius, // M665 R - delta_diagonal_rod, // M665 L - delta_segments_per_second, // M665 S - delta_calibration_radius, // M665 B - delta_tower_angle_trim[ABC]; // M665 XYZ - - #elif ENABLED(HANGPRINTER) - - float anchor_A_y, // M665 W - anchor_A_z, // M665 E - anchor_B_x, // M665 R - anchor_B_y, // M665 T - anchor_B_z, // M665 Y - anchor_C_x, // M665 U - anchor_C_y, // M665 I - anchor_C_z, // M665 O - anchor_D_z, // M665 P - delta_segments_per_second, // M665 S - hangprinter_calibration_radius_placeholder; - - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - - float x_endstop_adj, // M666 X - y_endstop_adj, // M666 Y - z_endstop_adj; // M666 Z - - #endif - - // - // ULTIPANEL - // - int16_t lcd_preheat_hotend_temp[2], // M145 S0 H - lcd_preheat_bed_temp[2], // M145 S0 B - lcd_preheat_fan_speed[2]; // M145 S0 F - - // - // PIDTEMP - // - PIDC hotendPID[MAX_EXTRUDERS]; // M301 En PIDC / M303 En U - - int16_t lpq_len; // M301 L - - // - // PIDTEMPBED - // - PID bedPID; // M304 PID / M303 E-1 U - - // - // HAS_LCD_CONTRAST - // - int16_t lcd_contrast; // M250 C - - // - // FWRETRACT - // - bool autoretract_enabled; // M209 S - float retract_length, // M207 S - retract_feedrate_mm_s, // M207 F - retract_zlift, // M207 Z - retract_recover_length, // M208 S - retract_recover_feedrate_mm_s, // M208 F - swap_retract_length, // M207 W - swap_retract_recover_length, // M208 W - swap_retract_recover_feedrate_mm_s; // M208 R - - // - // !NO_VOLUMETRIC - // - bool parser_volumetric_enabled; // M200 D parser.volumetric_enabled - float planner_filament_size[MAX_EXTRUDERS]; // M200 T D planner.filament_size[] - - // - // HAS_TRINAMIC - // - #define TMC_AXES (MAX_EXTRUDERS + 6) - uint16_t tmc_stepper_current[TMC_AXES]; // M906 X Y Z X2 Y2 Z2 E0 E1 E2 E3 E4 - uint32_t tmc_hybrid_threshold[TMC_AXES]; // M913 X Y Z X2 Y2 Z2 E0 E1 E2 E3 E4 - int16_t tmc_sgt[XYZ]; // M914 X Y Z - - // - // LIN_ADVANCE - // - float planner_extruder_advance_K; // M900 K planner.extruder_advance_K - - // - // HAS_MOTOR_CURRENT_PWM - // - uint32_t motor_current_setting[XYZ]; // M907 X Z E - - // - // CNC_COORDINATE_SYSTEMS - // - float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; // G54-G59.3 - - // - // SKEW_CORRECTION - // - float planner_xy_skew_factor, // M852 I planner.xy_skew_factor - planner_xz_skew_factor, // M852 J planner.xz_skew_factor - planner_yz_skew_factor; // M852 K planner.yz_skew_factor - - // - // ADVANCED_PAUSE_FEATURE - // - float filament_change_unload_length[MAX_EXTRUDERS], // M603 T U - filament_change_load_length[MAX_EXTRUDERS]; // M603 T L - -} SettingsData; - -#pragma pack(pop) - -MarlinSettings settings; - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) extern void refresh_bed_level(); #endif -uint16_t MarlinSettings::datasize() { return sizeof(SettingsData); } - -/** - * Post-process after Retrieve or Reset - */ - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) float new_z_fade_height; #endif +/** + * Post-process after Retrieve or Reset + */ void MarlinSettings::postprocess() { const float oldpos[] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; @@ -303,8 +232,6 @@ void MarlinSettings::postprocess() { // planner position so the stepper counts will be set correctly. #if ENABLED(DELTA) recalc_delta_settings(); - #elif ENABLED(HANGPRINTER) - recalc_hangprinter_settings(); #endif #if ENABLED(PIDTEMP) @@ -313,9 +240,6 @@ void MarlinSettings::postprocess() { #if DISABLED(NO_VOLUMETRICS) planner.calculate_volumetric_multipliers(); - #else - for (uint8_t i = COUNT(planner.e_factor); i--;) - planner.refresh_e_factor(i); #endif #if HAS_HOME_OFFSET || ENABLED(DUAL_X_CARRIAGE) @@ -329,20 +253,13 @@ void MarlinSettings::postprocess() { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) refresh_bed_level(); + //set_bed_leveling_enabled(leveling_is_on); #endif #if HAS_MOTOR_CURRENT_PWM stepper.refresh_motor_power(); #endif - #if ENABLED(FWRETRACT) - fwretract.refresh_autoretract(); - #endif - - #if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE) - planner.recalculate_max_e_jerk(); - #endif - // Refresh steps_to_mm with the reciprocal of axis_steps_per_mm // and init stepper.count[], planner.position[] with current_position planner.refresh_positioning(); @@ -359,25 +276,18 @@ void MarlinSettings::postprocess() { #define EEPROM_SKIP(VAR) eeprom_index += sizeof(VAR) #define EEPROM_WRITE(VAR) write_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc) #define EEPROM_READ(VAR) read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc) - #define EEPROM_READ_ALWAYS(VAR) read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc, true) - #define EEPROM_ASSERT(TST,ERR) if (!(TST)) do{ SERIAL_ERROR_START(); SERIAL_ERRORLNPGM(ERR); eeprom_error = true; }while(0) - - #if ENABLED(DEBUG_EEPROM_READWRITE) - #define _FIELD_TEST(FIELD) \ - EEPROM_ASSERT( \ - eeprom_error || eeprom_index == offsetof(SettingsData, FIELD) + EEPROM_OFFSET, \ - "Field " STRINGIFY(FIELD) " mismatch." \ - ) - #else - #define _FIELD_TEST(FIELD) NOOP - #endif + #define EEPROM_ASSERT(TST,ERR) if (!(TST)) do{ SERIAL_ERROR_START(); SERIAL_ERRORLNPGM(ERR); eeprom_read_error = true; }while(0) const char version[4] = EEPROM_VERSION; - bool MarlinSettings::eeprom_error, MarlinSettings::validating; + bool MarlinSettings::eeprom_error; + + #if ENABLED(AUTO_BED_LEVELING_UBL) + int16_t MarlinSettings::meshes_begin; + #endif void MarlinSettings::write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { - if (eeprom_error) { pos += size; return; } + if (eeprom_error) return; while (size--) { uint8_t * const p = (uint8_t * const)pos; uint8_t v = *value; @@ -398,32 +308,23 @@ void MarlinSettings::postprocess() { }; } - void MarlinSettings::read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool force/*=false*/) { - if (eeprom_error) { pos += size; return; } + void MarlinSettings::read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { + if (eeprom_error) return; do { uint8_t c = eeprom_read_byte((unsigned char*)pos); - if (!validating || force) *value = c; + *value = c; crc16(crc, &c, 1); pos++; value++; } while (--size); } - bool MarlinSettings::size_error(const uint16_t size) { - if (size != datasize()) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("EEPROM datasize error."); - return true; - } - return false; - } - /** * M500 - Store Configuration */ bool MarlinSettings::save() { - float dummy = 0; - char ver[4] = "ERR"; + float dummy = 0.0f; + char ver[4] = "000"; uint16_t working_crc = 0; @@ -436,39 +337,20 @@ void MarlinSettings::postprocess() { working_crc = 0; // clear before first "real data" - _FIELD_TEST(esteppers); - - const uint8_t esteppers = NUM_AXIS_N - MOV_AXIS; + const uint8_t esteppers = COUNT(planner.axis_steps_per_mm) - XYZ; EEPROM_WRITE(esteppers); - EEPROM_WRITE(planner.max_acceleration_mm_per_s2); - EEPROM_WRITE(planner.min_segment_time_us); 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); - - #if ENABLED(JUNCTION_DEVIATION) - const float planner_max_jerk[] = { - #if ENABLED(HANGPRINTER) - float(DEFAULT_AJERK), float(DEFAULT_BJERK), float(DEFAULT_CJERK), float(DEFAULT_DJERK), float(DEFAULT_EJERK) - #else - float(DEFAULT_XJERK), float(DEFAULT_YJERK), float(DEFAULT_ZJERK), float(DEFAULT_EJERK) - #endif - }; - EEPROM_WRITE(planner_max_jerk); - EEPROM_WRITE(planner.junction_deviation_mm); - #else - EEPROM_WRITE(planner.max_jerk); - dummy = 0.02f; - EEPROM_WRITE(dummy); - #endif - - _FIELD_TEST(home_offset); - + EEPROM_WRITE(planner.min_segment_time_us); + EEPROM_WRITE(planner.max_jerk); #if !HAS_HOME_OFFSET const float home_offset[XYZ] = { 0 }; #endif @@ -502,21 +384,22 @@ void MarlinSettings::postprocess() { "MBL Z array is the wrong size." ); const uint8_t mesh_num_x = GRID_MAX_POINTS_X, mesh_num_y = GRID_MAX_POINTS_Y; + EEPROM_WRITE(mbl.has_mesh); EEPROM_WRITE(mbl.z_offset); EEPROM_WRITE(mesh_num_x); EEPROM_WRITE(mesh_num_y); EEPROM_WRITE(mbl.z_values); #else // For disabled MBL write a default mesh - dummy = 0; + const bool leveling_is_on = false; + dummy = 0.0f; const uint8_t mesh_num_x = 3, mesh_num_y = 3; + EEPROM_WRITE(leveling_is_on); EEPROM_WRITE(dummy); // z_offset EEPROM_WRITE(mesh_num_x); EEPROM_WRITE(mesh_num_y); for (uint8_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_WRITE(dummy); #endif // MESH_BED_LEVELING - _FIELD_TEST(zprobe_zoffset); - #if !HAS_BED_PROBE const float zprobe_zoffset = 0; #endif @@ -529,7 +412,7 @@ void MarlinSettings::postprocess() { #if ABL_PLANAR EEPROM_WRITE(planner.bed_level_matrix); #else - dummy = 0; + dummy = 0.0; for (uint8_t q = 9; q--;) EEPROM_WRITE(dummy); #endif @@ -553,7 +436,7 @@ void MarlinSettings::postprocess() { // For disabled Bilinear Grid write an empty 3x3 grid const uint8_t grid_max_x = 3, grid_max_y = 3; const int bilinear_start[2] = { 0 }, bilinear_grid_spacing[2] = { 0 }; - dummy = 0; + dummy = 0.0f; EEPROM_WRITE(grid_max_x); EEPROM_WRITE(grid_max_y); EEPROM_WRITE(bilinear_grid_spacing); @@ -561,8 +444,6 @@ void MarlinSettings::postprocess() { for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_WRITE(dummy); #endif // AUTO_BED_LEVELING_BILINEAR - _FIELD_TEST(planner_leveling_active); - #if ENABLED(AUTO_BED_LEVELING_UBL) EEPROM_WRITE(planner.leveling_active); EEPROM_WRITE(ubl.storage_slot); @@ -575,9 +456,6 @@ void MarlinSettings::postprocess() { // 11 floats for DELTA / [XYZ]_DUAL_ENDSTOPS #if ENABLED(DELTA) - - _FIELD_TEST(delta_height); - EEPROM_WRITE(delta_height); // 1 float EEPROM_WRITE(delta_endstop_adj); // 3 floats EEPROM_WRITE(delta_radius); // 1 float @@ -586,54 +464,38 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(delta_calibration_radius); // 1 float EEPROM_WRITE(delta_tower_angle_trim); // 3 floats - #elif ENABLED(HANGPRINTER) - - dummy = 0.0f; - _FIELD_TEST(anchor_A_y); - EEPROM_WRITE(anchor_A_y); // 1 float - EEPROM_WRITE(anchor_A_z); // 1 float - EEPROM_WRITE(anchor_B_x); // 1 float - EEPROM_WRITE(anchor_B_y); // 1 float - EEPROM_WRITE(anchor_B_z); // 1 float - EEPROM_WRITE(anchor_C_x); // 1 float - EEPROM_WRITE(anchor_C_y); // 1 float - EEPROM_WRITE(anchor_C_z); // 1 float - EEPROM_WRITE(anchor_D_z); // 1 float - EEPROM_WRITE(delta_segments_per_second); // 1 float - EEPROM_WRITE(dummy); // 1 float - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - - _FIELD_TEST(x_endstop_adj); - // Write dual endstops in X, Y, Z order. Unused = 0.0 - dummy = 0; + dummy = 0.0f; #if ENABLED(X_DUAL_ENDSTOPS) - EEPROM_WRITE(endstops.x_endstop_adj); // 1 float + EEPROM_WRITE(x_endstop_adj); // 1 float #else EEPROM_WRITE(dummy); #endif #if ENABLED(Y_DUAL_ENDSTOPS) - EEPROM_WRITE(endstops.y_endstop_adj); // 1 float + EEPROM_WRITE(y_endstop_adj); // 1 float #else EEPROM_WRITE(dummy); #endif #if ENABLED(Z_DUAL_ENDSTOPS) - EEPROM_WRITE(endstops.z_endstop_adj); // 1 float + EEPROM_WRITE(z_endstop_adj); // 1 float #else EEPROM_WRITE(dummy); #endif + for (uint8_t q = 8; q--;) EEPROM_WRITE(dummy); + + #else + dummy = 0.0f; + for (uint8_t q = 11; q--;) EEPROM_WRITE(dummy); #endif - _FIELD_TEST(lcd_preheat_hotend_temp); - #if DISABLED(ULTIPANEL) - constexpr int16_t lcd_preheat_hotend_temp[2] = { PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND }, - lcd_preheat_bed_temp[2] = { PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED }, - lcd_preheat_fan_speed[2] = { PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED }; + constexpr int lcd_preheat_hotend_temp[2] = { PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND }, + lcd_preheat_bed_temp[2] = { PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED }, + lcd_preheat_fan_speed[2] = { PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED }; #endif EEPROM_WRITE(lcd_preheat_hotend_temp); @@ -659,18 +521,16 @@ void MarlinSettings::postprocess() { { dummy = DUMMY_PID_VALUE; // When read, will not change the existing value EEPROM_WRITE(dummy); // Kp - dummy = 0; + dummy = 0.0f; for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); // Ki, Kd, Kc } } // Hotends Loop - _FIELD_TEST(lpq_len); - #if DISABLED(PID_EXTRUSION_SCALING) - const int16_t LPQ_LEN = 20; + int lpq_len = 20; #endif - EEPROM_WRITE(LPQ_LEN); + EEPROM_WRITE(lpq_len); #if DISABLED(PIDTEMPBED) dummy = DUMMY_PID_VALUE; @@ -681,36 +541,35 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(thermalManager.bedKd); #endif - _FIELD_TEST(lcd_contrast); - #if !HAS_LCD_CONTRAST - const int16_t lcd_contrast = 32; + const uint16_t lcd_contrast = 32; #endif EEPROM_WRITE(lcd_contrast); #if DISABLED(FWRETRACT) const bool autoretract_enabled = false; - const float autoretract_defaults[] = { 3, 45, 0, 0, 0, 13, 0, 8 }; - EEPROM_WRITE(autoretract_enabled); - EEPROM_WRITE(autoretract_defaults); - #else - EEPROM_WRITE(fwretract.autoretract_enabled); - EEPROM_WRITE(fwretract.retract_length); - EEPROM_WRITE(fwretract.retract_feedrate_mm_s); - EEPROM_WRITE(fwretract.retract_zlift); - EEPROM_WRITE(fwretract.retract_recover_length); - EEPROM_WRITE(fwretract.retract_recover_feedrate_mm_s); - EEPROM_WRITE(fwretract.swap_retract_length); - EEPROM_WRITE(fwretract.swap_retract_recover_length); - EEPROM_WRITE(fwretract.swap_retract_recover_feedrate_mm_s); + const float retract_length = 3, + retract_feedrate_mm_s = 45, + retract_zlift = 0, + retract_recover_length = 0, + retract_recover_feedrate_mm_s = 0, + swap_retract_length = 13, + swap_retract_recover_length = 0, + swap_retract_recover_feedrate_mm_s = 8; #endif + EEPROM_WRITE(autoretract_enabled); + EEPROM_WRITE(retract_length); + EEPROM_WRITE(retract_feedrate_mm_s); + EEPROM_WRITE(retract_zlift); + EEPROM_WRITE(retract_recover_length); + EEPROM_WRITE(retract_recover_feedrate_mm_s); + EEPROM_WRITE(swap_retract_length); + EEPROM_WRITE(swap_retract_recover_length); + EEPROM_WRITE(swap_retract_recover_feedrate_mm_s); // // Volumetric & Filament Size // - - _FIELD_TEST(parser_volumetric_enabled); - #if DISABLED(NO_VOLUMETRICS) EEPROM_WRITE(parser.volumetric_enabled); @@ -721,257 +580,152 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(dummy); } - #else - - const bool volumetric_enabled = false; - dummy = DEFAULT_NOMINAL_FILAMENT_DIA; - EEPROM_WRITE(volumetric_enabled); - for (uint8_t q = MAX_EXTRUDERS; q--;) EEPROM_WRITE(dummy); - #endif - // // Save TMC2130 or TMC2208 Configuration, and placeholder values - // - - _FIELD_TEST(tmc_stepper_current); - - uint16_t tmc_stepper_current[TMC_AXES] = { - #if HAS_TRINAMIC - #if AXIS_IS_TMC(X) - stepperX.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(Y) - stepperY.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(Z) - stepperZ.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(X2) - stepperX2.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(Y2) - stepperY2.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(Z2) - stepperZ2.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E0) - stepperE0.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E1) - stepperE1.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E2) - stepperE2.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E3) - stepperE3.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E4) - stepperE4.getCurrent() - #else - 0 - #endif + uint16_t val; + #if HAS_TRINAMIC + #if X_IS_TRINAMIC + val = stepperX.getCurrent(); #else - 0 + val = 0; #endif - }; - EEPROM_WRITE(tmc_stepper_current); - - // - // Save TMC2130 or TMC2208 Hybrid Threshold, and placeholder values - // - - _FIELD_TEST(tmc_hybrid_threshold); - - uint32_t tmc_hybrid_threshold[TMC_AXES] = { - #if ENABLED(HYBRID_THRESHOLD) - #if AXIS_HAS_STEALTHCHOP(X) - TMC_GET_PWMTHRS(X, X), - #else - X_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - TMC_GET_PWMTHRS(Y, Y), - #else - Y_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - TMC_GET_PWMTHRS(Z, Z), - #else - Z_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - TMC_GET_PWMTHRS(X, X2), - #else - X2_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_GET_PWMTHRS(Y, Y2), - #else - Y2_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_GET_PWMTHRS(Z, Z2), - #else - Z2_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - TMC_GET_PWMTHRS(E, E0), - #else - E0_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - TMC_GET_PWMTHRS(E, E1), - #else - E1_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - TMC_GET_PWMTHRS(E, E2), - #else - E2_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - TMC_GET_PWMTHRS(E, E3), - #else - E3_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - TMC_GET_PWMTHRS(E, E4) - #else - E4_HYBRID_THRESHOLD - #endif + EEPROM_WRITE(val); + #if Y_IS_TRINAMIC + val = stepperY.getCurrent(); #else - 100, 100, 3, // X, Y, Z - 100, 100, 3, // X2, Y2, Z2 - 30, 30, 30, 30, 30 // E0, E1, E2, E3, E4 + val = 0; #endif - }; - EEPROM_WRITE(tmc_hybrid_threshold); + EEPROM_WRITE(val); + #if Z_IS_TRINAMIC + val = stepperZ.getCurrent(); + #else + val = 0; + #endif + EEPROM_WRITE(val); + #if X2_IS_TRINAMIC + val = stepperX2.getCurrent(); + #else + val = 0; + #endif + EEPROM_WRITE(val); + #if Y2_IS_TRINAMIC + val = stepperY2.getCurrent(); + #else + val = 0; + #endif + EEPROM_WRITE(val); + #if Z2_IS_TRINAMIC + val = stepperZ2.getCurrent(); + #else + val = 0; + #endif + EEPROM_WRITE(val); + #if E0_IS_TRINAMIC + val = stepperE0.getCurrent(); + #else + val = 0; + #endif + EEPROM_WRITE(val); + #if E1_IS_TRINAMIC + val = stepperE1.getCurrent(); + #else + val = 0; + #endif + EEPROM_WRITE(val); + #if E2_IS_TRINAMIC + val = stepperE2.getCurrent(); + #else + val = 0; + #endif + EEPROM_WRITE(val); + #if E3_IS_TRINAMIC + val = stepperE3.getCurrent(); + #else + val = 0; + #endif + EEPROM_WRITE(val); + #if E4_IS_TRINAMIC + val = stepperE4.getCurrent(); + #else + val = 0; + #endif + EEPROM_WRITE(val); + #else + val = 0; + for (uint8_t q = 11; q--;) EEPROM_WRITE(val); + #endif // // TMC2130 Sensorless homing threshold // - int16_t tmc_sgt[XYZ] = { - #if ENABLED(SENSORLESS_HOMING) - #if X_SENSORLESS - stepperX.sgt(), - #else - 0, - #endif - #if Y_SENSORLESS - stepperY.sgt(), - #else - 0, - #endif - #if Z_SENSORLESS - stepperZ.sgt() - #else - 0 - #endif + int16_t thrs; + #if ENABLED(SENSORLESS_HOMING) + #if ENABLED(X_IS_TMC2130) + thrs = stepperX.sgt(); #else - 0 + thrs = 0; #endif - }; - EEPROM_WRITE(tmc_sgt); + EEPROM_WRITE(thrs); + #if ENABLED(Y_IS_TMC2130) + thrs = stepperY.sgt(); + #else + thrs = 0; + #endif + EEPROM_WRITE(thrs); + #else + thrs = 0; + for (uint8_t q = 2; q--;) EEPROM_WRITE(thrs); + #endif // // Linear Advance // - _FIELD_TEST(planner_extruder_advance_K); - #if ENABLED(LIN_ADVANCE) - EEPROM_WRITE(planner.extruder_advance_K); + EEPROM_WRITE(planner.extruder_advance_k); + EEPROM_WRITE(planner.advance_ed_ratio); #else - dummy = 0; + dummy = 0.0f; + EEPROM_WRITE(dummy); EEPROM_WRITE(dummy); #endif - _FIELD_TEST(motor_current_setting); - #if HAS_MOTOR_CURRENT_PWM - for (uint8_t q = XYZ; q--;) EEPROM_WRITE(stepper.motor_current_setting[q]); + for (uint8_t q = 3; q--;) EEPROM_WRITE(stepper.motor_current_setting[q]); #else - const uint32_t dummyui32[XYZ] = { 0 }; - EEPROM_WRITE(dummyui32); + const uint32_t dummyui32 = 0; + for (uint8_t q = 3; q--;) EEPROM_WRITE(dummyui32); #endif // // CNC Coordinate Systems // - _FIELD_TEST(coordinate_system); - #if ENABLED(CNC_COORDINATE_SYSTEMS) EEPROM_WRITE(coordinate_system); // 27 floats #else - dummy = 0; - for (uint8_t q = MAX_COORDINATE_SYSTEMS * XYZ; q--;) EEPROM_WRITE(dummy); + dummy = 0.0f; + for (uint8_t q = 27; q--;) EEPROM_WRITE(dummy); #endif // // Skew correction factors // - _FIELD_TEST(planner_xy_skew_factor); - #if ENABLED(SKEW_CORRECTION) EEPROM_WRITE(planner.xy_skew_factor); EEPROM_WRITE(planner.xz_skew_factor); EEPROM_WRITE(planner.yz_skew_factor); #else - dummy = 0; + dummy = 0.0f; for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); #endif - // - // Advanced Pause filament load & unload lengths - // - - _FIELD_TEST(filament_change_unload_length); - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - if (q < COUNT(filament_change_unload_length)) dummy = filament_change_unload_length[q]; - EEPROM_WRITE(dummy); - } - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - if (q < COUNT(filament_change_load_length)) dummy = filament_change_load_length[q]; - EEPROM_WRITE(dummy); - } - #else - dummy = 0; - for (uint8_t q = MAX_EXTRUDERS * 2; q--;) EEPROM_WRITE(dummy); - #endif - - // - // Validate CRC and Data Size - // if (!eeprom_error) { - const uint16_t eeprom_size = eeprom_index - (EEPROM_OFFSET), - final_crc = working_crc; + const int eeprom_size = eeprom_index; + + const uint16_t final_crc = working_crc; // Write the EEPROM header eeprom_index = EEPROM_OFFSET; @@ -982,17 +736,12 @@ void MarlinSettings::postprocess() { // Report storage size #if ENABLED(EEPROM_CHITCHAT) SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Settings Stored (", eeprom_size); + SERIAL_ECHOPAIR("Settings Stored (", eeprom_size - (EEPROM_OFFSET)); SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)final_crc); SERIAL_ECHOLNPGM(")"); #endif - - eeprom_error |= size_error(eeprom_size); } - // - // UBL Mesh - // #if ENABLED(UBL_SAVE_ACTIVE_ON_M500) if (ubl.storage_slot >= 0) store_mesh(ubl.storage_slot); @@ -1004,20 +753,20 @@ void MarlinSettings::postprocess() { /** * M501 - Retrieve Configuration */ - bool MarlinSettings::_load() { + bool MarlinSettings::load() { uint16_t working_crc = 0; EEPROM_START(); char stored_ver[4]; - EEPROM_READ_ALWAYS(stored_ver); + EEPROM_READ(stored_ver); uint16_t stored_crc; - EEPROM_READ_ALWAYS(stored_crc); + EEPROM_READ(stored_crc); // Version has to match or defaults are used if (strncmp(version, stored_ver, 3) != 0) { - if (stored_ver[3] != '\0') { + if (stored_ver[0] != 'V') { stored_ver[0] = '?'; stored_ver[1] = '\0'; } @@ -1027,21 +776,19 @@ void MarlinSettings::postprocess() { SERIAL_ECHOPAIR("(EEPROM=", stored_ver); SERIAL_ECHOLNPGM(" Marlin=" EEPROM_VERSION ")"); #endif - eeprom_error = true; + reset(); } else { float dummy = 0; - #if DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(FWRETRACT) || ENABLED(NO_VOLUMETRICS) + #if DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(FWRETRACT) bool dummyb; #endif working_crc = 0; // Init to 0. Accumulated by EEPROM_READ - _FIELD_TEST(esteppers); - // Number of esteppers may change uint8_t esteppers; - EEPROM_READ_ALWAYS(esteppers); + EEPROM_READ(esteppers); // // Planner Motion @@ -1049,20 +796,17 @@ void MarlinSettings::postprocess() { // Get only the number of E stepper parameters previously stored // Any steppers added later are set to their defaults - const uint32_t def1[] = DEFAULT_MAX_ACCELERATION; - const float def2[] = DEFAULT_AXIS_STEPS_PER_UNIT, def3[] = DEFAULT_MAX_FEEDRATE; - - uint32_t tmp1[MOV_AXIS + esteppers]; - EEPROM_READ(tmp1); // max_acceleration_mm_per_s2 - EEPROM_READ(planner.min_segment_time_us); - - float tmp2[MOV_AXIS + esteppers], tmp3[MOV_AXIS + esteppers]; - EEPROM_READ(tmp2); // axis_steps_per_mm - EEPROM_READ(tmp3); // max_feedrate_mm_s - if (!validating) LOOP_NUM_AXIS_N(i) { - planner.max_acceleration_mm_per_s2[i] = i < MOV_AXIS + esteppers ? tmp1[i] : def1[i < COUNT(def1) ? i : COUNT(def1) - 1]; - planner.axis_steps_per_mm[i] = i < MOV_AXIS + esteppers ? tmp2[i] : def2[i < COUNT(def2) ? i : COUNT(def2) - 1]; - planner.max_feedrate_mm_s[i] = i < MOV_AXIS + esteppers ? tmp3[i] : def3[i < COUNT(def3) ? i : COUNT(def3) - 1]; + const float def1[] = DEFAULT_AXIS_STEPS_PER_UNIT, def2[] = DEFAULT_MAX_FEEDRATE; + const uint32_t def3[] = DEFAULT_MAX_ACCELERATION; + float tmp1[XYZ + esteppers], tmp2[XYZ + esteppers]; + uint32_t tmp3[XYZ + esteppers]; + EEPROM_READ(tmp1); + EEPROM_READ(tmp2); + EEPROM_READ(tmp3); + LOOP_XYZE_N(i) { + planner.axis_steps_per_mm[i] = i < XYZ + esteppers ? tmp1[i] : def1[i < COUNT(def1) ? i : COUNT(def1) - 1]; + planner.max_feedrate_mm_s[i] = i < XYZ + esteppers ? tmp2[i] : def2[i < COUNT(def2) ? i : COUNT(def2) - 1]; + planner.max_acceleration_mm_per_s2[i] = i < XYZ + esteppers ? tmp3[i] : def3[i < COUNT(def3) ? i : COUNT(def3) - 1]; } EEPROM_READ(planner.acceleration); @@ -1070,21 +814,13 @@ void MarlinSettings::postprocess() { EEPROM_READ(planner.travel_acceleration); EEPROM_READ(planner.min_feedrate_mm_s); EEPROM_READ(planner.min_travel_feedrate_mm_s); - - #if ENABLED(JUNCTION_DEVIATION) - for (uint8_t q = 4; q--;) EEPROM_READ(dummy); - EEPROM_READ(planner.junction_deviation_mm); - #else - EEPROM_READ(planner.max_jerk); - EEPROM_READ(dummy); - #endif + EEPROM_READ(planner.min_segment_time_us); + EEPROM_READ(planner.max_jerk); // // Home Offset (M206) // - _FIELD_TEST(home_offset); - #if !HAS_HOME_OFFSET float home_offset[XYZ]; #endif @@ -1114,20 +850,23 @@ void MarlinSettings::postprocess() { // Mesh (Manual) Bed Leveling // + bool leveling_is_on; uint8_t mesh_num_x, mesh_num_y; + EEPROM_READ(leveling_is_on); EEPROM_READ(dummy); - EEPROM_READ_ALWAYS(mesh_num_x); - EEPROM_READ_ALWAYS(mesh_num_y); + EEPROM_READ(mesh_num_x); + EEPROM_READ(mesh_num_y); #if ENABLED(MESH_BED_LEVELING) - if (!validating) mbl.z_offset = dummy; + mbl.has_mesh = leveling_is_on; + mbl.z_offset = dummy; if (mesh_num_x == GRID_MAX_POINTS_X && mesh_num_y == GRID_MAX_POINTS_Y) { // EEPROM data fits the current mesh EEPROM_READ(mbl.z_values); } else { // EEPROM data is stale - if (!validating) mbl.reset(); + mbl.reset(); for (uint16_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_READ(dummy); } #else @@ -1135,8 +874,6 @@ void MarlinSettings::postprocess() { for (uint16_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_READ(dummy); #endif // MESH_BED_LEVELING - _FIELD_TEST(zprobe_zoffset); - #if !HAS_BED_PROBE float zprobe_zoffset; #endif @@ -1157,11 +894,11 @@ void MarlinSettings::postprocess() { // uint8_t grid_max_x, grid_max_y; - EEPROM_READ_ALWAYS(grid_max_x); // 1 byte - EEPROM_READ_ALWAYS(grid_max_y); // 1 byte + EEPROM_READ(grid_max_x); // 1 byte + EEPROM_READ(grid_max_y); // 1 byte #if ENABLED(AUTO_BED_LEVELING_BILINEAR) if (grid_max_x == GRID_MAX_POINTS_X && grid_max_y == GRID_MAX_POINTS_Y) { - if (!validating) set_bed_leveling_enabled(false); + set_bed_leveling_enabled(false); EEPROM_READ(bilinear_grid_spacing); // 2 ints EEPROM_READ(bilinear_start); // 2 ints EEPROM_READ(z_values); // 9 to 256 floats @@ -1180,8 +917,6 @@ void MarlinSettings::postprocess() { // Unified Bed Leveling active state // - _FIELD_TEST(planner_leveling_active); - #if ENABLED(AUTO_BED_LEVELING_UBL) EEPROM_READ(planner.leveling_active); EEPROM_READ(ubl.storage_slot); @@ -1196,9 +931,6 @@ void MarlinSettings::postprocess() { // #if ENABLED(DELTA) - - _FIELD_TEST(delta_height); - EEPROM_READ(delta_height); // 1 float EEPROM_READ(delta_endstop_adj); // 3 floats EEPROM_READ(delta_radius); // 1 float @@ -1207,49 +939,38 @@ void MarlinSettings::postprocess() { EEPROM_READ(delta_calibration_radius); // 1 float EEPROM_READ(delta_tower_angle_trim); // 3 floats - #elif ENABLED(HANGPRINTER) - EEPROM_READ(anchor_A_y); // 1 float - EEPROM_READ(anchor_A_z); // 1 float - EEPROM_READ(anchor_B_x); // 1 float - EEPROM_READ(anchor_B_y); // 1 float - EEPROM_READ(anchor_B_z); // 1 float - EEPROM_READ(anchor_C_x); // 1 float - EEPROM_READ(anchor_C_y); // 1 float - EEPROM_READ(anchor_C_z); // 1 float - EEPROM_READ(anchor_D_z); // 1 float - EEPROM_READ(delta_segments_per_second); // 1 float - EEPROM_READ(dummy); // 1 float - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - _FIELD_TEST(x_endstop_adj); - #if ENABLED(X_DUAL_ENDSTOPS) - EEPROM_READ(endstops.x_endstop_adj); // 1 float + EEPROM_READ(x_endstop_adj); // 1 float #else EEPROM_READ(dummy); #endif #if ENABLED(Y_DUAL_ENDSTOPS) - EEPROM_READ(endstops.y_endstop_adj); // 1 float + EEPROM_READ(y_endstop_adj); // 1 float #else EEPROM_READ(dummy); #endif #if ENABLED(Z_DUAL_ENDSTOPS) - EEPROM_READ(endstops.z_endstop_adj); // 1 float + EEPROM_READ(z_endstop_adj); // 1 float #else EEPROM_READ(dummy); #endif + for (uint8_t q=8; q--;) EEPROM_READ(dummy); + + #else + + for (uint8_t q=11; q--;) EEPROM_READ(dummy); + #endif // // LCD Preheat settings // - _FIELD_TEST(lcd_preheat_hotend_temp); - #if DISABLED(ULTIPANEL) - int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2]; + int lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2]; #endif EEPROM_READ(lcd_preheat_hotend_temp); // 2 floats EEPROM_READ(lcd_preheat_bed_temp); // 2 floats @@ -1269,7 +990,7 @@ void MarlinSettings::postprocess() { 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 - if (!validating) PID_PARAM(Kp, e) = dummy; + PID_PARAM(Kp, e) = dummy; EEPROM_READ(PID_PARAM(Ki, e)); EEPROM_READ(PID_PARAM(Kd, e)); #if ENABLED(PID_EXTRUSION_SCALING) @@ -1291,12 +1012,10 @@ void MarlinSettings::postprocess() { // PID Extrusion Scaling // - _FIELD_TEST(lpq_len); - #if DISABLED(PID_EXTRUSION_SCALING) - int16_t LPQ_LEN; + int lpq_len; #endif - EEPROM_READ(LPQ_LEN); + EEPROM_READ(lpq_len); // // Heated Bed PID @@ -1305,7 +1024,7 @@ void MarlinSettings::postprocess() { #if ENABLED(PIDTEMPBED) EEPROM_READ(dummy); // bedKp if (dummy != DUMMY_PID_VALUE) { - if (!validating) thermalManager.bedKp = dummy; + thermalManager.bedKp = dummy; EEPROM_READ(thermalManager.bedKi); EEPROM_READ(thermalManager.bedKd); } @@ -1317,10 +1036,8 @@ void MarlinSettings::postprocess() { // LCD Contrast // - _FIELD_TEST(lcd_contrast); - #if !HAS_LCD_CONTRAST - int16_t lcd_contrast; + uint16_t lcd_contrast; #endif EEPROM_READ(lcd_contrast); @@ -1329,15 +1046,15 @@ void MarlinSettings::postprocess() { // #if ENABLED(FWRETRACT) - EEPROM_READ(fwretract.autoretract_enabled); - EEPROM_READ(fwretract.retract_length); - EEPROM_READ(fwretract.retract_feedrate_mm_s); - EEPROM_READ(fwretract.retract_zlift); - EEPROM_READ(fwretract.retract_recover_length); - EEPROM_READ(fwretract.retract_recover_feedrate_mm_s); - EEPROM_READ(fwretract.swap_retract_length); - EEPROM_READ(fwretract.swap_retract_recover_length); - EEPROM_READ(fwretract.swap_retract_recover_feedrate_mm_s); + EEPROM_READ(autoretract_enabled); + EEPROM_READ(retract_length); + EEPROM_READ(retract_feedrate_mm_s); + EEPROM_READ(retract_zlift); + EEPROM_READ(retract_recover_length); + EEPROM_READ(retract_recover_feedrate_mm_s); + EEPROM_READ(swap_retract_length); + EEPROM_READ(swap_retract_recover_length); + EEPROM_READ(swap_retract_recover_feedrate_mm_s); #else EEPROM_READ(dummyb); for (uint8_t q=8; q--;) EEPROM_READ(dummy); @@ -1346,204 +1063,134 @@ void MarlinSettings::postprocess() { // // Volumetric & Filament Size // - - _FIELD_TEST(parser_volumetric_enabled); - #if DISABLED(NO_VOLUMETRICS) EEPROM_READ(parser.volumetric_enabled); for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { EEPROM_READ(dummy); - if (!validating && q < COUNT(planner.filament_size)) - planner.filament_size[q] = dummy; + if (q < COUNT(planner.filament_size)) planner.filament_size[q] = dummy; } - #else - - EEPROM_READ(dummyb); - for (uint8_t q=MAX_EXTRUDERS; q--;) EEPROM_READ(dummy); - #endif - if (!validating) reset_stepper_drivers(); - // - // TMC2130 Stepper Settings + // TMC2130 Stepper Current // - _FIELD_TEST(tmc_stepper_current); - + uint16_t val; #if HAS_TRINAMIC - - #define SET_CURR(Q) stepper##Q.setCurrent(currents[TMC_##Q] ? currents[TMC_##Q] : Q##_CURRENT, R_SENSE, HOLD_MULTIPLIER) - uint16_t currents[TMC_AXES]; - EEPROM_READ(currents); - if (!validating) { - #if AXIS_IS_TMC(X) - SET_CURR(X); - #endif - #if AXIS_IS_TMC(Y) - SET_CURR(Y); - #endif - #if AXIS_IS_TMC(Z) - SET_CURR(Z); - #endif - #if AXIS_IS_TMC(X2) - SET_CURR(X2); - #endif - #if AXIS_IS_TMC(Y2) - SET_CURR(Y2); - #endif - #if AXIS_IS_TMC(Z2) - SET_CURR(Z2); - #endif - #if AXIS_IS_TMC(E0) - SET_CURR(E0); - #endif - #if AXIS_IS_TMC(E1) - SET_CURR(E1); - #endif - #if AXIS_IS_TMC(E2) - SET_CURR(E2); - #endif - #if AXIS_IS_TMC(E3) - SET_CURR(E3); - #endif - #if AXIS_IS_TMC(E4) - SET_CURR(E4); - #endif - } + EEPROM_READ(val); + #if X_IS_TRINAMIC + stepperX.setCurrent(val, R_SENSE, HOLD_MULTIPLIER); + #endif + EEPROM_READ(val); + #if Y_IS_TRINAMIC + stepperY.setCurrent(val, R_SENSE, HOLD_MULTIPLIER); + #endif + EEPROM_READ(val); + #if Z_IS_TRINAMIC + stepperZ.setCurrent(val, R_SENSE, HOLD_MULTIPLIER); + #endif + EEPROM_READ(val); + #if X2_IS_TRINAMIC + stepperX2.setCurrent(val, R_SENSE, HOLD_MULTIPLIER); + #endif + EEPROM_READ(val); + #if Y2_IS_TRINAMIC + stepperY2.setCurrent(val, R_SENSE, HOLD_MULTIPLIER); + #endif + EEPROM_READ(val); + #if Z2_IS_TRINAMIC + stepperZ2.setCurrent(val, R_SENSE, HOLD_MULTIPLIER); + #endif + EEPROM_READ(val); + #if E0_IS_TRINAMIC + stepperE0.setCurrent(val, R_SENSE, HOLD_MULTIPLIER); + #endif + EEPROM_READ(val); + #if E1_IS_TRINAMIC + stepperE1.setCurrent(val, R_SENSE, HOLD_MULTIPLIER); + #endif + EEPROM_READ(val); + #if E2_IS_TRINAMIC + stepperE2.setCurrent(val, R_SENSE, HOLD_MULTIPLIER); + #endif + EEPROM_READ(val); + #if E3_IS_TRINAMIC + stepperE3.setCurrent(val, R_SENSE, HOLD_MULTIPLIER); + #endif + EEPROM_READ(val); + #if E4_IS_TRINAMIC + stepperE4.setCurrent(val, R_SENSE, HOLD_MULTIPLIER); + #endif #else - uint16_t val; - for (uint8_t q=TMC_AXES; q--;) EEPROM_READ(val); - #endif - - #if ENABLED(HYBRID_THRESHOLD) - #define TMC_SET_PWMTHRS(A,Q) tmc_set_pwmthrs(stepper##Q, tmc_hybrid_threshold[TMC_##Q], planner.axis_steps_per_mm[_AXIS(A)]) - uint32_t tmc_hybrid_threshold[TMC_AXES]; - EEPROM_READ(tmc_hybrid_threshold); - if (!validating) { - #if AXIS_HAS_STEALTHCHOP(X) - TMC_SET_PWMTHRS(X, X); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - TMC_SET_PWMTHRS(Y, Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - TMC_SET_PWMTHRS(Z, Z); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - TMC_SET_PWMTHRS(X, X2); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_SET_PWMTHRS(Y, Y2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_SET_PWMTHRS(Z, Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - TMC_SET_PWMTHRS(E, E0); - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - TMC_SET_PWMTHRS(E, E1); - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - TMC_SET_PWMTHRS(E, E2); - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - TMC_SET_PWMTHRS(E, E3); - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - TMC_SET_PWMTHRS(E, E4); - #endif - } - #else - uint32_t thrs_val; - for (uint8_t q=TMC_AXES; q--;) EEPROM_READ(thrs_val); + for (uint8_t q = 11; q--;) EEPROM_READ(val); #endif /* * TMC2130 Sensorless homing threshold. * X and X2 use the same value * Y and Y2 use the same value - * Z and Z2 use the same value */ - int16_t tmc_sgt[XYZ]; - EEPROM_READ(tmc_sgt); + int16_t thrs; #if ENABLED(SENSORLESS_HOMING) - if (!validating) { - #ifdef X_HOMING_SENSITIVITY - #if AXIS_HAS_STALLGUARD(X) - stepperX.sgt(tmc_sgt[0]); - #endif - #if AXIS_HAS_STALLGUARD(X2) - stepperX2.sgt(tmc_sgt[0]); - #endif - #endif - #ifdef Y_HOMING_SENSITIVITY - #if AXIS_HAS_STALLGUARD(Y) - stepperY.sgt(tmc_sgt[1]); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - stepperY2.sgt(tmc_sgt[1]); - #endif - #endif - #ifdef Z_HOMING_SENSITIVITY - #if AXIS_HAS_STALLGUARD(Z) - stepperZ.sgt(tmc_sgt[2]); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - stepperZ2.sgt(tmc_sgt[2]); - #endif - #endif - } + EEPROM_READ(thrs); + #if ENABLED(X_IS_TMC2130) + stepperX.sgt(thrs); + #endif + #if ENABLED(X2_IS_TMC2130) + stepperX2.sgt(thrs); + #endif + EEPROM_READ(thrs); + #if ENABLED(Y_IS_TMC2130) + stepperY.sgt(thrs); + #endif + #if ENABLED(Y2_IS_TMC2130) + stepperY2.sgt(thrs); + #endif + #else + for (uint8_t q = 0; q < 2; q++) EEPROM_READ(thrs); #endif // // Linear Advance // - _FIELD_TEST(planner_extruder_advance_K); - #if ENABLED(LIN_ADVANCE) - EEPROM_READ(planner.extruder_advance_K); + EEPROM_READ(planner.extruder_advance_k); + EEPROM_READ(planner.advance_ed_ratio); #else EEPROM_READ(dummy); + EEPROM_READ(dummy); #endif // // Motor Current PWM // - _FIELD_TEST(motor_current_setting); - #if HAS_MOTOR_CURRENT_PWM - for (uint8_t q = XYZ; q--;) EEPROM_READ(stepper.motor_current_setting[q]); + for (uint8_t q = 3; q--;) EEPROM_READ(stepper.motor_current_setting[q]); #else - uint32_t dummyui32[XYZ]; - EEPROM_READ(dummyui32); + uint32_t dummyui32; + for (uint8_t q = 3; q--;) EEPROM_READ(dummyui32); #endif // // CNC Coordinate System // - _FIELD_TEST(coordinate_system); - #if ENABLED(CNC_COORDINATE_SYSTEMS) - if (!validating) (void)select_coordinate_system(-1); // Go back to machine space + (void)select_coordinate_system(-1); // Go back to machine space EEPROM_READ(coordinate_system); // 27 floats #else - for (uint8_t q = MAX_COORDINATE_SYSTEMS * XYZ; q--;) EEPROM_READ(dummy); + for (uint8_t q = 27; q--;) EEPROM_READ(dummy); #endif // // Skew correction factors // - _FIELD_TEST(planner_xy_skew_factor); - #if ENABLED(SKEW_CORRECTION_GCODE) EEPROM_READ(planner.xy_skew_factor); #if ENABLED(SKEW_CORRECTION_FOR_Z) @@ -1557,43 +1204,8 @@ void MarlinSettings::postprocess() { for (uint8_t q = 3; q--;) EEPROM_READ(dummy); #endif - // - // Advanced Pause filament load & unload lengths - // - - _FIELD_TEST(filament_change_unload_length); - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - EEPROM_READ(dummy); - if (!validating && q < COUNT(filament_change_unload_length)) filament_change_unload_length[q] = dummy; - } - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - EEPROM_READ(dummy); - if (!validating && q < COUNT(filament_change_load_length)) filament_change_load_length[q] = dummy; - } - #else - for (uint8_t q = MAX_EXTRUDERS * 2; q--;) EEPROM_READ(dummy); - #endif - - eeprom_error = size_error(eeprom_index - (EEPROM_OFFSET)); - if (eeprom_error) { - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET))); - SERIAL_ECHOLNPAIR(" Size: ", datasize()); - } - else if (working_crc != stored_crc) { - eeprom_error = true; - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ERROR_START(); - SERIAL_ERRORPGM("EEPROM CRC mismatch - (stored) "); - SERIAL_ERROR(stored_crc); - SERIAL_ERRORPGM(" != "); - SERIAL_ERROR(working_crc); - SERIAL_ERRORLNPGM(" (calculated)!"); - #endif - } - else if (!validating) { + if (working_crc == stored_crc) { + postprocess(); #if ENABLED(EEPROM_CHITCHAT) SERIAL_ECHO_START(); SERIAL_ECHO(version); @@ -1602,67 +1214,63 @@ void MarlinSettings::postprocess() { SERIAL_ECHOLNPGM(")"); #endif } - - if (!validating && !eeprom_error) postprocess(); + else { + #if ENABLED(EEPROM_CHITCHAT) + SERIAL_ERROR_START(); + SERIAL_ERRORPGM("EEPROM CRC mismatch - (stored) "); + SERIAL_ERROR(stored_crc); + SERIAL_ERRORPGM(" != "); + SERIAL_ERROR(working_crc); + SERIAL_ERRORLNPGM(" (calculated)!"); + #endif + reset(); + } #if ENABLED(AUTO_BED_LEVELING_UBL) - if (!validating) { - ubl.report_state(); + meshes_begin = (eeprom_index + 32) & 0xFFF8; // Pad the end of configuration data so it + // can float up or down a little bit without + // disrupting the mesh data + ubl.report_state(); - if (!ubl.sanity_check()) { - SERIAL_EOL(); - #if ENABLED(EEPROM_CHITCHAT) - ubl.echo_name(); - SERIAL_ECHOLNPGM(" initialized.\n"); - #endif - } - else { - eeprom_error = true; - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_PROTOCOLPGM("?Can't enable "); - ubl.echo_name(); - SERIAL_PROTOCOLLNPGM("."); - #endif - ubl.reset(); - } + if (!ubl.sanity_check()) { + SERIAL_EOL(); + #if ENABLED(EEPROM_CHITCHAT) + ubl.echo_name(); + SERIAL_ECHOLNPGM(" initialized.\n"); + #endif + } + else { + #if ENABLED(EEPROM_CHITCHAT) + SERIAL_PROTOCOLPGM("?Can't enable "); + ubl.echo_name(); + SERIAL_PROTOCOLLNPGM("."); + #endif + ubl.reset(); + } - if (ubl.storage_slot >= 0) { - load_mesh(ubl.storage_slot); - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHOPAIR("Mesh ", ubl.storage_slot); - SERIAL_ECHOLNPGM(" loaded from storage."); - #endif - } - else { - ubl.reset(); - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHOLNPGM("UBL System reset()"); - #endif - } + if (ubl.storage_slot >= 0) { + load_mesh(ubl.storage_slot); + #if ENABLED(EEPROM_CHITCHAT) + SERIAL_ECHOPAIR("Mesh ", ubl.storage_slot); + SERIAL_ECHOLNPGM(" loaded from storage."); + #endif + } + else { + ubl.reset(); + #if ENABLED(EEPROM_CHITCHAT) + SERIAL_ECHOLNPGM("UBL System reset()"); + #endif } #endif } #if ENABLED(EEPROM_CHITCHAT) && DISABLED(DISABLE_M503) - if (!validating) report(); + report(); #endif return !eeprom_error; } - bool MarlinSettings::validate() { - validating = true; - const bool success = _load(); - validating = false; - return success; - } - - bool MarlinSettings::load() { - if (validate()) return _load(); - reset(); - return true; - } - #if ENABLED(AUTO_BED_LEVELING_UBL) #if ENABLED(EEPROM_CHITCHAT) @@ -1673,23 +1281,18 @@ void MarlinSettings::postprocess() { } #endif - uint16_t MarlinSettings::meshes_start_index() { - return (datasize() + EEPROM_OFFSET + 32) & 0xFFF8; // Pad the end of configuration data so it can float up - // or down a little bit without disrupting the mesh data - } - uint16_t MarlinSettings::calc_num_meshes() { - return (meshes_end - meshes_start_index()) / sizeof(ubl.z_values); - } + //obviously this will get more sophisticated once we've added an actual MAT - int MarlinSettings::mesh_slot_offset(const int8_t slot) { - return meshes_end - (slot + 1) * sizeof(ubl.z_values); + if (meshes_begin <= 0) return 0; + + return (meshes_end - meshes_begin) / sizeof(ubl.z_values); } void MarlinSettings::store_mesh(const int8_t slot) { #if ENABLED(AUTO_BED_LEVELING_UBL) - const int16_t a = calc_num_meshes(); + const uint16_t a = calc_num_meshes(); if (!WITHIN(slot, 0, a - 1)) { #if ENABLED(EEPROM_CHITCHAT) ubl_invalid_slot(a); @@ -1701,8 +1304,9 @@ void MarlinSettings::postprocess() { return; } - int pos = mesh_slot_offset(slot); uint16_t crc = 0; + int pos = meshes_end - (slot + 1) * sizeof(ubl.z_values); + write_data(pos, (uint8_t *)&ubl.z_values, sizeof(ubl.z_values), &crc); // Write crc to MAT along with other data, or just tack on to the beginning or end @@ -1722,7 +1326,7 @@ void MarlinSettings::postprocess() { #if ENABLED(AUTO_BED_LEVELING_UBL) - const int16_t a = settings.calc_num_meshes(); + const uint16_t a = settings.calc_num_meshes(); if (!WITHIN(slot, 0, a - 1)) { #if ENABLED(EEPROM_CHITCHAT) @@ -1731,8 +1335,8 @@ void MarlinSettings::postprocess() { return; } - int pos = mesh_slot_offset(slot); uint16_t crc = 0; + int pos = meshes_end - (slot + 1) * sizeof(ubl.z_values); uint8_t * const dest = into ? (uint8_t*)into : (uint8_t*)&ubl.z_values; read_data(pos, dest, sizeof(ubl.z_values), &crc); @@ -1769,36 +1373,23 @@ void MarlinSettings::postprocess() { */ void MarlinSettings::reset() { static const float tmp1[] PROGMEM = DEFAULT_AXIS_STEPS_PER_UNIT, tmp2[] PROGMEM = DEFAULT_MAX_FEEDRATE; - static const uint32_t tmp3[] PROGMEM = DEFAULT_MAX_ACCELERATION; - LOOP_NUM_AXIS_N(i) { + LOOP_XYZE_N(i) { planner.axis_steps_per_mm[i] = pgm_read_float(&tmp1[i < COUNT(tmp1) ? i : COUNT(tmp1) - 1]); planner.max_feedrate_mm_s[i] = pgm_read_float(&tmp2[i < COUNT(tmp2) ? i : COUNT(tmp2) - 1]); planner.max_acceleration_mm_per_s2[i] = pgm_read_dword_near(&tmp3[i < COUNT(tmp3) ? i : COUNT(tmp3) - 1]); } - planner.min_segment_time_us = DEFAULT_MINSEGMENTTIME; planner.acceleration = DEFAULT_ACCELERATION; planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION; planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION; planner.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE; planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE; - - #if ENABLED(JUNCTION_DEVIATION) - planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM); - #else - #if ENABLED(HANGPRINTER) - planner.max_jerk[A_AXIS] = DEFAULT_AJERK; - planner.max_jerk[B_AXIS] = DEFAULT_BJERK; - planner.max_jerk[C_AXIS] = DEFAULT_CJERK; - planner.max_jerk[D_AXIS] = DEFAULT_DJERK; - #else - planner.max_jerk[X_AXIS] = DEFAULT_XJERK; - planner.max_jerk[Y_AXIS] = DEFAULT_YJERK; - planner.max_jerk[Z_AXIS] = DEFAULT_ZJERK; - #endif - planner.max_jerk[E_AXIS] = DEFAULT_EJERK; - #endif + planner.min_segment_time_us = DEFAULT_MINSEGMENTTIME; + planner.max_jerk[X_AXIS] = DEFAULT_XJERK; + planner.max_jerk[Y_AXIS] = DEFAULT_YJERK; + planner.max_jerk[Z_AXIS] = DEFAULT_ZJERK; + planner.max_jerk[E_AXIS] = DEFAULT_EJERK; #if HAS_HOME_OFFSET ZERO(home_offset); @@ -1808,7 +1399,7 @@ void MarlinSettings::reset() { constexpr float tmp4[XYZ][HOTENDS] = { HOTEND_OFFSET_X, HOTEND_OFFSET_Y - #if HAS_HOTEND_OFFSET_Z + #ifdef HOTEND_OFFSET_Z , HOTEND_OFFSET_Z #else , { 0 } @@ -1848,23 +1439,10 @@ void MarlinSettings::reset() { delta_calibration_radius = DELTA_CALIBRATION_RADIUS; COPY(delta_tower_angle_trim, dta); - #elif ENABLED(HANGPRINTER) - - anchor_A_y = float(ANCHOR_A_Y); - anchor_A_z = float(ANCHOR_A_Z); - anchor_B_x = float(ANCHOR_B_X); - anchor_B_y = float(ANCHOR_B_Y); - anchor_B_z = float(ANCHOR_B_Z); - anchor_C_x = float(ANCHOR_C_X); - anchor_C_y = float(ANCHOR_C_Y); - anchor_C_z = float(ANCHOR_C_Z); - anchor_D_z = float(ANCHOR_D_Z); - delta_segments_per_second = KINEMATIC_SEGMENTS_PER_SECOND; - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) #if ENABLED(X_DUAL_ENDSTOPS) - endstops.x_endstop_adj = ( + x_endstop_adj = ( #ifdef X_DUAL_ENDSTOPS_ADJUSTMENT X_DUAL_ENDSTOPS_ADJUSTMENT #else @@ -1873,7 +1451,7 @@ void MarlinSettings::reset() { ); #endif #if ENABLED(Y_DUAL_ENDSTOPS) - endstops.y_endstop_adj = ( + y_endstop_adj = ( #ifdef Y_DUAL_ENDSTOPS_ADJUSTMENT Y_DUAL_ENDSTOPS_ADJUSTMENT #else @@ -1882,7 +1460,7 @@ void MarlinSettings::reset() { ); #endif #if ENABLED(Z_DUAL_ENDSTOPS) - endstops.z_endstop_adj = ( + z_endstop_adj = ( #ifdef Z_DUAL_ENDSTOPS_ADJUSTMENT Z_DUAL_ENDSTOPS_ADJUSTMENT #else @@ -1890,6 +1468,7 @@ void MarlinSettings::reset() { #endif ); #endif + #endif #if ENABLED(ULTIPANEL) @@ -1906,7 +1485,7 @@ void MarlinSettings::reset() { HOTEND_LOOP() #endif { - PID_PARAM(Kp, e) = float(DEFAULT_Kp); + 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_EXTRUSION_SCALING) @@ -1914,7 +1493,7 @@ void MarlinSettings::reset() { #endif } #if ENABLED(PID_EXTRUSION_SCALING) - thermalManager.lpq_len = 20; // default last-position-queue size + lpq_len = 20; // default last-position-queue size #endif #endif // PIDTEMP @@ -1929,8 +1508,16 @@ void MarlinSettings::reset() { #endif #if ENABLED(FWRETRACT) - fwretract.reset(); - #endif + autoretract_enabled = false; + retract_length = RETRACT_LENGTH; + retract_feedrate_mm_s = RETRACT_FEEDRATE; + retract_zlift = RETRACT_ZLIFT; + retract_recover_length = RETRACT_RECOVER_LENGTH; + retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE; + swap_retract_length = RETRACT_LENGTH_SWAP; + swap_retract_recover_length = RETRACT_RECOVER_LENGTH_SWAP; + swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP; + #endif // FWRETRACT #if DISABLED(NO_VOLUMETRICS) @@ -1954,15 +1541,63 @@ void MarlinSettings::reset() { #endif ); - reset_stepper_drivers(); + #if X_IS_TRINAMIC + stepperX.setCurrent(X_CURRENT, R_SENSE, HOLD_MULTIPLIER); + #endif + #if Y_IS_TRINAMIC + stepperY.setCurrent(Y_CURRENT, R_SENSE, HOLD_MULTIPLIER); + #endif + #if Z_IS_TRINAMIC + stepperZ.setCurrent(Z_CURRENT, R_SENSE, HOLD_MULTIPLIER); + #endif + #if X2_IS_TRINAMIC + stepperX2.setCurrent(X2_CURRENT, R_SENSE, HOLD_MULTIPLIER); + #endif + #if Y2_IS_TRINAMIC + stepperY2.setCurrent(Y2_CURRENT, R_SENSE, HOLD_MULTIPLIER); + #endif + #if Z2_IS_TRINAMIC + stepperZ2.setCurrent(Z2_CURRENT, R_SENSE, HOLD_MULTIPLIER); + #endif + #if E0_IS_TRINAMIC + stepperE0.setCurrent(E0_CURRENT, R_SENSE, HOLD_MULTIPLIER); + #endif + #if E1_IS_TRINAMIC + stepperE1.setCurrent(E1_CURRENT, R_SENSE, HOLD_MULTIPLIER); + #endif + #if E2_IS_TRINAMIC + stepperE2.setCurrent(E2_CURRENT, R_SENSE, HOLD_MULTIPLIER); + #endif + #if E3_IS_TRINAMIC + stepperE3.setCurrent(E3_CURRENT, R_SENSE, HOLD_MULTIPLIER); + #endif + #if E4_IS_TRINAMIC + stepperE4.setCurrent(E4_CURRENT, R_SENSE, HOLD_MULTIPLIER); + #endif + + #if ENABLED(SENSORLESS_HOMING) + #if ENABLED(X_IS_TMC2130) + stepperX.sgt(X_HOMING_SENSITIVITY); + #endif + #if ENABLED(X2_IS_TMC2130) + stepperX2.sgt(X_HOMING_SENSITIVITY); + #endif + #if ENABLED(Y_IS_TMC2130) + stepperY.sgt(Y_HOMING_SENSITIVITY); + #endif + #if ENABLED(Y2_IS_TMC2130) + stepperY2.sgt(Y_HOMING_SENSITIVITY); + #endif + #endif #if ENABLED(LIN_ADVANCE) - planner.extruder_advance_K = LIN_ADVANCE_K; + planner.extruder_advance_k = LIN_ADVANCE_K; + planner.advance_ed_ratio = LIN_ADVANCE_E_D_RATIO; #endif #if HAS_MOTOR_CURRENT_PWM - uint32_t tmp_motor_current_setting[XYZ] = PWM_MOTOR_CURRENT; - for (uint8_t q = XYZ; q--;) + uint32_t tmp_motor_current_setting[3] = PWM_MOTOR_CURRENT; + for (uint8_t q = 3; q--;) stepper.digipot_current(q, (stepper.motor_current_setting[q] = tmp_motor_current_setting[q])); #endif @@ -1974,13 +1609,6 @@ void MarlinSettings::reset() { #endif #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) - for (uint8_t e = 0; e < EXTRUDERS; e++) { - filament_change_unload_length[e] = FILAMENT_CHANGE_UNLOAD_LENGTH; - filament_change_load_length[e] = FILAMENT_CHANGE_FAST_LOAD_LENGTH; - } - #endif - postprocess(); #if ENABLED(EEPROM_CHITCHAT) @@ -1993,30 +1621,6 @@ void MarlinSettings::reset() { #define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START(); }while(0) - #if HAS_TRINAMIC - void say_M906() { SERIAL_ECHOPGM(" M906"); } - #if ENABLED(HYBRID_THRESHOLD) - void say_M913() { SERIAL_ECHOPGM(" M913"); } - #endif - #if ENABLED(SENSORLESS_HOMING) - void say_M914() { SERIAL_ECHOPGM(" M914"); } - #endif - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - void say_M603() { SERIAL_ECHOPGM(" M603 "); } - #endif - - inline void say_units(const bool colon=false) { - serialprintPGM( - #if ENABLED(INCH_MODE_SUPPORT) - parser.linear_unit_factor != 1.0 ? PSTR(" (in)") : - #endif - PSTR(" (mm)") - ); - if (colon) SERIAL_ECHOLNPGM(":"); - } - /** * M503 - Report current settings in RAM * @@ -2033,15 +1637,13 @@ void MarlinSettings::reset() { #define VOLUMETRIC_UNIT(N) (float(N) / (parser.volumetric_enabled ? parser.volumetric_unit_factor : parser.linear_unit_factor)) SERIAL_ECHOPGM(" G2"); SERIAL_CHAR(parser.linear_unit_factor == 1.0 ? '1' : '0'); - SERIAL_ECHOPGM(" ;"); - say_units(); + SERIAL_ECHOPGM(" ; Units in "); + serialprintPGM(parser.linear_unit_factor == 1.0 ? PSTR("mm\n") : PSTR("inches\n")); #else #define LINEAR_UNIT(N) (N) #define VOLUMETRIC_UNIT(N) (N) - SERIAL_ECHOPGM(" G21 ;"); - say_units(); + SERIAL_ECHOLNPGM(" G21 ; Units in mm"); #endif - SERIAL_EOL(); #if ENABLED(ULTIPANEL) @@ -2113,16 +1715,9 @@ void MarlinSettings::reset() { SERIAL_ECHOLNPGM("Steps per unit:"); } CONFIG_ECHO_START; - #if ENABLED(HANGPRINTER) - SERIAL_ECHOPAIR(" M92 A", LINEAR_UNIT(planner.axis_steps_per_mm[A_AXIS])); - SERIAL_ECHOPAIR(" B", LINEAR_UNIT(planner.axis_steps_per_mm[B_AXIS])); - SERIAL_ECHOPAIR(" C", LINEAR_UNIT(planner.axis_steps_per_mm[C_AXIS])); - SERIAL_ECHOPAIR(" D", LINEAR_UNIT(planner.axis_steps_per_mm[D_AXIS])); - #else - SERIAL_ECHOPAIR(" M92 X", LINEAR_UNIT(planner.axis_steps_per_mm[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.axis_steps_per_mm[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.axis_steps_per_mm[Z_AXIS])); - #endif + SERIAL_ECHOPAIR(" M92 X", LINEAR_UNIT(planner.axis_steps_per_mm[X_AXIS])); + SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.axis_steps_per_mm[Y_AXIS])); + SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.axis_steps_per_mm[Z_AXIS])); #if DISABLED(DISTINCT_E_FACTORS) SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.axis_steps_per_mm[E_AXIS])); #endif @@ -2140,16 +1735,9 @@ void MarlinSettings::reset() { SERIAL_ECHOLNPGM("Maximum feedrates (units/s):"); } CONFIG_ECHO_START; - #if ENABLED(HANGPRINTER) - SERIAL_ECHOPAIR(" M203 A", LINEAR_UNIT(planner.max_feedrate_mm_s[A_AXIS])); - SERIAL_ECHOPAIR(" B", LINEAR_UNIT(planner.max_feedrate_mm_s[B_AXIS])); - SERIAL_ECHOPAIR(" C", LINEAR_UNIT(planner.max_feedrate_mm_s[C_AXIS])); - SERIAL_ECHOPAIR(" D", LINEAR_UNIT(planner.max_feedrate_mm_s[D_AXIS])); - #else - SERIAL_ECHOPAIR(" M203 X", LINEAR_UNIT(planner.max_feedrate_mm_s[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_feedrate_mm_s[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_feedrate_mm_s[Z_AXIS])); - #endif + SERIAL_ECHOPAIR(" M203 X", LINEAR_UNIT(planner.max_feedrate_mm_s[X_AXIS])); + SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_feedrate_mm_s[Y_AXIS])); + SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_feedrate_mm_s[Z_AXIS])); #if DISABLED(DISTINCT_E_FACTORS) SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.max_feedrate_mm_s[E_AXIS])); #endif @@ -2167,16 +1755,9 @@ void MarlinSettings::reset() { SERIAL_ECHOLNPGM("Maximum Acceleration (units/s2):"); } CONFIG_ECHO_START; - #if ENABLED(HANGPRINTER) - SERIAL_ECHOPAIR(" M201 A", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[A_AXIS])); - SERIAL_ECHOPAIR(" B", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[B_AXIS])); - SERIAL_ECHOPAIR(" C", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[C_AXIS])); - SERIAL_ECHOPAIR(" D", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[D_AXIS])); - #else - SERIAL_ECHOPAIR(" M201 X", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[Z_AXIS])); - #endif + SERIAL_ECHOPAIR(" M201 X", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[X_AXIS])); + SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[Y_AXIS])); + SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[Z_AXIS])); #if DISABLED(DISTINCT_E_FACTORS) SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.max_acceleration_mm_per_s2[E_AXIS])); #endif @@ -2200,42 +1781,16 @@ void MarlinSettings::reset() { if (!forReplay) { CONFIG_ECHO_START; - SERIAL_ECHOPGM("Advanced: Q S T"); - #if ENABLED(JUNCTION_DEVIATION) - SERIAL_ECHOPGM(" J"); - #else - #if ENABLED(HANGPRINTER) - SERIAL_ECHOPGM(" A B C D"); - #else - SERIAL_ECHOPGM(" X Y Z"); - #endif - #endif - #if DISABLED(JUNCTION_DEVIATION) || ENABLED(LIN_ADVANCE) - SERIAL_ECHOPGM(" E"); - #endif - SERIAL_EOL(); + SERIAL_ECHOLNPGM("Advanced: S T B X Z E"); } CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M205 Q", LINEAR_UNIT(planner.min_segment_time_us)); - SERIAL_ECHOPAIR(" S", LINEAR_UNIT(planner.min_feedrate_mm_s)); + SERIAL_ECHOPAIR(" M205 S", LINEAR_UNIT(planner.min_feedrate_mm_s)); SERIAL_ECHOPAIR(" T", LINEAR_UNIT(planner.min_travel_feedrate_mm_s)); - - #if ENABLED(JUNCTION_DEVIATION) - SERIAL_ECHOPAIR(" J", LINEAR_UNIT(planner.junction_deviation_mm)); - #else - #if ENABLED(HANGPRINTER) - SERIAL_ECHOPAIR(" A", LINEAR_UNIT(planner.max_jerk[A_AXIS])); - SERIAL_ECHOPAIR(" B", LINEAR_UNIT(planner.max_jerk[B_AXIS])); - SERIAL_ECHOPAIR(" C", LINEAR_UNIT(planner.max_jerk[C_AXIS])); - SERIAL_ECHOPAIR(" D", LINEAR_UNIT(planner.max_jerk[D_AXIS])); - #else - SERIAL_ECHOPAIR(" X", LINEAR_UNIT(planner.max_jerk[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_jerk[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_jerk[Z_AXIS])); - #endif - SERIAL_ECHOPAIR(" E", LINEAR_UNIT(planner.max_jerk[E_AXIS])); - #endif - SERIAL_EOL(); + SERIAL_ECHOPAIR(" B", planner.min_segment_time_us); + SERIAL_ECHOPAIR(" X", LINEAR_UNIT(planner.max_jerk[X_AXIS])); + SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_jerk[Y_AXIS])); + SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_jerk[Z_AXIS])); + SERIAL_ECHOLNPAIR(" E", LINEAR_UNIT(planner.max_jerk[E_AXIS])); #if HAS_M206_COMMAND if (!forReplay) { @@ -2258,7 +1813,7 @@ void MarlinSettings::reset() { SERIAL_ECHOPAIR(" M218 T", (int)e); SERIAL_ECHOPAIR(" X", LINEAR_UNIT(hotend_offset[X_AXIS][e])); SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e])); - #if HAS_HOTEND_OFFSET_Z + #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) ||ENABLED(PARKING_EXTRUDER) SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(hotend_offset[Z_AXIS][e])); #endif SERIAL_EOL(); @@ -2303,16 +1858,14 @@ void MarlinSettings::reset() { #if ENABLED(MESH_BED_LEVELING) - if (leveling_is_valid()) { - for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) { - for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) { - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" G29 S3 X", (int)px + 1); - SERIAL_ECHOPAIR(" Y", (int)py + 1); - SERIAL_ECHOPGM(" Z"); - SERIAL_ECHO_F(LINEAR_UNIT(mbl.z_values[px][py]), 5); - SERIAL_EOL(); - } + for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) { + for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) { + CONFIG_ECHO_START; + SERIAL_ECHOPAIR(" G29 S3 X", (int)px + 1); + SERIAL_ECHOPAIR(" Y", (int)py + 1); + SERIAL_ECHOPGM(" Z"); + SERIAL_PROTOCOL_F(LINEAR_UNIT(mbl.z_values[px][py]), 5); + SERIAL_EOL(); } } @@ -2326,29 +1879,11 @@ void MarlinSettings::reset() { SERIAL_ECHOLNPGM(" meshes.\n"); } - //ubl.report_current_mesh(PORTVAR_SOLO); // This is too verbose for large mesh's. A better (more terse) - // solution needs to be found. - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - if (leveling_is_valid()) { - for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) { - for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) { - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" G29 W I", (int)px); - SERIAL_ECHOPAIR(" J", (int)py); - SERIAL_ECHOPGM(" Z"); - SERIAL_ECHO_F(LINEAR_UNIT(z_values[px][py]), 5); - SERIAL_EOL(); - } - } - } - #endif #endif // HAS_LEVELING #if ENABLED(DELTA) - if (!forReplay) { CONFIG_ECHO_START; SERIAL_ECHOLNPGM("Endstop adjustment:"); @@ -2372,26 +1907,7 @@ void MarlinSettings::reset() { SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(delta_tower_angle_trim[C_AXIS])); SERIAL_EOL(); - #elif ENABLED(HANGPRINTER) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Hangprinter settings: W E R T Y U I O P S"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M665 W", anchor_A_y); - SERIAL_ECHOPAIR(" E", anchor_A_z); - SERIAL_ECHOPAIR(" R", anchor_B_x); - SERIAL_ECHOPAIR(" T", anchor_B_y); - SERIAL_ECHOPAIR(" Y", anchor_B_z); - SERIAL_ECHOPAIR(" U", anchor_C_x); - SERIAL_ECHOPAIR(" I", anchor_C_y); - SERIAL_ECHOPAIR(" O", anchor_C_z); - SERIAL_ECHOPAIR(" P", anchor_D_z); - SERIAL_ECHOPAIR(" S", delta_segments_per_second); - SERIAL_EOL(); - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - if (!forReplay) { CONFIG_ECHO_START; SERIAL_ECHOLNPGM("Endstop adjustment:"); @@ -2399,17 +1915,16 @@ void MarlinSettings::reset() { CONFIG_ECHO_START; SERIAL_ECHOPGM(" M666"); #if ENABLED(X_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" X", LINEAR_UNIT(endstops.x_endstop_adj)); + SERIAL_ECHOPAIR(" X", LINEAR_UNIT(x_endstop_adj)); #endif #if ENABLED(Y_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(endstops.y_endstop_adj)); + SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(y_endstop_adj)); #endif #if ENABLED(Z_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(endstops.z_endstop_adj)); + SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(z_endstop_adj)); #endif SERIAL_EOL(); - - #endif // [XYZ]_DUAL_ENDSTOPS + #endif // DELTA #if ENABLED(ULTIPANEL) if (!forReplay) { @@ -2442,7 +1957,7 @@ void MarlinSettings::reset() { 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", thermalManager.lpq_len); + if (e == 0) SERIAL_ECHOPAIR(" L", lpq_len); #endif SERIAL_EOL(); } @@ -2457,7 +1972,7 @@ void MarlinSettings::reset() { SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0))); #if ENABLED(PID_EXTRUSION_SCALING) SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, 0)); - SERIAL_ECHOPAIR(" L", thermalManager.lpq_len); + SERIAL_ECHOPAIR(" L", lpq_len); #endif SERIAL_EOL(); } @@ -2489,26 +2004,26 @@ void MarlinSettings::reset() { SERIAL_ECHOLNPGM("Retract: S F Z"); } CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M207 S", LINEAR_UNIT(fwretract.retract_length)); - SERIAL_ECHOPAIR(" W", LINEAR_UNIT(fwretract.swap_retract_length)); - SERIAL_ECHOPAIR(" F", MMS_TO_MMM(LINEAR_UNIT(fwretract.retract_feedrate_mm_s))); - SERIAL_ECHOLNPAIR(" Z", LINEAR_UNIT(fwretract.retract_zlift)); + SERIAL_ECHOPAIR(" M207 S", LINEAR_UNIT(retract_length)); + SERIAL_ECHOPAIR(" W", LINEAR_UNIT(swap_retract_length)); + SERIAL_ECHOPAIR(" F", MMS_TO_MMM(LINEAR_UNIT(retract_feedrate_mm_s))); + SERIAL_ECHOLNPAIR(" Z", LINEAR_UNIT(retract_zlift)); if (!forReplay) { CONFIG_ECHO_START; SERIAL_ECHOLNPGM("Recover: S F"); } CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M208 S", LINEAR_UNIT(fwretract.retract_recover_length)); - SERIAL_ECHOPAIR(" W", LINEAR_UNIT(fwretract.swap_retract_recover_length)); - SERIAL_ECHOLNPAIR(" F", MMS_TO_MMM(LINEAR_UNIT(fwretract.retract_recover_feedrate_mm_s))); + SERIAL_ECHOPAIR(" M208 S", LINEAR_UNIT(retract_recover_length)); + SERIAL_ECHOPAIR(" W", LINEAR_UNIT(swap_retract_recover_length)); + SERIAL_ECHOLNPAIR(" F", MMS_TO_MMM(LINEAR_UNIT(retract_recover_feedrate_mm_s))); if (!forReplay) { CONFIG_ECHO_START; SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret E-only moves as retract/recover"); } CONFIG_ECHO_START; - SERIAL_ECHOLNPAIR(" M209 S", fwretract.autoretract_enabled ? 1 : 0); + SERIAL_ECHOLNPAIR(" M209 S", autoretract_enabled ? 1 : 0); #endif // FWRETRACT @@ -2518,8 +2033,7 @@ void MarlinSettings::reset() { #if HAS_BED_PROBE if (!forReplay) { CONFIG_ECHO_START; - SERIAL_ECHOPGM("Z-Probe Offset"); - say_units(true); + SERIAL_ECHOLNPGM("Z-Probe Offset (mm):"); } CONFIG_ECHO_START; SERIAL_ECHOLNPAIR(" M851 Z", LINEAR_UNIT(zprobe_zoffset)); @@ -2535,190 +2049,84 @@ void MarlinSettings::reset() { } CONFIG_ECHO_START; #if ENABLED(SKEW_CORRECTION_FOR_Z) - SERIAL_ECHOPGM(" M852 I"); - SERIAL_ECHO_F(LINEAR_UNIT(planner.xy_skew_factor), 6); - SERIAL_ECHOPGM(" J"); - SERIAL_ECHO_F(LINEAR_UNIT(planner.xz_skew_factor), 6); - SERIAL_ECHOPGM(" K"); - SERIAL_ECHO_F(LINEAR_UNIT(planner.yz_skew_factor), 6); - SERIAL_EOL(); + SERIAL_ECHOPAIR(" M852 I", LINEAR_UNIT(planner.xy_skew_factor)); + SERIAL_ECHOPAIR(" J", LINEAR_UNIT(planner.xz_skew_factor)); + SERIAL_ECHOLNPAIR(" K", LINEAR_UNIT(planner.yz_skew_factor)); #else - SERIAL_ECHOPGM(" M852 S"); - SERIAL_ECHO_F(LINEAR_UNIT(planner.xy_skew_factor), 6); - SERIAL_EOL(); + SERIAL_ECHOLNPAIR(" M852 S", LINEAR_UNIT(planner.xy_skew_factor)); #endif #endif + /** + * TMC2130 stepper driver current + */ #if HAS_TRINAMIC - - /** - * TMC2130 / TMC2208 stepper driver current - */ if (!forReplay) { CONFIG_ECHO_START; SERIAL_ECHOLNPGM("Stepper driver current:"); } CONFIG_ECHO_START; - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - say_M906(); + SERIAL_ECHO(" M906"); + #if ENABLED(X_IS_TMC2130) || ENABLED(X_IS_TMC2208) + SERIAL_ECHOPAIR(" X ", stepperX.getCurrent()); #endif - #if AXIS_IS_TMC(X) - SERIAL_ECHOPAIR(" X", stepperX.getCurrent()); + #if ENABLED(Y_IS_TMC2130) || ENABLED(Y_IS_TMC2208) + SERIAL_ECHOPAIR(" Y ", stepperY.getCurrent()); #endif - #if AXIS_IS_TMC(Y) - SERIAL_ECHOPAIR(" Y", stepperY.getCurrent()); + #if ENABLED(Z_IS_TMC2130) || ENABLED(Z_IS_TMC2208) + SERIAL_ECHOPAIR(" Z ", stepperZ.getCurrent()); #endif - #if AXIS_IS_TMC(Z) - SERIAL_ECHOPAIR(" Z", stepperZ.getCurrent()); + #if ENABLED(X2_IS_TMC2130) || ENABLED(X2_IS_TMC2208) + SERIAL_ECHOPAIR(" X2 ", stepperX2.getCurrent()); #endif - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - SERIAL_EOL(); + #if ENABLED(Y2_IS_TMC2130) || ENABLED(Y2_IS_TMC2208) + SERIAL_ECHOPAIR(" Y2 ", stepperY2.getCurrent()); #endif - #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) - say_M906(); - SERIAL_ECHOPGM(" I1"); + #if ENABLED(Z2_IS_TMC2130) || ENABLED(Z2_IS_TMC2208) + SERIAL_ECHOPAIR(" Z2 ", stepperZ2.getCurrent()); #endif - #if AXIS_IS_TMC(X2) - SERIAL_ECHOPAIR(" X", stepperX2.getCurrent()); + #if ENABLED(E0_IS_TMC2130) || ENABLED(E0_IS_TMC2208) + SERIAL_ECHOPAIR(" E0 ", stepperE0.getCurrent()); #endif - #if AXIS_IS_TMC(Y2) - SERIAL_ECHOPAIR(" Y", stepperY2.getCurrent()); + #if ENABLED(E1_IS_TMC2130) || ENABLED(E1_IS_TMC2208) + SERIAL_ECHOPAIR(" E1 ", stepperE1.getCurrent()); #endif - #if AXIS_IS_TMC(Z2) - SERIAL_ECHOPAIR(" Z", stepperZ2.getCurrent()); + #if ENABLED(E2_IS_TMC2130) || ENABLED(E2_IS_TMC2208) + SERIAL_ECHOPAIR(" E2 ", stepperE2.getCurrent()); #endif - #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) - SERIAL_EOL(); + #if ENABLED(E3_IS_TMC2130) || ENABLED(E3_IS_TMC2208) + SERIAL_ECHOPAIR(" E3 ", stepperE3.getCurrent()); #endif - #if AXIS_IS_TMC(E0) - say_M906(); - SERIAL_ECHOLNPAIR(" T0 E", stepperE0.getCurrent()); - #endif - #if E_STEPPERS > 1 && AXIS_IS_TMC(E1) - say_M906(); - SERIAL_ECHOLNPAIR(" T1 E", stepperE1.getCurrent()); - #endif - #if E_STEPPERS > 2 && AXIS_IS_TMC(E2) - say_M906(); - SERIAL_ECHOLNPAIR(" T2 E", stepperE2.getCurrent()); - #endif - #if E_STEPPERS > 3 && AXIS_IS_TMC(E3) - say_M906(); - SERIAL_ECHOLNPAIR(" T3 E", stepperE3.getCurrent()); - #endif - #if E_STEPPERS > 4 && AXIS_IS_TMC(E4) - say_M906(); - SERIAL_ECHOLNPAIR(" T4 E", stepperE4.getCurrent()); + #if ENABLED(E4_IS_TMC2130) || ENABLED(E4_IS_TMC2208) + SERIAL_ECHOPAIR(" E4 ", stepperE4.getCurrent()); #endif SERIAL_EOL(); + #endif - /** - * TMC2130 / TMC2208 / TRAMS Hybrid Threshold - */ - #if ENABLED(HYBRID_THRESHOLD) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Hybrid Threshold:"); - } + /** + * TMC2130 Sensorless homing thresholds + */ + #if ENABLED(SENSORLESS_HOMING) + if (!forReplay) { CONFIG_ECHO_START; - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - say_M913(); - #endif - #if AXIS_IS_TMC(X) - SERIAL_ECHOPAIR(" X", TMC_GET_PWMTHRS(X, X)); - #endif - #if AXIS_IS_TMC(Y) - SERIAL_ECHOPAIR(" Y", TMC_GET_PWMTHRS(Y, Y)); - #endif - #if AXIS_IS_TMC(Z) - SERIAL_ECHOPAIR(" Z", TMC_GET_PWMTHRS(Z, Z)); - #endif - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - SERIAL_EOL(); - #endif - #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) - say_M913(); - SERIAL_ECHOPGM(" I1"); - #endif - #if AXIS_IS_TMC(X2) - SERIAL_ECHOPAIR(" X", TMC_GET_PWMTHRS(X, X2)); - #endif - #if AXIS_IS_TMC(Y2) - SERIAL_ECHOPAIR(" Y", TMC_GET_PWMTHRS(Y, Y2)); - #endif - #if AXIS_IS_TMC(Z2) - SERIAL_ECHOPAIR(" Z", TMC_GET_PWMTHRS(Z, Z2)); - #endif - #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) - SERIAL_EOL(); - #endif - #if AXIS_IS_TMC(E0) - say_M913(); - SERIAL_ECHOLNPAIR(" T0 E", TMC_GET_PWMTHRS(E, E0)); - #endif - #if E_STEPPERS > 1 && AXIS_IS_TMC(E1) - say_M913(); - SERIAL_ECHOLNPAIR(" T1 E", TMC_GET_PWMTHRS(E, E1)); - #endif - #if E_STEPPERS > 2 && AXIS_IS_TMC(E2) - say_M913(); - SERIAL_ECHOLNPAIR(" T2 E", TMC_GET_PWMTHRS(E, E2)); - #endif - #if E_STEPPERS > 3 && AXIS_IS_TMC(E3) - say_M913(); - SERIAL_ECHOLNPAIR(" T3 E", TMC_GET_PWMTHRS(E, E3)); - #endif - #if E_STEPPERS > 4 && AXIS_IS_TMC(E4) - say_M913(); - SERIAL_ECHOLNPAIR(" T4 E", TMC_GET_PWMTHRS(E, E4)); - #endif - SERIAL_EOL(); - #endif // HYBRID_THRESHOLD - - /** - * TMC2130 Sensorless homing thresholds - */ - #if ENABLED(SENSORLESS_HOMING) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Sensorless homing threshold:"); - } - CONFIG_ECHO_START; - #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS - say_M914(); - #if X_SENSORLESS - SERIAL_ECHOPAIR(" X", stepperX.sgt()); - #endif - #if Y_SENSORLESS - SERIAL_ECHOPAIR(" Y", stepperY.sgt()); - #endif - #if Z_SENSORLESS - SERIAL_ECHOPAIR(" Z", stepperZ.sgt()); - #endif - SERIAL_EOL(); - #endif - - #define X2_SENSORLESS (defined(X_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(X2)) - #define Y2_SENSORLESS (defined(Y_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y2)) - #define Z2_SENSORLESS (defined(Z_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2)) - #if X2_SENSORLESS || Y2_SENSORLESS || Z2_SENSORLESS - say_M914(); - SERIAL_ECHOPGM(" I1"); - #if X2_SENSORLESS - SERIAL_ECHOPAIR(" X", stepperX2.sgt()); - #endif - #if Y2_SENSORLESS - SERIAL_ECHOPAIR(" Y", stepperY2.sgt()); - #endif - #if Z2_SENSORLESS - SERIAL_ECHOPAIR(" Z", stepperZ2.sgt()); - #endif - SERIAL_EOL(); - #endif - - #endif // SENSORLESS_HOMING - - #endif // HAS_TRINAMIC + SERIAL_ECHOLNPGM("Sensorless homing threshold:"); + } + CONFIG_ECHO_START; + SERIAL_ECHO(" M914"); + #if ENABLED(X_IS_TMC2130) + SERIAL_ECHOPAIR(" X", stepperX.sgt()); + #endif + #if ENABLED(X2_IS_TMC2130) + SERIAL_ECHOPAIR(" X2 ", stepperX2.sgt()); + #endif + #if ENABLED(Y_IS_TMC2130) + SERIAL_ECHOPAIR(" Y", stepperY.sgt()); + #endif + #if ENABLED(X2_IS_TMC2130) + SERIAL_ECHOPAIR(" Y2 ", stepperY2.sgt()); + #endif + SERIAL_EOL(); + #endif /** * Linear Advance @@ -2729,7 +2137,8 @@ void MarlinSettings::reset() { SERIAL_ECHOLNPGM("Linear Advance:"); } CONFIG_ECHO_START; - SERIAL_ECHOLNPAIR(" M900 K", planner.extruder_advance_K); + SERIAL_ECHOPAIR(" M900 K", planner.extruder_advance_k); + SERIAL_ECHOLNPAIR(" R", planner.advance_ed_ratio); #endif #if HAS_MOTOR_CURRENT_PWM @@ -2743,48 +2152,6 @@ void MarlinSettings::reset() { SERIAL_ECHOPAIR(" E", stepper.motor_current_setting[2]); SERIAL_EOL(); #endif - - /** - * Advanced Pause filament load & unload lengths - */ - #if ENABLED(ADVANCED_PAUSE_FEATURE) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Filament load/unload lengths:"); - } - CONFIG_ECHO_START; - #if EXTRUDERS == 1 - say_M603(); - SERIAL_ECHOPAIR("L", LINEAR_UNIT(filament_change_load_length[0])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[0])); - #else - say_M603(); - SERIAL_ECHOPAIR("T0 L", LINEAR_UNIT(filament_change_load_length[0])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[0])); - CONFIG_ECHO_START; - say_M603(); - SERIAL_ECHOPAIR("T1 L", LINEAR_UNIT(filament_change_load_length[1])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[1])); - #if EXTRUDERS > 2 - CONFIG_ECHO_START; - say_M603(); - SERIAL_ECHOPAIR("T2 L", LINEAR_UNIT(filament_change_load_length[2])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[2])); - #if EXTRUDERS > 3 - CONFIG_ECHO_START; - say_M603(); - SERIAL_ECHOPAIR("T3 L", LINEAR_UNIT(filament_change_load_length[3])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[3])); - #if EXTRUDERS > 4 - CONFIG_ECHO_START; - say_M603(); - SERIAL_ECHOPAIR("T4 L", LINEAR_UNIT(filament_change_load_length[4])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[4])); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS == 1 - #endif // ADVANCED_PAUSE_FEATURE } #endif // !DISABLE_M503 diff --git a/Marlin/configuration_store.h b/Marlin/configuration_store.h index f7b50e0..e152e48 100644 --- a/Marlin/configuration_store.h +++ b/Marlin/configuration_store.h @@ -29,34 +29,17 @@ class MarlinSettings { public: MarlinSettings() { } - static uint16_t datasize(); - static void reset(); - static bool save(); // Return 'true' if data was saved - - FORCE_INLINE static bool init_eeprom() { - reset(); - #if ENABLED(EEPROM_SETTINGS) - const bool success = save(); - #if ENABLED(EEPROM_CHITCHAT) - if (success) report(); - #endif - return success; - #else - return true; - #endif - } + static bool save(); #if ENABLED(EEPROM_SETTINGS) - static bool load(); // Return 'true' if data was loaded ok - static bool validate(); // Return 'true' if EEPROM data is ok + static bool load(); #if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system // That can store is enabled - static uint16_t meshes_start_index(); - FORCE_INLINE static uint16_t meshes_end_index() { return meshes_end; } + FORCE_INLINE static int16_t get_start_of_meshes() { return meshes_begin; } + FORCE_INLINE static int16_t get_end_of_meshes() { return meshes_end; } static uint16_t calc_num_meshes(); - static int mesh_slot_offset(const int8_t slot); static void store_mesh(const int8_t slot); static void load_mesh(const int8_t slot, void * const into=NULL); @@ -79,20 +62,18 @@ class MarlinSettings { static void postprocess(); #if ENABLED(EEPROM_SETTINGS) - - static bool eeprom_error, validating; + static bool eeprom_error; #if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system // That can store is enabled - static constexpr uint16_t meshes_end = E2END - 128; // 128 is a placeholder for the size of the MAT; the MAT will always - // live at the very end of the eeprom + static int16_t meshes_begin; + const static int16_t meshes_end = E2END - 128; // 128 is a placeholder for the size of the MAT; the MAT will always + // live at the very end of the eeprom #endif - static bool _load(); static void write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc); - static void read_data(int &pos, uint8_t *value, uint16_t size, uint16_t *crc, const bool force=false); - static bool size_error(const uint16_t size); + static void read_data(int &pos, uint8_t *value, uint16_t size, uint16_t *crc); #endif }; diff --git a/Marlin/dac_mcp4728.cpp b/Marlin/dac_mcp4728.cpp index 783f9fb..a06346c 100644 --- a/Marlin/dac_mcp4728.cpp +++ b/Marlin/dac_mcp4728.cpp @@ -30,13 +30,11 @@ * http://arduino.cc/forum/index.php/topic,51842.0.html */ -#include "MarlinConfig.h" - -#if ENABLED(DAC_STEPPER_CURRENT) - #include "dac_mcp4728.h" #include "enum.h" +#if ENABLED(DAC_STEPPER_CURRENT) + uint16_t mcp4728_values[XYZE]; /** diff --git a/Marlin/digipot_mcp4018.cpp b/Marlin/digipot_mcp4018.cpp index 5871fdb..06622d0 100644 --- a/Marlin/digipot_mcp4018.cpp +++ b/Marlin/digipot_mcp4018.cpp @@ -89,7 +89,7 @@ static void i2c_send(const uint8_t channel, const byte v) { // This is for the MCP4018 I2C based digipot void digipot_i2c_set_current(uint8_t channel, float current) { - i2c_send(channel, current_to_wiper(MIN(MAX(current, 0), float(DIGIPOT_A4988_MAX_CURRENT)))); + i2c_send(channel, current_to_wiper(min(max(current, 0.0f), float(DIGIPOT_A4988_MAX_CURRENT)))); } void digipot_i2c_init() { diff --git a/Marlin/digipot_mcp4451.cpp b/Marlin/digipot_mcp4451.cpp index fed84b2..d79915c 100644 --- a/Marlin/digipot_mcp4451.cpp +++ b/Marlin/digipot_mcp4451.cpp @@ -50,7 +50,7 @@ static void i2c_send(const byte addr, const byte a, const byte b) { // This is for the MCP4451 I2C based digipot void digipot_i2c_set_current(uint8_t channel, float current) { - current = MIN((float) MAX(current, 0), DIGIPOT_I2C_MAX_CURRENT); + current = min((float) max(current, 0.0f), DIGIPOT_I2C_MAX_CURRENT); // these addresses are specific to Azteeg X3 Pro, can be set to others, // In this case first digipot is at address A0=0, A1= 0, second one is at A0=0, A1= 1 byte addr = 0x2C; // channel 0-3 diff --git a/Marlin/dogm_bitmaps.h b/Marlin/dogm_bitmaps.h index 42b94b7..4e0772a 100644 --- a/Marlin/dogm_bitmaps.h +++ b/Marlin/dogm_bitmaps.h @@ -21,1172 +21,543 @@ */ /** - * Standard Marlin Boot and Status Screen bitmaps + * Standard Marlin Bitmap for splashscreen * - * Use the Marlin Bitmap Converter to make your own: - * http://marlinfw.org/tools/u8glib/converter.html + * 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. */ -#include "MarlinConfig.h" - +//#define START_BMPHIGH #if ENABLED(SHOW_BOOTSCREEN) - - //#define START_BMPHIGH // Costs 399 bytes more flash - - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - - #include "_Bootscreen.h" - - #ifndef CUSTOM_BOOTSCREEN_TIMEOUT - #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 - #endif - - #endif - #if ENABLED(START_BMPHIGH) - #define START_BMPWIDTH 112 + #define START_BMPHEIGHT 38 const unsigned char start_bmp[] PROGMEM = { - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00111111,B11111111, - B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00011000,B00000000,B00011111,B11111111, - B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00001111,B11111111, - B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000111,B11111111, - B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000011,B11111111, - B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000001,B11111111, - B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000,B11111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B01111000,B00111100,B00000011,B11110000,B01111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B01111000,B00111100,B00000111,B11111100,B00111111, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B01111000,B00111100,B00001111,B11111110,B00011111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B01111000,B00111100,B00011111,B11111110,B00001111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B01111000,B00111100,B00111111,B00111111,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B01111000,B00111100,B00111110,B00011111,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B01111100,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B01111111,B10111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00111111,B10111111,B11111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00011111,B10111111,B11111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00001111,B10111111,B11111100,B00001111,B00000011, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000, - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000 - }; - + 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, + 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, + 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x3F, 0xFF, + 0xC0, 0x0F, 0xC0, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x18, 0x00, 0x1F, 0xFF, + 0xC0, 0x3F, 0xE1, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x3C, 0x00, 0x0F, 0xFF, + 0xC0, 0x7F, 0xF3, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x78, 0x3C, 0x00, 0x07, 0xFF, + 0xC0, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x78, 0x3C, 0x00, 0x03, 0xFF, + 0xC1, 0xF8, 0x7F, 0x87, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x01, 0xFF, + 0xC1, 0xF0, 0x3F, 0x03, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xFF, + 0xC1, 0xE0, 0x1E, 0x01, 0xE0, 0x1F, 0x00, 0x03, 0xE0, 0x78, 0x3C, 0x03, 0xF0, 0x7F, + 0xC1, 0xE0, 0x1E, 0x01, 0xE0, 0x7F, 0xC0, 0x0F, 0xF8, 0x78, 0x3C, 0x07, 0xFC, 0x3F, + 0xC1, 0xE0, 0x1E, 0x01, 0xE1, 0xFF, 0xE0, 0x1F, 0xFC, 0x78, 0x3C, 0x0F, 0xFE, 0x1F, + 0xC1, 0xE0, 0x1E, 0x01, 0xE3, 0xFF, 0xF0, 0x3F, 0xFE, 0x78, 0x3C, 0x1F, 0xFE, 0x0F, + 0xC1, 0xE0, 0x1E, 0x01, 0xE3, 0xF3, 0xF8, 0x3F, 0x3E, 0x78, 0x3C, 0x3F, 0x3F, 0x07, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0xE0, 0xFC, 0x7C, 0x1F, 0x78, 0x3C, 0x3E, 0x1F, 0x07, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0xC0, 0x7C, 0x7C, 0x0F, 0x78, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0x80, 0x7C, 0x78, 0x0F, 0x78, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0x80, 0x3C, 0x78, 0x00, 0x78, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0x80, 0x3C, 0x78, 0x00, 0x78, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0x80, 0x3C, 0x78, 0x00, 0x78, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0xC0, 0x3C, 0x78, 0x00, 0x78, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE3, 0xE0, 0x3C, 0x78, 0x00, 0x7C, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE3, 0xFF, 0x3F, 0xF8, 0x00, 0x7F, 0xBC, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE1, 0xFF, 0x3F, 0xF8, 0x00, 0x3F, 0xBF, 0xFC, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE0, 0xFF, 0x3F, 0xF8, 0x00, 0x1F, 0xBF, 0xFC, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE0, 0x7F, 0x3F, 0xF8, 0x00, 0x0F, 0xBF, 0xFC, 0x0F, 0x03, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, + 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, + 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, + 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, + 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80 }; #else - #define START_BMPWIDTH 56 + #define START_BMPHEIGHT 19 const unsigned char start_bmp[] PROGMEM = { - B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, - B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, - B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, - B10000011,B11001111,B00000000,B00000000,B00001100,B00110000,B00111111, - B10000111,B11111111,B10000000,B00000000,B00001100,B00110000,B00011111, - B10000110,B01111001,B10000000,B00000000,B00001100,B00000000,B00001111, - B10001100,B00110000,B11000111,B10000011,B10001100,B00110000,B11100111, - B10001100,B00110000,B11001111,B11000111,B11001100,B00110001,B11110011, - B10001100,B00110000,B11011100,B11101100,B11101100,B00110011,B10111001, - B10001100,B00110000,B11011000,B01101100,B01101100,B00110011,B00011001, - B10001100,B00110000,B11010000,B01101100,B00001100,B00110011,B00011001, - B10001100,B00110000,B11011000,B01101100,B00001100,B00110011,B00011001, - B10001100,B00110000,B11011100,B01101100,B00001110,B00111011,B00011001, - B10001100,B00110000,B11001111,B01111100,B00000111,B10011111,B00011001, - B10001100,B00110000,B11000111,B01111100,B00000011,B10001111,B00011001, - B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, - B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 - }; - + 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, + 0x83, 0xCF, 0x00, 0x00, 0x0C, 0x30, 0x3F, + 0x87, 0xFF, 0x80, 0x00, 0x0C, 0x30, 0x1F, + 0x86, 0x79, 0x80, 0x00, 0x0C, 0x00, 0x0F, + 0x8C, 0x30, 0xC7, 0x83, 0x8C, 0x30, 0xE7, + 0x8C, 0x30, 0xCF, 0xC7, 0xCC, 0x31, 0xF3, + 0x8C, 0x30, 0xDC, 0xEC, 0xEC, 0x33, 0xB9, + 0x8C, 0x30, 0xD8, 0x6C, 0x6C, 0x33, 0x19, + 0x8C, 0x30, 0xD0, 0x6C, 0x0C, 0x33, 0x19, + 0x8C, 0x30, 0xD8, 0x6C, 0x0C, 0x33, 0x19, + 0x8C, 0x30, 0xDC, 0x6C, 0x0E, 0x3B, 0x19, + 0x8C, 0x30, 0xCF, 0x7C, 0x07, 0x9F, 0x19, + 0x8C, 0x30, 0xC7, 0x7C, 0x03, 0x8F, 0x19, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, + 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8 }; #endif - - #ifndef START_BMP_BYTEWIDTH - #define START_BMP_BYTEWIDTH ((START_BMPWIDTH + 7) / 8) - #endif - #ifndef START_BMPHEIGHT - #define START_BMPHEIGHT (sizeof(start_bmp) / (START_BMP_BYTEWIDTH)) - #endif - - static_assert(sizeof(start_bmp) == (START_BMP_BYTEWIDTH) * (START_BMPHEIGHT), "Bootscreen (start_bmp) dimensions don't match data."); - #endif -#if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) +// Here comes a compile-time operation to match the extruder symbols +// on the info screen to the set number of extruders in configuration.h +// +// When only one extruder is selected, the "1" on the symbol will not +// be displayed. - // This file must define STATUS_SCREENWIDTH and status_screen[012]_bmp. - // It can also define STATUS_SCREEN_X, STATUS_SCREEN_{BED,FAN}_TEXT_X and - // STATUS_SCREEN_HOTEND_TEXT_X(i) to modify draw locations. - #include "_Statusscreen.h" +#define STATUS_SCREENWIDTH 115 // Width in pixels +#define STATUS_SCREENHEIGHT 19 // Height in pixels -#else // !CUSTOM_STATUS_SCREEN_IMAGE +#if HAS_TEMP_BED + #if HOTENDS == 0 + const unsigned char status_screen0_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x40, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x40, 0xF0, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x40, 0xF0, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x40, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x5E, 0x07, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x5F, 0x0F, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x4F, 0x0F, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x47, 0x0E, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x63, 0x0C, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00 + }; + const unsigned char status_screen1_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x5C, 0x63, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x5E, 0xF7, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x5E, 0xF7, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x5C, 0x63, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x58, 0x01, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x40, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x40, 0xF0, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x41, 0xF8, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x61, 0xF8, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00 + }; + #elif HOTENDS == 1 + const unsigned char status_screen0_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x40, 0x60, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x40, 0xF0, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x40, 0xF0, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x40, 0x60, 0x20, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x5E, 0x07, 0xA0, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x5F, 0x0F, 0xA0, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x4F, 0x0F, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x47, 0x0E, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x63, 0x0C, 0x60, + 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 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 + }; - // Can also be overridden in Configuration.h - // If you can afford it, try the 3-frame fan animation! - #ifndef FAN_ANIM_FRAMES - #define FAN_ANIM_FRAMES 2 - #endif + const unsigned char status_screen1_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x5C, 0x63, 0xA0, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x5E, 0xF7, 0xA0, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x5E, 0xF7, 0xA0, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x5C, 0x63, 0xA0, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x58, 0x01, 0xA0, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x40, 0x60, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x40, 0xF0, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x41, 0xF8, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x61, 0xF8, 0x60, + 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 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 HOTENDS == 2 + const unsigned char status_screen0_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0, + 0x7F, 0x80, 0x00, 0x3F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x40, 0x60, 0x20, + 0xFB, 0xC0, 0x00, 0x79, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x40, 0xF0, 0x20, + 0xF3, 0xC0, 0x00, 0x76, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x40, 0xF0, 0x20, + 0xEB, 0xC0, 0x00, 0x7E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x40, 0x60, 0x20, + 0x7B, 0x80, 0x00, 0x3D, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x5E, 0x07, 0xA0, + 0x7B, 0x80, 0x00, 0x3B, 0xC0, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x5F, 0x0F, 0xA0, + 0xFB, 0xC0, 0x00, 0x77, 0xE0, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x4F, 0x0F, 0x20, + 0xFB, 0xC0, 0x00, 0x70, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x47, 0x0E, 0x20, + 0xFF, 0xC0, 0x00, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x63, 0x0C, 0x60, + 0x3F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x1E, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xE0, + 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00 + }; - #if HAS_HEATED_BED + const unsigned char status_screen1_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0, + 0x7F, 0x80, 0x00, 0x3F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x5C, 0x63, 0xA0, + 0xFB, 0xC0, 0x00, 0x79, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x5E, 0xF7, 0xA0, + 0xF3, 0xC0, 0x00, 0x76, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x5E, 0xF7, 0xA0, + 0xEB, 0xC0, 0x00, 0x7E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x5C, 0x63, 0xA0, + 0x7B, 0x80, 0x00, 0x3D, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x58, 0x01, 0xA0, + 0x7B, 0x80, 0x00, 0x3B, 0xC0, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x40, 0x60, 0x20, + 0xFB, 0xC0, 0x00, 0x77, 0xE0, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x40, 0xF0, 0x20, + 0xFB, 0xC0, 0x00, 0x70, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x41, 0xF8, 0x20, + 0xFF, 0xC0, 0x00, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x61, 0xF8, 0x60, + 0x3F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x1E, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xE0, + 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00 + }; + #else + const unsigned char status_screen0_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0, + 0x7F, 0x80, 0x00, 0x3F, 0xC0, 0x00, 0x3F, 0xC0, 0x00, 0x41, 0x04, 0x00, 0x40, 0x60, 0x20, + 0xFB, 0xC0, 0x00, 0x79, 0xE0, 0x00, 0x79, 0xE0, 0x00, 0x20, 0x82, 0x00, 0x40, 0xF0, 0x20, + 0xF3, 0xC0, 0x00, 0x76, 0xE0, 0x00, 0x76, 0xE0, 0x00, 0x20, 0x82, 0x00, 0x40, 0xF0, 0x20, + 0xEB, 0xC0, 0x00, 0x7E, 0xE0, 0x00, 0x7E, 0xE0, 0x00, 0x41, 0x04, 0x00, 0x40, 0x60, 0x20, + 0x7B, 0x80, 0x00, 0x3D, 0xC0, 0x00, 0x39, 0xC0, 0x00, 0x82, 0x08, 0x00, 0x5E, 0x07, 0xA0, + 0x7B, 0x80, 0x00, 0x3B, 0xC0, 0x00, 0x3E, 0xC0, 0x01, 0x04, 0x10, 0x00, 0x5F, 0x0F, 0xA0, + 0xFB, 0xC0, 0x00, 0x77, 0xE0, 0x00, 0x76, 0xE0, 0x01, 0x04, 0x10, 0x00, 0x4F, 0x0F, 0x20, + 0xFB, 0xC0, 0x00, 0x70, 0xE0, 0x00, 0x79, 0xE0, 0x00, 0x82, 0x08, 0x00, 0x47, 0x0E, 0x20, + 0xFF, 0xC0, 0x00, 0x7F, 0xE0, 0x00, 0x7F, 0xE0, 0x00, 0x41, 0x04, 0x00, 0x63, 0x0C, 0x60, + 0x3F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x1E, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x0F, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xE0, + 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00 + }; - #define STATUS_SCREEN_X ( 8 + (HOTENDS ? 0 : 64)) - #define STATUS_SCREENWIDTH (120 - (HOTENDS ? 0 : 64)) + const unsigned char status_screen1_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0, + 0x7F, 0x80, 0x00, 0x3F, 0xC0, 0x00, 0x3F, 0xC0, 0x00, 0x41, 0x04, 0x00, 0x5C, 0x63, 0xA0, + 0xFB, 0xC0, 0x00, 0x79, 0xE0, 0x00, 0x79, 0xE0, 0x00, 0x20, 0x82, 0x00, 0x5E, 0xF7, 0xA0, + 0xF3, 0xC0, 0x00, 0x76, 0xE0, 0x00, 0x76, 0xE0, 0x00, 0x20, 0x82, 0x00, 0x5E, 0xF7, 0xA0, + 0xEB, 0xC0, 0x00, 0x7E, 0xE0, 0x00, 0x7E, 0xE0, 0x00, 0x41, 0x04, 0x00, 0x5C, 0x63, 0xA0, + 0x7B, 0x80, 0x00, 0x3D, 0xC0, 0x00, 0x39, 0xC0, 0x00, 0x82, 0x08, 0x00, 0x58, 0x01, 0xA0, + 0x7B, 0x80, 0x00, 0x3B, 0xC0, 0x00, 0x3E, 0xC0, 0x01, 0x04, 0x10, 0x00, 0x40, 0x60, 0x20, + 0xFB, 0xC0, 0x00, 0x77, 0xE0, 0x00, 0x76, 0xE0, 0x01, 0x04, 0x10, 0x00, 0x40, 0xF0, 0x20, + 0xFB, 0xC0, 0x00, 0x70, 0xE0, 0x00, 0x79, 0xE0, 0x00, 0x82, 0x08, 0x00, 0x41, 0xF8, 0x20, + 0xFF, 0xC0, 0x00, 0x7F, 0xE0, 0x00, 0x7F, 0xE0, 0x00, 0x41, 0x04, 0x00, 0x61, 0xF8, 0x60, + 0x3F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x1E, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x0F, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xE0, + 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00 + }; + #endif // HOTENDS +#else + #if HOTENDS == 0 + const unsigned char status_screen0_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + const unsigned char status_screen1_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x63, 0xA0, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0xF7, 0xA0, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0xF7, 0xA0, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x63, 0xA0, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60, + 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 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 HOTENDS == 1 + const unsigned char status_screen0_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60, + 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 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 + }; - #if HOTENDS == 0 + const unsigned char status_screen1_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x63, 0xA0, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0xF7, 0xA0, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0xF7, 0xA0, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x63, 0xA0, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20, + 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60, + 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 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 HOTENDS == 2 + const unsigned char status_screen0_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0, + 0x7F, 0x80, 0x00, 0x3F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0xFB, 0xC0, 0x00, 0x79, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0xF3, 0xC0, 0x00, 0x76, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0xEB, 0xC0, 0x00, 0x7E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0x7B, 0x80, 0x00, 0x3D, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0, + 0x7B, 0x80, 0x00, 0x3B, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0, + 0xFB, 0xC0, 0x00, 0x77, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20, + 0xFB, 0xC0, 0x00, 0x70, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20, + 0xFF, 0xC0, 0x00, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60, + 0x3F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x1E, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif + const unsigned char status_screen1_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0, + 0x7F, 0x80, 0x00, 0x3F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x63, 0xA0, + 0xFB, 0xC0, 0x00, 0x79, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0xF7, 0xA0, + 0xF3, 0xC0, 0x00, 0x76, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0xF7, 0xA0, + 0xEB, 0xC0, 0x00, 0x7E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x63, 0xA0, + 0x7B, 0x80, 0x00, 0x3D, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0, + 0x7B, 0x80, 0x00, 0x3B, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0xFB, 0xC0, 0x00, 0x77, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0xFB, 0xC0, 0x00, 0x70, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20, + 0xFF, 0xC0, 0x00, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60, + 0x3F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x1E, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + #else + const unsigned char status_screen0_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0, + 0x7F, 0x80, 0x00, 0x3F, 0xC0, 0x00, 0x3F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0xFB, 0xC0, 0x00, 0x79, 0xE0, 0x00, 0x79, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0xF3, 0xC0, 0x00, 0x76, 0xE0, 0x00, 0x76, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0xEB, 0xC0, 0x00, 0x7E, 0xE0, 0x00, 0x7E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0x7B, 0x80, 0x00, 0x3D, 0xC0, 0x00, 0x39, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0, + 0x7B, 0x80, 0x00, 0x3B, 0xC0, 0x00, 0x3E, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0, + 0xFB, 0xC0, 0x00, 0x77, 0xE0, 0x00, 0x76, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20, + 0xFB, 0xC0, 0x00, 0x70, 0xE0, 0x00, 0x79, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20, + 0xFF, 0xC0, 0x00, 0x7F, 0xE0, 0x00, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60, + 0x3F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x1E, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; - #elif HOTENDS == 1 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif - - #elif HOTENDS == 2 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif - - #else // HOTENDS > 2 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif - - #endif // HOTENDS - - #else // !HAS_HEATED_BED - - #define STATUS_SCREEN_X ( 8 + (HOTENDS ? 0 : 96)) - #define STATUS_SCREENWIDTH (120 - (HOTENDS ? 0 : 96)) - - #if HOTENDS == 0 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00000000,B11111000, - B00111001,B00000001,B00111000, - B00110111,B10000011,B11011000, - B00110111,B10000011,B11011000, - B00101111,B11000111,B11101000, - B00100111,B11000111,B11001000, - B00100001,B11111111,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100001,B11111111,B00001000, - B00100111,B11000111,B11001000, - B00101111,B11000111,B11101000, - B00110111,B10000011,B11011000, - B00110111,B10000011,B11011000, - B00111001,B00000001,B00111000, - B00111110,B00000000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00110000,B11111000, - B00111001,B11110000,B00111000, - B00110001,B11110000,B00011000, - B00110000,B11110000,B00011000, - B00100000,B11110000,B01101000, - B00100000,B00110001,B11101000, - B00100000,B00111001,B11101000, - B00100000,B01111111,B11111000, - B00111111,B11111111,B11111000, - B00111111,B11111100,B00001000, - B00101111,B00111000,B00001000, - B00101110,B00011000,B00001000, - B00101100,B00011110,B00001000, - B00110000,B00011110,B00011000, - B00110000,B00011111,B00011000, - B00111000,B00011111,B00111000, - B00111110,B00011000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00011000,B11111000, - B00111000,B00011111,B00111000, - B00110000,B00011111,B10011000, - B00110100,B00011111,B00011000, - B00101110,B00011110,B00001000, - B00101111,B00011100,B00001000, - B00101111,B10111000,B00001000, - B00111111,B11111100,B00001000, - B00111111,B11111111,B11111000, - B00100000,B01111111,B11111000, - B00100000,B00111011,B11101000, - B00100000,B01110001,B11101000, - B00100000,B11110000,B11101000, - B00110001,B11110000,B01011000, - B00110011,B11110000,B00011000, - B00111001,B11110000,B00111000, - B00111110,B00110000,B11111000, - B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111111,B11111111,B11110000, - B00111000,B00000000,B01110000, - B00110000,B11111100,B00110000, - B00100000,B11111100,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101100,B00000000,B11010000, - B00101110,B00110001,B11010000, - B00101111,B01111011,B11010000, - B00101111,B01111011,B11010000, - B00101110,B00110001,B11010000, - B00101100,B00000000,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B11111100,B00010000, - B00110000,B11111100,B00110000, - B00111000,B00000000,B01110000, - B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111111,B11111111,B11110000, - B00111000,B00000000,B01110000, - B00110001,B10000110,B00110000, - B00100011,B10000111,B00010000, - B00100111,B10000111,B10010000, - B00101111,B10000111,B11010000, - B00101111,B00000011,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101111,B00000011,B11010000, - B00101111,B10000111,B11010000, - B00100111,B10000111,B10010000, - B00100011,B10000111,B00010000, - B00110001,B10000110,B00110000, - B00111000,B00000000,B01110000, - B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000 - }; - #endif - - #elif HOTENDS == 1 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00111000,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00011110,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10111000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111011,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01110001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - #endif - - #elif HOTENDS == 2 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - #endif - - #else // HOTENDS > 2 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - #endif - - #endif // HOTENDS - - #endif // !HAS_HEATED_BED - -#endif // !CUSTOM_STATUS_SCREEN_IMAGE + const unsigned char status_screen1_bmp[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0, + 0x7F, 0x80, 0x00, 0x3F, 0xC0, 0x00, 0x3F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x63, 0xA0, + 0xFB, 0xC0, 0x00, 0x79, 0xE0, 0x00, 0x79, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x5E, 0xF7, 0xA0, + 0xF3, 0xC0, 0x00, 0x76, 0xE0, 0x00, 0x76, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x5E, 0xF7, 0xA0, + 0xEB, 0xC0, 0x00, 0x7E, 0xE0, 0x00, 0x7E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x63, 0xA0, + 0x7B, 0x80, 0x00, 0x3D, 0xC0, 0x00, 0x39, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0, + 0x7B, 0x80, 0x00, 0x3B, 0xC0, 0x00, 0x3E, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, + 0xFB, 0xC0, 0x00, 0x77, 0xE0, 0x00, 0x76, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20, + 0xFB, 0xC0, 0x00, 0x70, 0xE0, 0x00, 0x79, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20, + 0xFF, 0xC0, 0x00, 0x7F, 0xE0, 0x00, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60, + 0x3F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, + 0x1E, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, + 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + #endif // HOTENDS +#endif // HAS_TEMP_BED #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY) const unsigned char cw_bmp[] PROGMEM = { - B00000011,B11111000,B00000000, - B00001111,B11111110,B00000000, - B00011110,B00001111,B00000000, - B00111000,B00000111,B00000000, - B00111000,B00000011,B10000000, - B01110000,B00000011,B10000000, - B01110000,B00001111,B11100000, - B01110000,B00000111,B11000000, - B01110000,B00000011,B10000000, - B01110000,B00000001,B00000000, - B01110000,B00000000,B00000000, - B00111000,B00000000,B00000000, - B00111000,B00000111,B00000000, - B00011110,B00001111,B00000000, - B00001111,B11111110,B00000000, - B00000011,B11111000,B00000000 + 0x03,0xF8,0x00, // 000000111111100000000000 + 0x0F,0xF7,0x00, // 000011111111111000000000 + 0x17,0x0F,0x00, // 000111100000111100000000 + 0x38,0x07,0x00, // 001110000000011100000000 + 0x38,0x03,0x80, // 001110000000001110000000 + 0x70,0x03,0x80, // 011100000000001110000000 + 0x70,0x0F,0xE0, // 011100000000111111100000 + 0x70,0x07,0xC0, // 011100000000011111000000 + 0x70,0x03,0x80, // 011100000000001110000000 + 0x70,0x01,0x00, // 011100000000000100000000 + 0x70,0x00,0x00, // 011100000000000000000000 + 0x68,0x00,0x00, // 001110000000000000000000 + 0x38,0x07,0x00, // 001110000000011100000000 + 0x17,0x0F,0x00, // 000111100000111100000000 + 0x0F,0xFE,0x00, // 000011111111111000000000 + 0x03,0xF8,0x00 // 000000111111100000000000 }; const unsigned char ccw_bmp[] PROGMEM = { - B00000000,B11111110,B00000000, - B00000011,B11111111,B10000000, - B00000111,B10000011,B11000000, - B00001110,B00000001,B11000000, - B00001110,B00000000,B11100000, - B00011100,B00000000,B11100000, - B01111111,B00000000,B11100000, - B00111110,B00000000,B11100000, - B00011100,B00000000,B11100000, - B00001000,B00000000,B11100000, - B00000000,B00000000,B11100000, - B00000000,B00000001,B11000000, - B00001110,B00000001,B11000000, - B00001111,B00000111,B10000000, - B00000111,B11111111,B00000000, - B00000001,B11111100,B00000000 + 0x00,0xFE,0x00, // 000000001111111000000000 + 0x03,0xFF,0x80, // 000000111111111110000000 + 0x07,0x83,0xC0, // 000001111000001111000000 + 0x0E,0x01,0xC0, // 000011100000000111000000 + 0x0E,0x00,0xE0, // 000011100000000011100000 + 0x1C,0x00,0xE0, // 000111000000000011100000 + 0x7F,0x00,0xE0, // 011111110000000011100000 + 0x3E,0x00,0xE0, // 001111100000000011100000 + 0x1C,0x00,0xE0, // 000111000000000011100000 + 0x08,0x00,0xE0, // 000010000000000011100000 + 0x00,0x00,0xE0, // 000000000000000011100000 + 0x00,0x01,0xC0, // 000000000000000111000000 + 0x0E,0x01,0xC0, // 000011100000000111000000 + 0x0F,0x07,0x80, // 000011110000011110000000 + 0x07,0xFF,0x00, // 000001111111111100000000 + 0x01,0xFC,0x00 // 000000011111110000000000 }; const unsigned char up_arrow_bmp[] PROGMEM = { - B00000100,B00000000, - B00001110,B00000000, - B00011111,B00000000, - B00111111,B10000000, - B01111111,B11000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000 + 0x04,0x00, // 000001000000 + 0x0E,0x00, // 000011100000 + 0x1F,0x00, // 000111110000 + 0x3F,0x80, // 001111111000 + 0x7F,0xC0, // 011111111100 + 0x0E,0x00, // 000011100000 + 0x0E,0x00, // 000011100000 + 0x0E,0x00, // 000011100000 + 0x0E,0x00, // 000011100000 + 0x0E,0x00, // 000011100000 + 0x0E,0x00, // 000011100000 + 0x0E,0x00, // 000011100000 + 0x0E,0x00 // 000011100000 }; const unsigned char down_arrow_bmp[] PROGMEM = { - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B01111111,B11000000, - B00111111,B10000000, - B00011111,B00000000, - B00001110,B00000000, - B00000100,B00000000 + 0x0E,0x00, // 000011100000 + 0x0E,0x00, // 000011100000 + 0x0E,0x00, // 000011100000 + 0x0E,0x00, // 000011100000 + 0x0E,0x00, // 000011100000 + 0x0E,0x00, // 000011100000 + 0x0E,0x00, // 000011100000 + 0x0E,0x00, // 000011100000 + 0x7F,0xC0, // 011111111100 + 0x3F,0x80, // 001111111000 + 0x1F,0x00, // 000111110000 + 0x0E,0x00, // 000011100000 + 0x04,0x00 // 000001000000 }; const unsigned char offset_bedline_bmp[] PROGMEM = { - B11111111,B11111111,B11111111 + 0xFF,0xFF,0xFF // 111111111111111111111111 }; const unsigned char nozzle_bmp[] PROGMEM = { - B01111111,B10000000, - B11111111,B11000000, - B11111111,B11000000, - B11111111,B11000000, - B01111111,B10000000, - B01111111,B10000000, - B11111111,B11000000, - B11111111,B11000000, - B11111111,B11000000, - B00111111,B00000000, - B00011110,B00000000, - B00001100,B00000000 + 0x7F,0x80, // 0111111110000000 + 0xFF,0xC0, // 1111111111000000 + 0xFF,0xC0, // 1111111111000000 + 0xFF,0xC0, // 1111111111000000 + 0x7F,0x80, // 0111111110000000 + 0x7F,0x80, // 0111111110000000 + 0xFF,0xC0, // 1111111111000000 + 0xFF,0xC0, // 1111111111000000 + 0xFF,0xC0, // 1111111111000000 + 0x3F,0x00, // 0011111100000000 + 0x1E,0x00, // 0001111000000000 + 0x0C,0x00 // 0000110000000000 }; - #endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY - -#ifndef CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH - #define CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH ((CUSTOM_BOOTSCREEN_BMPWIDTH + 7) / 8) -#endif -#ifndef CUSTOM_BOOTSCREEN_BMPHEIGHT - #define CUSTOM_BOOTSCREEN_BMPHEIGHT (sizeof(custom_start_bmp) / (CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH)) -#endif - -#ifndef FAN_ANIM_FRAMES - #define FAN_ANIM_FRAMES 2 -#elif FAN_ANIM_FRAMES > 3 - #error "Only 3 fan animation frames currently supported." -#endif -#ifndef STATUS_SCREEN_X - #define STATUS_SCREEN_X 0 -#endif -#ifndef STATUS_SCREEN_Y - #define STATUS_SCREEN_Y 1 -#endif -#ifndef STATUS_BMP_BYTEWIDTH - #define STATUS_BMP_BYTEWIDTH ((STATUS_SCREENWIDTH + 7) / 8) -#endif -#ifndef STATUS_SCREENHEIGHT - #define STATUS_SCREENHEIGHT (sizeof(status_screen0_bmp) / (STATUS_BMP_BYTEWIDTH)) -#endif -#ifndef STATUS_SCREEN_HOTEND_TEXT_X - #define STATUS_SCREEN_HOTEND_TEXT_X(i) (5 + (i) * 25) -#endif -#ifndef STATUS_SCREEN_BED_TEXT_X - #define STATUS_SCREEN_BED_TEXT_X 81 -#endif -#ifndef STATUS_SCREEN_FAN_TEXT_X - #define STATUS_SCREEN_FAN_TEXT_X 104 -#endif -#ifndef STATUS_SCREEN_FAN_TEXT_Y - #define STATUS_SCREEN_FAN_TEXT_Y (FAN_ANIM_FRAMES > 2 ? 28 : 27) -#endif - -#define BMP_SIZE (STATUS_BMP_BYTEWIDTH) * (STATUS_SCREENHEIGHT) -static_assert(sizeof(status_screen0_bmp) == BMP_SIZE, "Status header (status_screen0_bmp) dimensions don't match data."); -#if FAN_ANIM_FRAMES > 1 - static_assert(sizeof(status_screen1_bmp) == BMP_SIZE, "Status header (status_screen1_bmp) dimensions don't match data."); - #if FAN_ANIM_FRAMES > 2 - static_assert(sizeof(status_screen2_bmp) == BMP_SIZE, "Status header (status_screen2_bmp) dimensions don't match data."); - #if FAN_ANIM_FRAMES > 3 - static_assert(sizeof(status_screen3_bmp) == BMP_SIZE, "Status header (status_screen3_bmp) dimensions don't match data."); - #endif - #endif -#endif diff --git a/Marlin/duration_t.h b/Marlin/duration_t.h index bcc3011..5e9dd1c 100644 --- a/Marlin/duration_t.h +++ b/Marlin/duration_t.h @@ -23,9 +23,6 @@ #ifndef __DURATION_T__ #define __DURATION_T__ -#include -#include - struct duration_t { /** * @brief Duration is stored in seconds @@ -154,10 +151,10 @@ struct duration_t { if (with_days) { uint16_t d = this->day(); sprintf_P(buffer, PSTR("%ud %02u:%02u"), d, h % 24, m); - return d >= 10 ? 9 : 8; + return d >= 10 ? 8 : 7; } else if (h < 100) { - sprintf_P(buffer, PSTR("%02u:%02u"), h, m); + sprintf_P(buffer, PSTR("%02u:%02u"), h % 24, m); return 5; } else { diff --git a/Marlin/endstop_interrupts.h b/Marlin/endstop_interrupts.h index 62c2ea8..6ad4fa5 100644 --- a/Marlin/endstop_interrupts.h +++ b/Marlin/endstop_interrupts.h @@ -24,7 +24,7 @@ * Endstop Interrupts * * Without endstop interrupts the endstop pins must be polled continually in - * the temperature-ISR via endstops.update(), most of the time finding no change. + * the stepper-ISR via endstops.update(), most of the time finding no change. * With this feature endstops.update() is called only when we know that at * least one endstop has changed state, saving valuable CPU cycles. * @@ -40,9 +40,6 @@ #include "macros.h" -// One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } - /** * Patch for pins_arduino.h (...\Arduino\hardware\arduino\avr\variants\mega\pins_arduino.h) * @@ -75,30 +72,40 @@ void endstop_ISR(void) { endstops.update(); } 0 ) #endif +volatile uint8_t e_hit = 0; // Different from 0 when the endstops should be tested in detail. + // Must be reset to 0 by the test function when finished. // Install Pin change interrupt for a pin. Can be called multiple times. -void pciSetup(const int8_t pin) { +void pciSetup(byte pin) { SBI(*digitalPinToPCMSK(pin), digitalPinToPCMSKbit(pin)); // enable pin SBI(PCIFR, digitalPinToPCICRbit(pin)); // clear any outstanding interrupt SBI(PCICR, digitalPinToPCICRbit(pin)); // enable interrupt for the group } +// This is what is really done inside the interrupts. +FORCE_INLINE void endstop_ISR_worker( void ) { + e_hit = 2; // Because the detection of a e-stop hit has a 1 step debouncer it has to be called at least twice. +} + +// Use one Routine to handle each group +// One ISR for all EXT-Interrupts +void endstop_ISR(void) { endstop_ISR_worker(); } // Handlers for pin change interrupts #ifdef PCINT0_vect - ISR(PCINT0_vect) { endstop_ISR(); } + ISR(PCINT0_vect) { endstop_ISR_worker(); } #endif #ifdef PCINT1_vect - ISR(PCINT1_vect) { endstop_ISR(); } + ISR(PCINT1_vect) { endstop_ISR_worker(); } #endif #ifdef PCINT2_vect - ISR(PCINT2_vect) { endstop_ISR(); } + ISR(PCINT2_vect) { endstop_ISR_worker(); } #endif #ifdef PCINT3_vect - ISR(PCINT3_vect) { endstop_ISR(); } + ISR(PCINT3_vect) { endstop_ISR_worker(); } #endif void setup_endstop_interrupts( void ) { diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp index 38662d8..1b1cab0 100644 --- a/Marlin/endstops.cpp +++ b/Marlin/endstops.cpp @@ -31,39 +31,28 @@ #include "stepper.h" #include "ultralcd.h" -#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - #include "endstop_interrupts.h" -#endif +// TEST_ENDSTOP: test the old and the current status of an endstop +#define TEST_ENDSTOP(ENDSTOP) (TEST(current_endstop_bits & old_endstop_bits, ENDSTOP)) Endstops endstops; // public: bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load() -volatile uint8_t Endstops::hit_state; +volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value -Endstops::esbits_t Endstops::live_state = 0; - -#if ENABLED(ENDSTOP_NOISE_FILTER) - Endstops::esbits_t Endstops::validated_live_state; - uint8_t Endstops::endstop_poll_count; +#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) + uint16_t +#else + byte #endif + Endstops::current_endstop_bits = 0, + Endstops::old_endstop_bits = 0; #if HAS_BED_PROBE volatile bool Endstops::z_probe_enabled = false; #endif -// Initialized by settings.load() -#if ENABLED(X_DUAL_ENDSTOPS) - float Endstops::x_endstop_adj; -#endif -#if ENABLED(Y_DUAL_ENDSTOPS) - float Endstops::y_endstop_adj; -#endif -#if ENABLED(Z_DUAL_ENDSTOPS) - float Endstops::z_endstop_adj; -#endif - /** * Class and Instance Methods */ @@ -174,93 +163,10 @@ void Endstops::init() { #endif #endif - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - setup_endstop_interrupts(); - #endif - - // Enable endstops - enable_globally( - #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) - true - #else - false - #endif - ); - } // Endstops::init -// Called at ~1KHz from Temperature ISR: Poll endstop state if required -void Endstops::poll() { - - #if ENABLED(PINS_DEBUGGING) - run_monitor(); // report changes in endstop status - #endif - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && ENABLED(ENDSTOP_NOISE_FILTER) - if (endstop_poll_count) update(); - #elif DISABLED(ENDSTOP_INTERRUPTS_FEATURE) || ENABLED(ENDSTOP_NOISE_FILTER) - update(); - #endif -} - -void Endstops::enable_globally(const bool onoff) { - enabled_globally = enabled = onoff; - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #endif -} - -// Enable / disable endstop checking -void Endstops::enable(const bool onoff) { - enabled = onoff; - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #endif -} - -// Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable -void Endstops::not_homing() { - enabled = enabled_globally; - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #endif -} - -#if ENABLED(VALIDATE_HOMING_ENDSTOPS) - // If the last move failed to trigger an endstop, call kill - void Endstops::validate_homing_move() { - if (trigger_state()) hit_on_purpose(); - else kill(PSTR(MSG_ERR_HOMING_FAILED)); - } -#endif - -// Enable / disable endstop z-probe checking -#if HAS_BED_PROBE - void Endstops::enable_z_probe(const bool onoff) { - z_probe_enabled = onoff; - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #endif - } -#endif - -#if ENABLED(PINS_DEBUGGING) - void Endstops::run_monitor() { - if (!monitor_flag) return; - static uint8_t monitor_count = 16; // offset this check from the others - monitor_count += _BV(1); // 15 Hz - monitor_count &= 0x7F; - if (!monitor_count) monitor(); // report changes in endstop status - } -#endif - -void Endstops::event_handler() { - static uint8_t prev_hit_state; // = 0 - if (hit_state && hit_state != prev_hit_state) { +void Endstops::report_state() { + if (endstop_hit_bits) { #if ENABLED(ULTRA_LCD) char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' '; #define _SET_STOP_CHAR(A,C) (chr## A = C) @@ -269,11 +175,11 @@ void Endstops::event_handler() { #endif #define _ENDSTOP_HIT_ECHO(A,C) do{ \ - SERIAL_ECHOPAIR(" " STRINGIFY(A) ":", planner.triggered_position_mm(_AXIS(A))); \ + SERIAL_ECHOPAIR(" " STRINGIFY(A) ":", stepper.triggered_position_mm(A ##_AXIS)); \ _SET_STOP_CHAR(A,C); }while(0) #define _ENDSTOP_HIT_TEST(A,C) \ - if (TEST(hit_state, A ##_MIN) || TEST(hit_state, A ##_MAX)) \ + if (TEST(endstop_hit_bits, A ##_MIN) || TEST(endstop_hit_bits, A ##_MAX)) \ _ENDSTOP_HIT_ECHO(A,C) #define ENDSTOP_HIT_TEST_X() _ENDSTOP_HIT_TEST(X,'X') @@ -288,7 +194,7 @@ void Endstops::event_handler() { #if ENABLED(Z_MIN_PROBE_ENDSTOP) #define P_AXIS Z_AXIS - if (TEST(hit_state, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P'); + if (TEST(endstop_hit_bits, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P'); #endif SERIAL_EOL(); @@ -296,8 +202,10 @@ void Endstops::event_handler() { lcd_status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP); #endif + hit_on_purpose(); + #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && ENABLED(SDSUPPORT) - if (planner.abort_on_endstop_hit) { + if (stepper.abort_on_endstop_hit) { card.sdprinting = false; card.closefile(); quickstop_stepper(); @@ -305,19 +213,14 @@ void Endstops::event_handler() { } #endif } - prev_hit_state = hit_state; } // Endstops::report_state -static void print_es_state(const bool is_hit, const char * const label=NULL) { - if (label) serialprintPGM(label); - SERIAL_PROTOCOLPGM(": "); - serialprintPGM(is_hit ? PSTR(MSG_ENDSTOP_HIT) : PSTR(MSG_ENDSTOP_OPEN)); - SERIAL_EOL(); -} - -void _O2 Endstops::M119() { +void Endstops::M119() { SERIAL_PROTOCOLLNPGM(MSG_M119_REPORT); - #define ES_REPORT(S) print_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING, PSTR(MSG_##S)) + #define ES_REPORT(AXIS) do{ \ + SERIAL_PROTOCOLPGM(MSG_##AXIS); \ + SERIAL_PROTOCOLLN(((READ(AXIS##_PIN)^AXIS##_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); \ + }while(0) #if HAS_X_MIN ES_REPORT(X_MIN); #endif @@ -355,61 +258,152 @@ void _O2 Endstops::M119() { ES_REPORT(Z2_MAX); #endif #if ENABLED(Z_MIN_PROBE_ENDSTOP) - print_es_state(READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING, PSTR(MSG_Z_PROBE)); + SERIAL_PROTOCOLPGM(MSG_Z_PROBE); + SERIAL_PROTOCOLLN(((READ(Z_MIN_PROBE_PIN)^Z_MIN_PROBE_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #if NUM_RUNOUT_SENSORS == 1 - print_es_state(READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_INVERTING, PSTR(MSG_FILAMENT_RUNOUT_SENSOR)); - #else - for (uint8_t i = 1; i <= NUM_RUNOUT_SENSORS; i++) { - pin_t pin; - switch (i) { - default: continue; - case 1: pin = FIL_RUNOUT_PIN; break; - case 2: pin = FIL_RUNOUT2_PIN; break; - #if NUM_RUNOUT_SENSORS > 2 - case 3: pin = FIL_RUNOUT3_PIN; break; - #if NUM_RUNOUT_SENSORS > 3 - case 4: pin = FIL_RUNOUT4_PIN; break; - #if NUM_RUNOUT_SENSORS > 4 - case 5: pin = FIL_RUNOUT5_PIN; break; - #endif - #endif - #endif - } - SERIAL_PROTOCOLPGM(MSG_FILAMENT_RUNOUT_SENSOR); - if (i > 1) { SERIAL_CHAR(' '); SERIAL_CHAR('0' + i); } - print_es_state(digitalRead(pin) != FIL_RUNOUT_INVERTING); - } - #endif + SERIAL_PROTOCOLPGM(MSG_FILAMENT_RUNOUT_SENSOR); + SERIAL_PROTOCOLLN(((READ(FIL_RUNOUT_PIN)^FIL_RUNOUT_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); #endif } // Endstops::M119 -// The following routines are called from an ISR context. It could be the temperature ISR, the -// endstop ISR or the Stepper ISR. +#if ENABLED(X_DUAL_ENDSTOPS) + void Endstops::test_dual_x_endstops(const EndstopEnum es1, const EndstopEnum es2) { + byte x_test = TEST_ENDSTOP(es1) | (TEST_ENDSTOP(es2) << 1); // bit 0 for X, bit 1 for X2 + if (x_test && stepper.current_block->steps[X_AXIS] > 0) { + SBI(endstop_hit_bits, X_MIN); + if (!stepper.performing_homing || (x_test == 0x3)) //if not performing home or if both endstops were trigged during homing... + stepper.kill_current_block(); + } + } +#endif +#if ENABLED(Y_DUAL_ENDSTOPS) + void Endstops::test_dual_y_endstops(const EndstopEnum es1, const EndstopEnum es2) { + byte y_test = TEST_ENDSTOP(es1) | (TEST_ENDSTOP(es2) << 1); // bit 0 for Y, bit 1 for Y2 + if (y_test && stepper.current_block->steps[Y_AXIS] > 0) { + SBI(endstop_hit_bits, Y_MIN); + if (!stepper.performing_homing || (y_test == 0x3)) //if not performing home or if both endstops were trigged during homing... + stepper.kill_current_block(); + } + } +#endif +#if ENABLED(Z_DUAL_ENDSTOPS) + void Endstops::test_dual_z_endstops(const EndstopEnum es1, const EndstopEnum es2) { + byte z_test = TEST_ENDSTOP(es1) | (TEST_ENDSTOP(es2) << 1); // bit 0 for Z, bit 1 for Z2 + if (z_test && stepper.current_block->steps[Z_AXIS] > 0) { + SBI(endstop_hit_bits, Z_MIN); + if (!stepper.performing_homing || (z_test == 0x3)) //if not performing home or if both endstops were trigged during homing... + stepper.kill_current_block(); + } + } +#endif -#define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX -#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN -#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING - -// Check endstops - Could be called from Temperature ISR! +// Check endstops - Called from ISR! void Endstops::update() { - #if DISABLED(ENDSTOP_NOISE_FILTER) - if (!abort_enabled()) return; - #endif + #define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX + #define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN + #define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING + #define _ENDSTOP_HIT(AXIS, MINMAX) SBI(endstop_hit_bits, _ENDSTOP(AXIS, MINMAX)) - #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT_TO(live_state, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX))) - #define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT)) + // UPDATE_ENDSTOP_BIT: set the current endstop bits for an endstop to its status + #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX))) + // COPY_BIT: copy the value of SRC_BIT to DST_BIT in DST + #define COPY_BIT(DST, SRC_BIT, DST_BIT) SET_BIT(DST, DST_BIT, TEST(DST, SRC_BIT)) + + #define UPDATE_ENDSTOP(AXIS,MINMAX) do { \ + UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \ + if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX)) && stepper.current_block->steps[_AXIS(AXIS)] > 0) { \ + _ENDSTOP_HIT(AXIS, MINMAX); \ + stepper.endstop_triggered(_AXIS(AXIS)); \ + } \ + }while(0) #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ) // If G38 command is active check Z_MIN_PROBE for ALL movement - if (G38_move) UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); + if (G38_move) { + UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); + if (TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE))) { + if (stepper.current_block->steps[_AXIS(X)] > 0) { _ENDSTOP_HIT(X, MIN); stepper.endstop_triggered(_AXIS(X)); } + else if (stepper.current_block->steps[_AXIS(Y)] > 0) { _ENDSTOP_HIT(Y, MIN); stepper.endstop_triggered(_AXIS(Y)); } + else if (stepper.current_block->steps[_AXIS(Z)] > 0) { _ENDSTOP_HIT(Z, MIN); stepper.endstop_triggered(_AXIS(Z)); } + G38_endstop_hit = true; + } + } + #endif + + /** + * Define conditions for checking endstops + */ + + #if IS_CORE + #define S_(N) stepper.current_block->steps[CORE_AXIS_##N] + #define D_(N) stepper.motor_direction(CORE_AXIS_##N) + #endif + + #if CORE_IS_XY || CORE_IS_XZ + /** + * Head direction in -X axis for CoreXY and CoreXZ bots. + * + * If steps differ, both axes are moving. + * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z, handled below) + * If DeltaA == DeltaB, the movement is only in the 1st axis (X) + */ + #if ENABLED(COREXY) || ENABLED(COREXZ) + #define X_CMP == + #else + #define X_CMP != + #endif + #define X_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) X_CMP D_(2)) ) + #define X_AXIS_HEAD X_HEAD + #else + #define X_MOVE_TEST stepper.current_block->steps[X_AXIS] > 0 + #define X_AXIS_HEAD X_AXIS + #endif + + #if CORE_IS_XY || CORE_IS_YZ + /** + * Head direction in -Y axis for CoreXY / CoreYZ bots. + * + * If steps differ, both axes are moving + * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y) + * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z) + */ + #if ENABLED(COREYX) || ENABLED(COREYZ) + #define Y_CMP == + #else + #define Y_CMP != + #endif + #define Y_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) Y_CMP D_(2)) ) + #define Y_AXIS_HEAD Y_HEAD + #else + #define Y_MOVE_TEST stepper.current_block->steps[Y_AXIS] > 0 + #define Y_AXIS_HEAD Y_AXIS + #endif + + #if CORE_IS_XZ || CORE_IS_YZ + /** + * Head direction in -Z axis for CoreXZ or CoreYZ bots. + * + * If steps differ, both axes are moving + * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y, already handled above) + * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Z) + */ + #if ENABLED(COREZX) || ENABLED(COREZY) + #define Z_CMP == + #else + #define Z_CMP != + #endif + #define Z_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) Z_CMP D_(2)) ) + #define Z_AXIS_HEAD Z_HEAD + #else + #define Z_MOVE_TEST stepper.current_block->steps[Z_AXIS] > 0 + #define Z_AXIS_HEAD Z_AXIS #endif // With Dual X, endstops are only checked in the homing direction for the active extruder #if ENABLED(DUAL_X_CARRIAGE) - #define E0_ACTIVE stepper.movement_extruder() == 0 + #define E0_ACTIVE stepper.current_block->active_extruder == 0 #define X_MIN_TEST ((X_HOME_DIR < 0 && E0_ACTIVE) || (X2_HOME_DIR < 0 && !E0_ACTIVE)) #define X_MAX_TEST ((X_HOME_DIR > 0 && E0_ACTIVE) || (X2_HOME_DIR > 0 && !E0_ACTIVE)) #else @@ -417,358 +411,124 @@ void Endstops::update() { #define X_MAX_TEST true #endif - // Use HEAD for core axes, AXIS for others - #if CORE_IS_XY || CORE_IS_XZ - #define X_AXIS_HEAD X_HEAD - #else - #define X_AXIS_HEAD X_AXIS - #endif - #if CORE_IS_XY || CORE_IS_YZ - #define Y_AXIS_HEAD Y_HEAD - #else - #define Y_AXIS_HEAD Y_AXIS - #endif - #if CORE_IS_XZ || CORE_IS_YZ - #define Z_AXIS_HEAD Z_HEAD - #else - #define Z_AXIS_HEAD Z_AXIS - #endif - /** - * Check and update endstops + * Check and update endstops according to conditions */ - #if HAS_X_MIN - #if ENABLED(X_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(X, MIN); - #if HAS_X2_MIN - UPDATE_ENDSTOP_BIT(X2, MIN); - #else - COPY_LIVE_STATE(X_MIN, X2_MIN); - #endif - #else - UPDATE_ENDSTOP_BIT(X, MIN); - #endif - #endif - - #if HAS_X_MAX - #if ENABLED(X_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(X, MAX); - #if HAS_X2_MAX - UPDATE_ENDSTOP_BIT(X2, MAX); - #else - COPY_LIVE_STATE(X_MAX, X2_MAX); - #endif - #else - UPDATE_ENDSTOP_BIT(X, MAX); - #endif - #endif - - #if HAS_Y_MIN - #if ENABLED(Y_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Y, MIN); - #if HAS_Y2_MIN - UPDATE_ENDSTOP_BIT(Y2, MIN); - #else - COPY_LIVE_STATE(Y_MIN, Y2_MIN); - #endif - #else - UPDATE_ENDSTOP_BIT(Y, MIN); - #endif - #endif - - #if HAS_Y_MAX - #if ENABLED(Y_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Y, MAX); - #if HAS_Y2_MAX - UPDATE_ENDSTOP_BIT(Y2, MAX); - #else - COPY_LIVE_STATE(Y_MAX, Y2_MAX); - #endif - #else - UPDATE_ENDSTOP_BIT(Y, MAX); - #endif - #endif - - #if HAS_Z_MIN - #if ENABLED(Z_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Z, MIN); - #if HAS_Z2_MIN - UPDATE_ENDSTOP_BIT(Z2, MIN); - #else - COPY_LIVE_STATE(Z_MIN, Z2_MIN); - #endif - #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - UPDATE_ENDSTOP_BIT(Z, MIN); - #elif Z_HOME_DIR < 0 - UPDATE_ENDSTOP_BIT(Z, MIN); - #endif - #endif - - // When closing the gap check the enabled probe - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); - #endif - - #if HAS_Z_MAX - // Check both Z dual endstops - #if ENABLED(Z_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Z, MAX); - #if HAS_Z2_MAX - UPDATE_ENDSTOP_BIT(Z2, MAX); - #else - COPY_LIVE_STATE(Z_MAX, Z2_MAX); - #endif - #elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN - // If this pin isn't the bed probe it's the Z endstop - UPDATE_ENDSTOP_BIT(Z, MAX); - #endif - #endif - - #if ENABLED(ENDSTOP_NOISE_FILTER) - /** - * Filtering out noise on endstops requires a delayed decision. Let's assume, due to noise, - * that 50% of endstop signal samples are good and 50% are bad (assuming normal distribution - * of random noise). Then the first sample has a 50% chance to be good or bad. The 2nd sample - * also has a 50% chance to be good or bad. The chances of 2 samples both being bad becomes - * 50% of 50%, or 25%. That was the previous implementation of Marlin endstop handling. It - * reduces chances of bad readings in half, at the cost of 1 extra sample period, but chances - * still exist. The only way to reduce them further is to increase the number of samples. - * To reduce the chance to 1% (1/128th) requires 7 samples (adding 7ms of delay). - */ - static esbits_t old_live_state; - if (old_live_state != live_state) { - endstop_poll_count = 2; - old_live_state = live_state; - } - else if (endstop_poll_count && !--endstop_poll_count) - validated_live_state = live_state; - - if (!abort_enabled()) return; - - #endif - - // Test the current status of an endstop - #define TEST_ENDSTOP(ENDSTOP) (TEST(state(), ENDSTOP)) - - // Record endstop was hit - #define _ENDSTOP_HIT(AXIS, MINMAX) SBI(hit_state, _ENDSTOP(AXIS, MINMAX)) - - // Call the endstop triggered routine for single endstops - #define PROCESS_ENDSTOP(AXIS,MINMAX) do { \ - if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX))) { \ - _ENDSTOP_HIT(AXIS, MINMAX); \ - planner.endstop_triggered(_AXIS(AXIS)); \ - } \ - }while(0) - - // Call the endstop triggered routine for dual endstops - #define PROCESS_DUAL_ENDSTOP(AXIS1, AXIS2, MINMAX) do { \ - const byte dual_hit = TEST_ENDSTOP(_ENDSTOP(AXIS1, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(AXIS2, MINMAX)) << 1); \ - if (dual_hit) { \ - _ENDSTOP_HIT(AXIS1, MINMAX); \ - /* if not performing home or if both endstops were trigged during homing... */ \ - if (!stepper.homing_dual_axis || dual_hit == 0b11) \ - planner.endstop_triggered(_AXIS(AXIS1)); \ - } \ - }while(0) - - #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ) - // If G38 command is active check Z_MIN_PROBE for ALL movement - if (G38_move) { - if (TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE))) { - if (stepper.axis_is_moving(X_AXIS)) { _ENDSTOP_HIT(X, MIN); planner.endstop_triggered(X_AXIS); } - else if (stepper.axis_is_moving(Y_AXIS)) { _ENDSTOP_HIT(Y, MIN); planner.endstop_triggered(Y_AXIS); } - else if (stepper.axis_is_moving(Z_AXIS)) { _ENDSTOP_HIT(Z, MIN); planner.endstop_triggered(Z_AXIS); } - G38_endstop_hit = true; - } - } - #endif - - // Now, we must signal, after validation, if an endstop limit is pressed or not - if (stepper.axis_is_moving(X_AXIS)) { + if (X_MOVE_TEST) { if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction #if HAS_X_MIN #if ENABLED(X_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(X, X2, MIN); + UPDATE_ENDSTOP_BIT(X, MIN); + #if HAS_X2_MIN + UPDATE_ENDSTOP_BIT(X2, MIN); + #else + COPY_BIT(current_endstop_bits, X_MIN, X2_MIN); + #endif + test_dual_x_endstops(X_MIN, X2_MIN); #else - if (X_MIN_TEST) PROCESS_ENDSTOP(X, MIN); + if (X_MIN_TEST) UPDATE_ENDSTOP(X, MIN); #endif #endif } else { // +direction #if HAS_X_MAX #if ENABLED(X_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(X, X2, MAX); + UPDATE_ENDSTOP_BIT(X, MAX); + #if HAS_X2_MAX + UPDATE_ENDSTOP_BIT(X2, MAX); + #else + COPY_BIT(current_endstop_bits, X_MAX, X2_MAX); + #endif + test_dual_x_endstops(X_MAX, X2_MAX); #else - if (X_MAX_TEST) PROCESS_ENDSTOP(X, MAX); + if (X_MIN_TEST) UPDATE_ENDSTOP(X, MAX); #endif + #endif } } - if (stepper.axis_is_moving(Y_AXIS)) { + if (Y_MOVE_TEST) { if (stepper.motor_direction(Y_AXIS_HEAD)) { // -direction #if HAS_Y_MIN #if ENABLED(Y_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Y, Y2, MIN); + UPDATE_ENDSTOP_BIT(Y, MIN); + #if HAS_Y2_MIN + UPDATE_ENDSTOP_BIT(Y2, MIN); + #else + COPY_BIT(current_endstop_bits, Y_MIN, Y2_MIN); + #endif + test_dual_y_endstops(Y_MIN, Y2_MIN); #else - PROCESS_ENDSTOP(Y, MIN); + UPDATE_ENDSTOP(Y, MIN); #endif #endif } else { // +direction #if HAS_Y_MAX #if ENABLED(Y_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Y, Y2, MAX); + UPDATE_ENDSTOP_BIT(Y, MAX); + #if HAS_Y2_MAX + UPDATE_ENDSTOP_BIT(Y2, MAX); + #else + COPY_BIT(current_endstop_bits, Y_MAX, Y2_MAX); + #endif + test_dual_y_endstops(Y_MAX, Y2_MAX); #else - PROCESS_ENDSTOP(Y, MAX); + UPDATE_ENDSTOP(Y, MAX); #endif #endif } } - if (stepper.axis_is_moving(Z_AXIS)) { + if (Z_MOVE_TEST) { if (stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up. #if HAS_Z_MIN #if ENABLED(Z_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Z, Z2, MIN); + UPDATE_ENDSTOP_BIT(Z, MIN); + #if HAS_Z2_MIN + UPDATE_ENDSTOP_BIT(Z2, MIN); + #else + COPY_BIT(current_endstop_bits, Z_MIN, Z2_MIN); + #endif + test_dual_z_endstops(Z_MIN, Z2_MIN); #else #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN); - #elif ENABLED(Z_MIN_PROBE_ENDSTOP) - if (!z_probe_enabled) PROCESS_ENDSTOP(Z, MIN); + if (z_probe_enabled) UPDATE_ENDSTOP(Z, MIN); #else - PROCESS_ENDSTOP(Z, MIN); + UPDATE_ENDSTOP(Z, MIN); #endif #endif #endif // When closing the gap check the enabled probe #if ENABLED(Z_MIN_PROBE_ENDSTOP) - if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN_PROBE); + if (z_probe_enabled) { + UPDATE_ENDSTOP(Z, MIN_PROBE); + if (TEST_ENDSTOP(Z_MIN_PROBE)) SBI(endstop_hit_bits, Z_MIN_PROBE); + } #endif } else { // Z +direction. Gantry up, bed down. #if HAS_Z_MAX + // Check both Z dual endstops #if ENABLED(Z_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Z, Z2, MAX); + UPDATE_ENDSTOP_BIT(Z, MAX); + #if HAS_Z2_MAX + UPDATE_ENDSTOP_BIT(Z2, MAX); + #else + COPY_BIT(current_endstop_bits, Z_MAX, Z2_MAX); + #endif + test_dual_z_endstops(Z_MAX, Z2_MAX); + // If this pin is not hijacked for the bed probe + // then it belongs to the Z endstop #elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN - // If this pin is not hijacked for the bed probe - // then it belongs to the Z endstop - PROCESS_ENDSTOP(Z, MAX); + UPDATE_ENDSTOP(Z, MAX); #endif #endif } } + + old_endstop_bits = current_endstop_bits; + } // Endstops::update() - -#if ENABLED(PINS_DEBUGGING) - - bool Endstops::monitor_flag = false; - - /** - * monitors endstops & Z probe for changes - * - * If a change is detected then the LED is toggled and - * a message is sent out the serial port - * - * Yes, we could miss a rapid back & forth change but - * that won't matter because this is all manual. - * - */ - void Endstops::monitor() { - - static uint16_t old_live_state_local = 0; - static uint8_t local_LED_status = 0; - uint16_t live_state_local = 0; - - #if HAS_X_MIN - if (READ(X_MIN_PIN)) SBI(live_state_local, X_MIN); - #endif - #if HAS_X_MAX - if (READ(X_MAX_PIN)) SBI(live_state_local, X_MAX); - #endif - #if HAS_Y_MIN - if (READ(Y_MIN_PIN)) SBI(live_state_local, Y_MIN); - #endif - #if HAS_Y_MAX - if (READ(Y_MAX_PIN)) SBI(live_state_local, Y_MAX); - #endif - #if HAS_Z_MIN - if (READ(Z_MIN_PIN)) SBI(live_state_local, Z_MIN); - #endif - #if HAS_Z_MAX - if (READ(Z_MAX_PIN)) SBI(live_state_local, Z_MAX); - #endif - #if HAS_Z_MIN_PROBE_PIN - if (READ(Z_MIN_PROBE_PIN)) SBI(live_state_local, Z_MIN_PROBE); - #endif - #if HAS_X2_MIN - if (READ(X2_MIN_PIN)) SBI(live_state_local, X2_MIN); - #endif - #if HAS_X2_MAX - if (READ(X2_MAX_PIN)) SBI(live_state_local, X2_MAX); - #endif - #if HAS_Y2_MIN - if (READ(Y2_MIN_PIN)) SBI(live_state_local, Y2_MIN); - #endif - #if HAS_Y2_MAX - if (READ(Y2_MAX_PIN)) SBI(live_state_local, Y2_MAX); - #endif - #if HAS_Z2_MIN - if (READ(Z2_MIN_PIN)) SBI(live_state_local, Z2_MIN); - #endif - #if HAS_Z2_MAX - if (READ(Z2_MAX_PIN)) SBI(live_state_local, Z2_MAX); - #endif - - uint16_t endstop_change = live_state_local ^ old_live_state_local; - - if (endstop_change) { - #if HAS_X_MIN - if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR(" X_MIN:", TEST(live_state_local, X_MIN)); - #endif - #if HAS_X_MAX - if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR(" X_MAX:", TEST(live_state_local, X_MAX)); - #endif - #if HAS_Y_MIN - if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR(" Y_MIN:", TEST(live_state_local, Y_MIN)); - #endif - #if HAS_Y_MAX - if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR(" Y_MAX:", TEST(live_state_local, Y_MAX)); - #endif - #if HAS_Z_MIN - if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR(" Z_MIN:", TEST(live_state_local, Z_MIN)); - #endif - #if HAS_Z_MAX - if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR(" Z_MAX:", TEST(live_state_local, Z_MAX)); - #endif - #if HAS_Z_MIN_PROBE_PIN - if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR(" PROBE:", TEST(live_state_local, Z_MIN_PROBE)); - #endif - #if HAS_X2_MIN - if (TEST(endstop_change, X2_MIN)) SERIAL_PROTOCOLPAIR(" X2_MIN:", TEST(live_state_local, X2_MIN)); - #endif - #if HAS_X2_MAX - if (TEST(endstop_change, X2_MAX)) SERIAL_PROTOCOLPAIR(" X2_MAX:", TEST(live_state_local, X2_MAX)); - #endif - #if HAS_Y2_MIN - if (TEST(endstop_change, Y2_MIN)) SERIAL_PROTOCOLPAIR(" Y2_MIN:", TEST(live_state_local, Y2_MIN)); - #endif - #if HAS_Y2_MAX - if (TEST(endstop_change, Y2_MAX)) SERIAL_PROTOCOLPAIR(" Y2_MAX:", TEST(live_state_local, Y2_MAX)); - #endif - #if HAS_Z2_MIN - if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR(" Z2_MIN:", TEST(live_state_local, Z2_MIN)); - #endif - #if HAS_Z2_MAX - if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR(" Z2_MAX:", TEST(live_state_local, Z2_MAX)); - #endif - SERIAL_PROTOCOLPGM("\n\n"); - analogWrite(LED_PIN, local_LED_status); - local_LED_status ^= 255; - old_live_state_local = live_state_local; - } - } - -#endif // PINS_DEBUGGING diff --git a/Marlin/endstops.h b/Marlin/endstops.h index 2114e23..e60132d 100644 --- a/Marlin/endstops.h +++ b/Marlin/endstops.h @@ -21,115 +21,53 @@ */ /** - * endstops.h - manages endstops + * endstops.h - manages endstops */ -#ifndef __ENDSTOPS_H__ -#define __ENDSTOPS_H__ +#ifndef ENDSTOPS_H +#define ENDSTOPS_H +#include "enum.h" #include "MarlinConfig.h" -#define VALIDATE_HOMING_ENDSTOPS - -enum EndstopEnum : char { - X_MIN, - Y_MIN, - Z_MIN, - Z_MIN_PROBE, - X_MAX, - Y_MAX, - Z_MAX, - X2_MIN, - X2_MAX, - Y2_MIN, - Y2_MAX, - Z2_MIN, - Z2_MAX -}; - class Endstops { public: static bool enabled, enabled_globally; + static volatile char endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - typedef uint16_t esbits_t; - #if ENABLED(X_DUAL_ENDSTOPS) - static float x_endstop_adj; - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - static float y_endstop_adj; - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - static float z_endstop_adj; - #endif + static uint16_t #else - typedef uint8_t esbits_t; + static byte #endif + current_endstop_bits, old_endstop_bits; - private: - static esbits_t live_state; - static volatile uint8_t hit_state; // Use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT index - - #if ENABLED(ENDSTOP_NOISE_FILTER) - static esbits_t validated_live_state; - static uint8_t endstop_poll_count; // Countdown from threshold for polling - #endif - - public: - Endstops() {}; + Endstops() { + enable_globally( + #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) + true + #else + false + #endif + ); + }; /** * Initialize the endstop pins */ - static void init(); + void init(); /** - * Are endstops or the probe set to abort the move? - */ - FORCE_INLINE static bool abort_enabled() { - return (enabled - #if HAS_BED_PROBE - || z_probe_enabled - #endif - ); - } - - /** - * Periodic call to poll endstops if required. Called from temperature ISR - */ - static void poll(); - - /** - * Update endstops bits from the pins. Apply filtering to get a verified state. - * If abort_enabled() and moving towards a triggered switch, abort the current move. - * Called from ISR contexts. + * Update the endstops bits from the pins */ static void update(); /** - * Get Endstop hit state. + * Print an error message reporting the position when the endstops were last hit. */ - FORCE_INLINE static uint8_t trigger_state() { return hit_state; } - - /** - * Get current endstops state - */ - FORCE_INLINE static esbits_t state() { - return - #if ENABLED(ENDSTOP_NOISE_FILTER) - validated_live_state - #else - live_state - #endif - ; - } - - /** - * Report endstop hits to serial. Called from loop(). - */ - static void event_handler(); + static void report_state(); //call from somewhere to create an serial error message with the locations the endstops where hit, in case they were triggered /** * Report endstop positions in response to M119 @@ -137,38 +75,43 @@ class Endstops { static void M119(); // Enable / disable endstop checking globally - static void enable_globally(const bool onoff=true); + static void enable_globally(bool onoff=true) { enabled_globally = enabled = onoff; } // Enable / disable endstop checking - static void enable(const bool onoff=true); + static void enable(bool onoff=true) { enabled = onoff; } // Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable - static void not_homing(); - - #if ENABLED(VALIDATE_HOMING_ENDSTOPS) - // If the last move failed to trigger an endstop, call kill - static void validate_homing_move(); - #else - FORCE_INLINE static void validate_homing_move() { hit_on_purpose(); } - #endif + static void not_homing() { enabled = enabled_globally; } // Clear endstops (i.e., they were hit intentionally) to suppress the report - FORCE_INLINE static void hit_on_purpose() { hit_state = 0; } + static void hit_on_purpose() { endstop_hit_bits = 0; } // Enable / disable endstop z-probe checking #if HAS_BED_PROBE static volatile bool z_probe_enabled; - static void enable_z_probe(const bool onoff=true); + static void enable_z_probe(bool onoff=true) { z_probe_enabled = onoff; } #endif - // Debugging of endstops - #if ENABLED(PINS_DEBUGGING) - static bool monitor_flag; - static void monitor(); - static void run_monitor(); + private: + + #if ENABLED(X_DUAL_ENDSTOPS) + static void test_dual_x_endstops(const EndstopEnum es1, const EndstopEnum es2); + #endif + #if ENABLED(Y_DUAL_ENDSTOPS) + static void test_dual_y_endstops(const EndstopEnum es1, const EndstopEnum es2); + #endif + #if ENABLED(Z_DUAL_ENDSTOPS) + static void test_dual_z_endstops(const EndstopEnum es1, const EndstopEnum es2); #endif }; extern Endstops endstops; -#endif // __ENDSTOPS_H__ +#if HAS_BED_PROBE + #define ENDSTOPS_ENABLED (endstops.enabled || endstops.z_probe_enabled) +#else + #define ENDSTOPS_ENABLED endstops.enabled +#endif + + +#endif // ENDSTOPS_H diff --git a/Marlin/enum.h b/Marlin/enum.h index 470afef..4fa6496 100644 --- a/Marlin/enum.h +++ b/Marlin/enum.h @@ -28,27 +28,24 @@ /** * Axis indices as enumerated constants * - * - X_AXIS, Y_AXIS, and Z_AXIS should be used for axes in Cartesian space - * - A_AXIS, B_AXIS, and C_AXIS should be used for Steppers, corresponding to XYZ on Cartesians - * - X_HEAD, Y_HEAD, and Z_HEAD should be used for Steppers on Core kinematics + * 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 : unsigned char { +enum AxisEnum { + NO_AXIS = -1, X_AXIS = 0, A_AXIS = 0, Y_AXIS = 1, B_AXIS = 1, Z_AXIS = 2, C_AXIS = 2, - E_CART = 3, - #if ENABLED(HANGPRINTER) // Hangprinter order: A_AXIS, B_AXIS, C_AXIS, D_AXIS, E_AXIS - D_AXIS = 3, - E_AXIS = 4, - #else - E_AXIS = 3, - #endif - X_HEAD, Y_HEAD, Z_HEAD, - ALL_AXES = 0xFE, - NO_AXIS = 0xFF + E_AXIS = 3, + X_HEAD = 4, + Y_HEAD = 5, + Z_HEAD = 6, + ALL_AXES = 100 }; #define LOOP_S_LE_N(VAR, S, N) for (uint8_t VAR=S; VAR<=N; VAR++) @@ -58,11 +55,8 @@ enum AxisEnum : unsigned char { #define LOOP_NA(VAR) LOOP_L_N(VAR, NUM_AXIS) #define LOOP_XYZ(VAR) LOOP_S_LE_N(VAR, X_AXIS, Z_AXIS) -#define LOOP_XYZE(VAR) LOOP_S_LE_N(VAR, X_AXIS, E_CART) +#define LOOP_XYZE(VAR) LOOP_S_LE_N(VAR, X_AXIS, E_AXIS) #define LOOP_XYZE_N(VAR) LOOP_S_L_N(VAR, X_AXIS, XYZE_N) -#define LOOP_MOV_AXIS(VAR) LOOP_S_L_N(VAR, A_AXIS, MOV_AXIS) -#define LOOP_NUM_AXIS(VAR) LOOP_S_L_N(VAR, A_AXIS, NUM_AXIS) -#define LOOP_NUM_AXIS_N(VAR) LOOP_S_L_N(VAR, A_AXIS, NUM_AXIS_N) typedef enum { LINEARUNIT_MM, @@ -79,7 +73,7 @@ typedef enum { * Debug flags * Not yet widely applied */ -enum DebugFlags : unsigned char { +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 @@ -91,23 +85,53 @@ enum DebugFlags : unsigned char { DEBUG_ALL = 0xFF }; +enum EndstopEnum { + X_MIN, + Y_MIN, + Z_MIN, + Z_MIN_PROBE, + X_MAX, + Y_MAX, + Z_MAX, + X2_MIN, + X2_MAX, + Y2_MIN, + Y2_MAX, + Z2_MIN, + Z2_MAX +}; + +#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(ADVANCED_PAUSE_FEATURE) - enum AdvancedPauseMenuResponse : char { + enum AdvancedPauseMenuResponse { ADVANCED_PAUSE_RESPONSE_WAIT_FOR, ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE, ADVANCED_PAUSE_RESPONSE_RESUME_PRINT }; #if ENABLED(ULTIPANEL) - enum AdvancedPauseMessage : char { + enum AdvancedPauseMessage { ADVANCED_PAUSE_MESSAGE_INIT, ADVANCED_PAUSE_MESSAGE_UNLOAD, ADVANCED_PAUSE_MESSAGE_INSERT, ADVANCED_PAUSE_MESSAGE_LOAD, - ADVANCED_PAUSE_MESSAGE_PURGE, - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE, - #endif + ADVANCED_PAUSE_MESSAGE_EXTRUDE, ADVANCED_PAUSE_MESSAGE_OPTION, ADVANCED_PAUSE_MESSAGE_RESUME, ADVANCED_PAUSE_MESSAGE_STATUS, @@ -115,12 +139,6 @@ enum DebugFlags : unsigned char { ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT }; #endif - - enum AdvancedPauseMode : char { - ADVANCED_PAUSE_MODE_PAUSE_PRINT, - ADVANCED_PAUSE_MODE_LOAD_FILAMENT, - ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT - }; #endif /** @@ -128,7 +146,7 @@ enum DebugFlags : unsigned char { * Marlin sends messages if blocked or busy */ #if ENABLED(HOST_KEEPALIVE_FEATURE) - enum MarlinBusyState : char { + enum MarlinBusyState { NOT_BUSY, // Not in a handler IN_HANDLER, // Processing a GCode IN_PROCESS, // Known to be blocking command input (as in G29) @@ -140,12 +158,12 @@ enum DebugFlags : unsigned char { /** * SD Card */ -enum LsAction : char { LS_SerialPrint, LS_Count, LS_GetFilename }; +enum LsAction { LS_SerialPrint, LS_Count, LS_GetFilename }; /** * Ultra LCD */ -enum LCDViewAction : char { +enum LCDViewAction { LCDVIEW_NONE, LCDVIEW_REDRAW_NOW, LCDVIEW_CALL_REDRAW_NEXT, @@ -157,7 +175,7 @@ enum LCDViewAction : char { * Dual X Carriage modes. A Dual Nozzle can also do duplication. */ #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - enum DualXMode : char { + enum DualXMode { DXC_FULL_CONTROL_MODE, // DUAL_X_CARRIAGE only DXC_AUTO_PARK_MODE, // DUAL_X_CARRIAGE only DXC_DUPLICATION_MODE @@ -169,7 +187,7 @@ enum LCDViewAction : char { * (and "canned cycles" - not a current feature) */ #if ENABLED(CNC_WORKSPACE_PLANES) - enum WorkspacePlane : char { PLANE_XY, PLANE_ZX, PLANE_YZ }; + enum WorkspacePlane { PLANE_XY, PLANE_ZX, PLANE_YZ }; #endif #endif // __ENUM_H__ diff --git a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h index 6915781..48acfd3 100644 --- a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h +++ b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,15 +284,14 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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_1 7 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 7 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #define PIDTEMP #define BANG_MAX 70 // Limits current to nozzle while in bang-bang mode; 255=full current #define PID_MAX 74 // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -372,59 +354,52 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Buda 2.0 on 24V - #define DEFAULT_Kp 6 - #define DEFAULT_Ki .3 - #define DEFAULT_Kd 125 + #define DEFAULT_Kp 6 + #define DEFAULT_Ki .3 + #define DEFAULT_Kd 125 // Buda 2.0 on 12V - //#define DEFAULT_Kp 22.2 - //#define DEFAULT_Ki 1.01 - //#define DEFAULT_Kd 114 + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.01 + //#define DEFAULT_Kd 114 // Ultimaker - //#define DEFAULT_Kp 22.2 - //#define DEFAULT_Ki 1.08 - //#define DEFAULT_Kd 114 + //#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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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 206 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) @@ -432,47 +407,42 @@ //#define PID_BED_DEBUG // Sends debug data to the serial port. //24V 360W silicone heater from NPH on 3mm borosilicate (TAZ 2.2+) - #define DEFAULT_bedKp 20 - #define DEFAULT_bedKi 5 - #define DEFAULT_bedKd 275 + #define DEFAULT_bedKp 20 + #define DEFAULT_bedKi 5 + #define DEFAULT_bedKd 275 //12v 400W silicone heater from QUDB into 3mm borosilicate (TAZ 1.0+) //from pidautotune - //#define DEFAULT_bedKp 650 - //#define DEFAULT_bedKi 60 - //#define DEFAULT_bedKd 1800 + //#define DEFAULT_bedKp 650 + //#define DEFAULT_bedKi 60 + //#define DEFAULT_bedKd 1800 //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 + //#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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -527,10 +497,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -547,55 +518,12 @@ #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 probe. - -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe. // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -663,16 +591,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 10.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -723,7 +641,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -734,7 +651,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -753,9 +670,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -793,16 +707,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -826,10 +737,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -865,6 +772,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -878,8 +788,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -912,7 +820,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -920,7 +828,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -928,23 +836,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -992,12 +895,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1020,12 +917,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1037,10 +934,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1063,6 +963,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1071,23 +982,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1096,21 +1011,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1122,11 +1024,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1400,11 +1297,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1432,6 +1329,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1458,15 +1368,6 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // ENCODER SETTINGS // @@ -1531,18 +1432,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1560,6 +1455,40 @@ // //#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 @@ -1568,6 +1497,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1575,28 +1526,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1612,13 +1568,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1643,83 +1598,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1735,16 +1613,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1760,13 +1646,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1776,40 +1655,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1869,7 +1719,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1934,7 +1784,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h index 2503bc2..1074bc4 100644 --- a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. -#define MICROSTEP_MODES { 16, 16, 4, 16, 16 } // [1,2,4,8,16] +#define MICROSTEP_MODES {16,16,4,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/AliExpress/CL-260/Configuration.h b/Marlin/example_configurations/AliExpress/CL-260/Configuration.h index 282b0a9..c417cb0 100644 --- a/Marlin/example_configurations/AliExpress/CL-260/Configuration.h +++ b/Marlin/example_configurations/AliExpress/CL-260/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,49 +355,42 @@ // 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 + #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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -424,35 +399,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 800 @@ -507,10 +477,11 @@ #define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -521,61 +492,18 @@ #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 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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -643,16 +571,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -703,7 +621,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -714,7 +631,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -733,9 +650,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -773,16 +687,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -806,10 +717,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -845,6 +752,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -858,8 +768,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -892,7 +800,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -900,7 +808,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -908,23 +816,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -972,12 +875,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1000,12 +897,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1017,10 +914,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1043,6 +943,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1051,23 +962,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1076,21 +991,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1102,11 +1004,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1380,11 +1277,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1412,6 +1309,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1438,28 +1348,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1511,18 +1412,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1540,6 +1435,40 @@ // //#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 @@ -1548,6 +1477,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1555,28 +1506,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1592,13 +1548,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1623,83 +1578,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1715,16 +1593,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1740,13 +1626,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1756,40 +1635,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1849,7 +1699,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1914,7 +1764,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Anet/A6/Configuration.h b/Marlin/example_configurations/Anet/A6/Configuration.h index d407aa8..41e29ec 100644 --- a/Marlin/example_configurations/Anet/A6/Configuration.h +++ b/Marlin/example_configurations/Anet/A6/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,15 +284,14 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 11 +#define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 -#define TEMP_SENSOR_BED 11 -#define TEMP_SENSOR_CHAMBER 0 +#define TEMP_SENSOR_BED 5 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,60 +355,53 @@ // 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 + //#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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 // ANET A6 Firmware V2.0 Standard Extruder defaults: // PID-P: +022.20, PID-I: +001.08, PID-D: +114.00, PID-C: 1 - //#define DEFAULT_Kp 22.2 - //#define DEFAULT_Ki 1.08 - //#define DEFAULT_Kd 114.0 + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114.0 // Tuned by ralf-e. Always re-tune for your machine! - #define DEFAULT_Kp 16.83 - #define DEFAULT_Ki 1.02 - #define DEFAULT_Kd 69.29 + #define DEFAULT_Kp 16.83 + #define DEFAULT_Ki 1.02 + #define DEFAULT_Kd 69.29 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -435,44 +410,39 @@ //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 + //#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 + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 // ANET A6 // original Bed + 0.3mm Heat conducting into 4mm borosilicate (PID-Autotune: M303 E-1 S60 C5): - //#define DEFAULT_bedKp 295.00 - //#define DEFAULT_bedKi 35.65 - //#define DEFAULT_bedKd 610.21 - #define DEFAULT_bedKp 295.00 - #define DEFAULT_bedKi 35.65 - #define DEFAULT_bedKd 610.21 + //#define DEFAULT_bedKp 295.00 + //#define DEFAULT_bedKi 35.65 + //#define DEFAULT_bedKd 610.21 + #define DEFAULT_bedKp 295.00 + #define DEFAULT_bedKi 35.65 + #define DEFAULT_bedKd 610.21 // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #endif // PIDTEMPBED // @section extruder -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -527,10 +497,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -541,61 +512,18 @@ #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_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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. #define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -691,16 +619,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -751,7 +669,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -762,7 +679,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -781,9 +698,6 @@ * readings with inductive probes and piezo sensors. */ #define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif #define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -842,17 +756,14 @@ //#define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle] //#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.75 // Z offset: -below +above [the nozzle] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 //#define XY_PROBE_SPEED 6000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 3) // The number of probes to perform at each point. @@ -874,19 +785,10 @@ * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. * But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle. */ -#if 1 // 0 for less clearance - #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow - #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points - #define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes - //#define Z_AFTER_PROBING 5 // Z position after probing is done -#else - #define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow - #define Z_CLEARANCE_BETWEEN_PROBES 3 // Z Clearance between probe points - #define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes - //#define Z_AFTER_PROBING 3 // Z position after probing is done -#endif - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping +#define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow +#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow +//#define Z_CLEARANCE_BETWEEN_PROBES 3 // Z Clearance between probe points // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -925,6 +827,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -938,8 +843,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -1007,7 +910,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -1015,7 +918,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -1023,23 +926,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -1087,12 +985,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1115,12 +1007,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1133,9 +1025,9 @@ // Set the boundaries for probing (where the probe can reach). //#define LEFT_PROBE_BED_POSITION 15 - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - 15) - //#define FRONT_PROBE_BED_POSITION 15 - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - 15) + //#define RIGHT_PROBE_BED_POSITION 170 + //#define FRONT_PROBE_BED_POSITION 20 + //#define BACK_PROBE_BED_POSITION 170 // ANET A6 //#define LEFT_PROBE_BED_POSITION 20 @@ -1144,10 +1036,10 @@ //#define BACK_PROBE_BED_POSITION 190 // ANET A6 BLTOUCH right (39mm) to the nozzle - //#define LEFT_PROBE_BED_POSITION 36 - //#define RIGHT_PROBE_BED_POSITION 190 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 190 + #define LEFT_PROBE_BED_POSITION 36 + #define RIGHT_PROBE_BED_POSITION 190 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 190 // ANET A6 with new X-Axis and modded Y-Axis //#define LEFT_PROBE_BED_POSITION 20 @@ -1161,6 +1053,9 @@ //#define FRONT_PROBE_BED_POSITION 20 //#define BACK_PROBE_BED_POSITION 194 + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 + // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1182,6 +1077,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1190,23 +1096,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 5 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1215,21 +1125,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1241,11 +1138,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1533,11 +1425,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1565,6 +1457,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1591,28 +1496,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1664,18 +1560,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1693,6 +1583,40 @@ // //#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 @@ -1701,6 +1625,30 @@ // //#define G3D_PANEL +// +// RepRapDiscount FULL GRAPHIC Smart Controller +// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller +// +// Note: Details on connecting to the Anet V1.0 controller are in the file pins_ANET_10.h +// +//#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1708,28 +1656,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1745,13 +1698,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1776,85 +1728,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -// Note: Details on connecting to the Anet V1.0 controller are in the file pins_ANET_10.h -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1870,16 +1743,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1895,13 +1776,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1911,40 +1785,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -2004,7 +1849,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -2069,7 +1914,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Anet/A6/Configuration_adv.h b/Marlin/example_configurations/Anet/A6/Configuration_adv.h index 68c011c..36e8782 100644 --- a/Marlin/example_configurations/Anet/A6/Configuration_adv.h +++ b/Marlin/example_configurations/Anet/A6/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Anet/A8/Configuration.h b/Marlin/example_configurations/Anet/A8/Configuration.h index 1e6da8b..dc85dae 100644 --- a/Marlin/example_configurations/Anet/A8/Configuration.h +++ b/Marlin/example_configurations/Anet/A8/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -202,11 +197,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -238,15 +233,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -260,7 +246,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -269,8 +254,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -280,7 +264,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -302,7 +285,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -310,7 +293,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 5 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -360,7 +342,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -374,55 +356,48 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker - //#define DEFAULT_Kp 21.0 - //#define DEFAULT_Ki 1.25 - //#define DEFAULT_Kd 86.0 + //#define DEFAULT_Kp 21.0 + //#define DEFAULT_Ki 1.25 + //#define DEFAULT_Kd 86.0 // MakerGear - //#define DEFAULT_Kp 7.0 - //#define DEFAULT_Ki 0.1 - //#define DEFAULT_Kd 12 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 // ANET A8 Standard Extruder at 210 Degree Celsius and 100% Fan //(measured after M106 S255 with M303 E0 S210 C8) - #define DEFAULT_Kp 21.0 - #define DEFAULT_Ki 1.25 - #define DEFAULT_Kd 86.0 + #define DEFAULT_Kp 21.0 + #define DEFAULT_Ki 1.25 + #define DEFAULT_Kd 86.0 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -431,35 +406,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 160 // 160 guards against false tripping when the extruder fan kicks on. -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -514,10 +484,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -536,53 +507,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. #define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -650,16 +578,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -710,7 +628,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -721,7 +638,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -740,9 +657,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -780,16 +694,13 @@ #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 6000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -813,10 +724,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -852,6 +759,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -865,8 +775,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -899,7 +807,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -907,7 +815,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -915,23 +823,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -979,12 +882,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1007,12 +904,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1024,10 +921,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 190 + #define FRONT_PROBE_BED_POSITION 15 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1050,6 +950,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 arbitrary points to probe. + // A simple cross-product is used to estimate the plane of the bed. + #define ABL_PROBE_PT_1_X 20 + #define ABL_PROBE_PT_1_Y 160 + #define ABL_PROBE_PT_2_X 20 + #define ABL_PROBE_PT_2_Y 10 + #define ABL_PROBE_PT_3_X 180 + #define ABL_PROBE_PT_3_Y 10 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1058,23 +969,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1083,21 +998,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - #define PROBE_PT_1_X 20 - #define PROBE_PT_1_Y 160 - #define PROBE_PT_2_X 20 - #define PROBE_PT_2_Y 10 - #define PROBE_PT_3_X 180 - #define PROBE_PT_3_Y 10 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1109,11 +1011,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1387,11 +1284,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1419,6 +1316,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1445,28 +1355,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1518,18 +1419,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1547,6 +1442,40 @@ // //#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 @@ -1555,6 +1484,30 @@ // //#define G3D_PANEL +// +// RepRapDiscount FULL GRAPHIC Smart Controller +// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller +// +// Note: Details on connecting to the Anet V1.0 controller are in the file pins_ANET_10.h +// +//#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1562,28 +1515,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // #define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1599,13 +1557,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1630,85 +1587,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -// Note: Details on connecting to the Anet V1.0 controller are in the file pins_ANET_10.h -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1724,16 +1602,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1749,13 +1635,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1765,40 +1644,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1858,7 +1708,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1923,7 +1773,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Anet/A8/Configuration_adv.h b/Marlin/example_configurations/Anet/A8/Configuration_adv.h index b8680ae..6d7e288 100644 --- a/Marlin/example_configurations/Anet/A8/Configuration_adv.h +++ b/Marlin/example_configurations/Anet/A8/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/BQ/Hephestos/Configuration.h b/Marlin/example_configurations/BQ/Hephestos/Configuration.h index d74e70b..57311ac 100644 --- a/Marlin/example_configurations/BQ/Hephestos/Configuration.h +++ b/Marlin/example_configurations/BQ/Hephestos/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -131,6 +126,9 @@ // Displayed in the LCD "Ready" message #define CUSTOM_MACHINE_NAME "HEPHESTOS" +// Added for BQ +#define SOURCE_CODE_URL "http://www.bq.com/gb/downloads-prusa-i3-hephestos.html" + // 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" @@ -201,11 +199,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +235,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +248,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +256,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +266,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +287,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +295,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +344,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -371,39 +356,32 @@ // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. // Hephestos i3 - #define DEFAULT_Kp 23.05 - #define DEFAULT_Ki 2.00 - #define DEFAULT_Kd 66.47 + #define DEFAULT_Kp 23.05 + #define DEFAULT_Ki 2.00 + #define DEFAULT_Kd 66.47 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -412,35 +390,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -495,10 +468,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -517,53 +491,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -631,16 +562,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -691,7 +612,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -702,7 +622,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -721,9 +641,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -761,16 +678,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -794,10 +708,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -833,6 +743,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -846,8 +759,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -880,7 +791,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -888,7 +799,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -896,23 +807,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -960,12 +866,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -988,12 +888,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1005,10 +905,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1031,6 +934,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1039,23 +953,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1064,21 +982,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1090,11 +995,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1368,11 +1268,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1400,6 +1300,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1426,28 +1339,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1499,18 +1403,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1528,6 +1426,40 @@ // //#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 @@ -1536,6 +1468,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1543,28 +1497,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1580,13 +1539,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1611,83 +1569,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1703,16 +1584,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1728,13 +1617,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1744,40 +1626,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1837,7 +1690,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1902,7 +1755,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h b/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h index 194d5d5..e8f5214 100644 --- a/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h b/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h index e4cf80e..d5ba048 100644 --- a/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h @@ -20,27 +20,12 @@ * */ -/** - * 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 -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== -//============================= Getting Started ============================= +//================================= README ================================== //=========================================================================== /** @@ -49,9 +34,15 @@ * This configuration supports the standard Hephestos 2 with or without the * heated bed kit featured at https://store.bq.com/en/heated-bed-kit-hephestos2 * - * Enable HEPHESTOS2_HEATED_BED_KIT in Configuration_adv.h for all functionality - * related to the heated bed. - * + * Enable the following option to activate all functionality related to the heated bed. + */ +//#define HEPHESTOS2_HEATED_BED_KIT + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** * Here are some standard links for getting your machine calibrated: * * http://reprap.org/wiki/Calibration @@ -87,27 +78,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -150,7 +136,7 @@ #define EXTRUDERS 1 // Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc. -#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 +#define DEFAULT_NOMINAL_FILAMENT_DIA 3.0 // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE @@ -209,11 +195,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -245,15 +231,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -267,7 +244,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -276,8 +252,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -287,7 +262,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -309,15 +283,20 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 -#define TEMP_SENSOR_BED 0 -#define TEMP_SENSOR_CHAMBER 0 + +#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) + #define TEMP_SENSOR_BED 70 + #define HEATER_BED_INVERTING true +#else + #define TEMP_SENSOR_BED 0 +#endif // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -334,7 +313,7 @@ #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_RESIDENCY_TIME 0 // (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. @@ -351,12 +330,12 @@ // 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 230 +#define HEATER_0_MAXTEMP 275 #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 #define HEATER_4_MAXTEMP 275 -#define BED_MAXTEMP 100 +#define BED_MAXTEMP 110 //=========================================================================== //============================= PID Settings ================================ @@ -367,7 +346,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -375,49 +354,45 @@ //#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_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. // Tuned PID values using M303 - #define DEFAULT_Kp 23.75 - #define DEFAULT_Ki 2.12 - #define DEFAULT_Kd 66.63 + #define DEFAULT_Kp 19.18 + #define DEFAULT_Ki 1.36 + #define DEFAULT_Kd 67.42 // BQ firmware stock PID values - //#define DEFAULT_Kp 10.7 - //#define DEFAULT_Ki 0.45 - //#define DEFAULT_Kd 3 + //#define DEFAULT_Kp 10.7 + //#define DEFAULT_Ki 0.45 + //#define DEFAULT_Kd 3 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don'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 +// 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) + +#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) + #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current +#endif #if ENABLED(PIDTEMPBED) @@ -425,35 +400,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -508,10 +478,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -530,53 +501,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. #define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -602,14 +530,14 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 160, 160, 8000, 218.77 } +#define DEFAULT_AXIS_STEPS_PER_UNIT { 160, 160, 8000, 210.02 } /** * Default Max Feed Rate (mm/s) * Override with M203 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -#define DEFAULT_MAX_FEEDRATE { 300, 300, 3, 120 } +#define DEFAULT_MAX_FEEDRATE { 167, 167, 3.3, 167 } /** * Default Max Acceleration (change/s) change = mm/s @@ -617,7 +545,7 @@ * Override with M201 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 3000 } +#define DEFAULT_MAX_ACCELERATION { 1000, 1000, 100, 3000 } /** * Default Acceleration (change/s) change = mm/s @@ -627,9 +555,9 @@ * M204 R Retract Acceleration * M204 T Travel Acceleration */ -#define DEFAULT_ACCELERATION 900 // X, Y, Z and E acceleration for printing moves -#define DEFAULT_RETRACT_ACCELERATION 1300 // E acceleration for retracts -#define DEFAULT_TRAVEL_ACCELERATION 1500 // X, Y, Z acceleration for travel (non printing) moves +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** * Default Jerk (mm/s) @@ -639,20 +567,10 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XJERK 5.0 -#define DEFAULT_YJERK 5.0 +#define DEFAULT_XJERK 10.0 +#define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 -#define DEFAULT_EJERK 10.0 - -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION +#define DEFAULT_EJERK 1.0 //=========================================================================== //============================= Z Probe Options ============================= @@ -704,7 +622,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -715,7 +632,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -734,9 +651,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -777,10 +691,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -804,17 +718,13 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 0 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 2 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // 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 +#define Z_PROBE_OFFSET_RANGE_MIN -2 +#define Z_PROBE_OFFSET_RANGE_MAX 0 // Enable the M48 repeatability test to test probe accuracy -//#define Z_MIN_PROBE_REPEATABILITY_TEST +#define Z_MIN_PROBE_REPEATABILITY_TEST // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } @@ -843,6 +753,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -854,11 +767,9 @@ // @section homing -#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed +//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - -//#define Z_HOMING_HEIGHT 3 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... +#define Z_HOMING_HEIGHT 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. // Direction of endstops when homing; 1=MAX, -1=MIN @@ -890,7 +801,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -898,7 +809,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -906,23 +817,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -970,12 +876,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -998,12 +898,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 185.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 50.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1011,14 +911,17 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define GRID_MAX_POINTS_X 5 - #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y 4 // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION X_MIN_POS + (X_PROBE_OFFSET_FROM_EXTRUDER) - //#define RIGHT_PROBE_BED_POSITION X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) - //#define FRONT_PROBE_BED_POSITION Y_MIN_POS + (Y_PROBE_OFFSET_FROM_EXTRUDER) - //#define BACK_PROBE_BED_POSITION Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER) + #define LEFT_PROBE_BED_POSITION X_MIN_POS + (X_PROBE_OFFSET_FROM_EXTRUDER) + #define RIGHT_PROBE_BED_POSITION X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) + #define FRONT_PROBE_BED_POSITION Y_MIN_POS + (Y_PROBE_OFFSET_FROM_EXTRUDER) + #define BACK_PROBE_BED_POSITION Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER) + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1027,7 +930,7 @@ // Beyond the probed grid, continue the implied tilt? // Default is to maintain the height of the nearest edge. - #define EXTRAPOLATE_BEYOND_GRID + //#define EXTRAPOLATE_BEYOND_GRID // // Experimental Subdivision of the grid by Catmull-Rom method. @@ -1041,6 +944,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 arbitrary points to probe. + // A simple cross-product is used to estimate the plane of the bed. + #define ABL_PROBE_PT_1_X X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER + #define ABL_PROBE_PT_1_Y Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER + #define ABL_PROBE_PT_2_X X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) + #define ABL_PROBE_PT_2_Y Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER + #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) + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1049,23 +963,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1074,21 +992,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1100,16 +1005,11 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. */ -#define Z_PROBE_END_SCRIPT "G27 P0" +//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // @section homing @@ -1140,8 +1040,8 @@ #endif // Homing speeds (mm/m) -#define HOMING_FEEDRATE_XY (50*60) -#define HOMING_FEEDRATE_Z ( 4*60) +#define HOMING_FEEDRATE_XY (60*60) +#define HOMING_FEEDRATE_Z 120 // @section calibrate @@ -1225,7 +1125,7 @@ // 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 5 // Number of seconds between "busy" messages. Set with M113. +#define DEFAULT_KEEPALIVE_INTERVAL 10 // Number of seconds between "busy" messages. Set with M113. #define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating // @@ -1246,12 +1146,12 @@ // @section temperature // Preheat Constants -#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_HOTEND 205 #define PREHEAT_1_TEMP_BED 50 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 -#define PREHEAT_2_TEMP_HOTEND 210 -#define PREHEAT_2_TEMP_BED 60 +#define PREHEAT_2_TEMP_HOTEND 245 +#define PREHEAT_2_TEMP_BED 50 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 /** @@ -1312,7 +1212,7 @@ * Attention: EXPERIMENTAL. G-code arguments may change. * */ -//#define NOZZLE_CLEAN_FEATURE +#define NOZZLE_CLEAN_FEATURE #if ENABLED(NOZZLE_CLEAN_FEATURE) // Default number of pattern repetitions @@ -1322,8 +1222,8 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // 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)} + #define NOZZLE_CLEAN_START_POINT { X_MIN_POS + 10, Y_MAX_POS - 9, (Z_MIN_POS + 0.5)} + #define NOZZLE_CLEAN_END_POINT { X_MIN_POS + 90, Y_MAX_POS - 0, (Z_MIN_POS + 0.5)} // Circular pattern radius #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 @@ -1333,7 +1233,7 @@ #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT // Moves the nozzle to the initial position - #define NOZZLE_CLEAN_GOBACK + //#define NOZZLE_CLEAN_GOBACK #endif /** @@ -1378,11 +1278,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1410,6 +1310,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1434,16 +1347,7 @@ * * Use CRC checks and retries on the SD communication. */ -//#define SD_CHECK_AND_RETRY - -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS +#define SD_CHECK_AND_RETRY // // ENCODER SETTINGS @@ -1451,13 +1355,13 @@ // 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 1 +//#define ENCODER_PULSES_PER_STEP 1 // // Use this option to override the number of step signals required to // move between next/prev menu items. // -#define ENCODER_STEPS_PER_MENU_ITEM 5 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1509,18 +1413,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1538,6 +1436,40 @@ // //#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 @@ -1546,6 +1478,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1553,28 +1507,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1590,13 +1549,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1621,83 +1579,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1713,16 +1594,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1738,13 +1627,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1754,40 +1636,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1795,7 +1648,7 @@ // @section extras // Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino -#define FAST_PWM_FAN +//#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 @@ -1847,7 +1700,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1912,7 +1765,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h index 0d0e0c0..14776c6 100644 --- a/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -172,22 +161,20 @@ // Extruder runout prevention. // If the machine is idle and the temperature over MINTEMP // then extrude some filament every couple of SECONDS. -//#define EXTRUDER_RUNOUT_PREVENT +#define EXTRUDER_RUNOUT_PREVENT #if ENABLED(EXTRUDER_RUNOUT_PREVENT) - #define EXTRUDER_RUNOUT_MINTEMP 190 - #define EXTRUDER_RUNOUT_SECONDS 30 + #define EXTRUDER_RUNOUT_MINTEMP 170 + #define EXTRUDER_RUNOUT_SECONDS 60 #define EXTRUDER_RUNOUT_SPEED 1500 // mm/m #define EXTRUDER_RUNOUT_EXTRUDE 5 // mm #endif // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -206,22 +193,12 @@ // 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 800 +//#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -384,16 +351,13 @@ // Homing hits each endstop, retracts by these distances, then does a slower bump. #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 -#define Z_HOME_BUMP_MM 1 +#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 homing includes X and Y, do a diagonal move initially // When G28 is called, this option will make Y home before X #define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -410,10 +374,10 @@ // 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 300 -#define DISABLE_INACTIVE_X false -#define DISABLE_INACTIVE_Y false -#define DISABLE_INACTIVE_Z false // set to false if the nozzle will fall down on your printed part when print has finished. +#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 @@ -424,7 +388,7 @@ // @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 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 @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -486,15 +434,7 @@ * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 */ //#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps - -#define DIGIPOT_MOTOR_CURRENT { 170, 170, 180, 190, 180 } // Values 0-255 - // - // bq ZUM Mega 3D defaults: - // X = 150 [~1.17A] - // Y = 170 [~1.33A] - // Z = 180 [~1.41A] - // E0 = 190 [~1.49A] - +#define DIGIPOT_MOTOR_CURRENT { 150, 170, 180, 190, 180 } // Values 0-255 (bq ZUM Mega 3D (default): X = 150 [~1.17A]; Y = 170 [~1.33A]; Z = 180 [~1.41A]; E0 = 190 [~1.49A]) //#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis // Use an I2C based DIGIPOT (e.g., Azteeg X3 Pro) @@ -514,25 +454,24 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== //=============================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 30 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 50 // 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 +#define LCD_INFO_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -541,21 +480,7 @@ #define LCD_DECIMAL_SMALL_XY // The timeout (in ms) to return to the status screen from sub-menus -#define LCD_TIMEOUT_TO_STATUS 60000 - -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY +//#define LCD_TIMEOUT_TO_STATUS 15000 /** * LED Control Menu @@ -583,8 +508,8 @@ // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). #define SD_DETECT_INVERTED - #define SD_FINISHED_STEPPERRELEASE false // Disable steppers when SD Print is finished - #define SD_FINISHED_RELEASECOMMAND "G27 P0" // You might want to keep the z enabled so your bed stays in place. + #define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished + #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. // Reverse SD sort to show "more recent" files first, according to the card's FAT. // Since the FAT gets out of order with usage, SDCARD_SORT_ALPHA is recommended. @@ -593,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -645,8 +556,27 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 - //#define LONG_FILENAME_HOST_SUPPORT + #define LONG_FILENAME_HOST_SUPPORT // Enable this option to scroll long filenames in the SD card menu //#define SCROLL_LONG_FILENAMES @@ -665,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -685,22 +610,19 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen - //#define XYZ_HOLLOW_FRAME + #define XYZ_HOLLOW_FRAME // Enable to save many cycles by drawing a hollow frame on Menu Screens #define MENU_HOLLOW_FRAME // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM. // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. - //#define USE_BIG_EDIT_FONT + #define USE_BIG_EDIT_FONT // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM. // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. - //#define USE_SMALL_INFOFONT + #define USE_SMALL_INFOFONT // Enable this option and reduce the value to optimize screen updates. // The normal delay is 10µs. Use the lowest value that still gives a reliable display. @@ -709,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -752,44 +655,68 @@ * * Warning: Does not respect endstops! */ -#define BABYSTEPPING +//#define BABYSTEPPING #if ENABLED(BABYSTEPPING) - //#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA! - #define BABYSTEP_INVERT_Z false // Change if Z babysteps should go the other way - #define BABYSTEP_MULTIPLICATOR 2 // Babysteps are very small. Increase for faster motion. - //#define BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping - //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. - #define DOUBLECLICK_MAX_INTERVAL 1500 // Maximum interval between clicks, in milliseconds. - // Note: Extra time may be added to mitigate controller latency. - //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + //#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA! + #define BABYSTEP_INVERT_Z false // Change if Z babysteps should go the other way + #define BABYSTEP_MULTIPLICATOR 1 // Babysteps are very small. Increase for faster motion. + //#define BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: Extra time may be added to mitigate controller latency. + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor #endif // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -803,7 +730,7 @@ // // G2/G3 Arc Support // -//#define ARC_SUPPORT // Disable this feature to save ~3226 bytes +#define ARC_SUPPORT // Disable this feature to save ~3226 bytes #if ENABLED(ARC_SUPPORT) #define MM_PER_ARC_SEGMENT 1 // Length of each arc segment #define N_ARC_CORRECTION 25 // Number of intertpolated segments between corrections @@ -824,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -879,7 +769,7 @@ // 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 (e.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 + #define BLOCK_BUFFER_SIZE 32 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #else #define BLOCK_BUFFER_SIZE 64 // maximize block buffer #endif @@ -925,13 +815,13 @@ // 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 +#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 +//#define NO_TIMEOUTS 1000 // Milliseconds // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. #define ADVANCED_OK @@ -988,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1084,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1143,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1201,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1224,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1252,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1562,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1574,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1606,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1616,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1656,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/BQ/Hephestos_2/README.md b/Marlin/example_configurations/BQ/Hephestos_2/README.md index ab28487..cbe9965 100644 --- a/Marlin/example_configurations/BQ/Hephestos_2/README.md +++ b/Marlin/example_configurations/BQ/Hephestos_2/README.md @@ -1,29 +1,22 @@ # Example Configuration for BQ [Hephestos 2](http://www.bq.com/uk/hephestos-2) -Based on the original configuration file shipped with the heavily modified Marlin fork by BQ. -The forked firmware and configuration files can be found at the [BQ Github repository](https://github.com/bq/Marlin). +This configuration file is based on the original configuration file shipped with the heavily modified Marlin fork by BQ. The original firmware and configuration file can be found at [BQ Github repository](https://github.com/bq/Marlin). -NOTE: The look and feel of the LCD menu will change dramatically when using the original Marlin firmware. +NOTE: The look and feel of the Hephestos 2 while navigating the LCD menu will change by using the original Marlin firmware. ## Changelog - * 2018/05/30 - Configuration updated to the latest Marlin version (43a55a9af). - ABL Bilinear 5x5 is active by default. + * 2016/03/01 - Initial release - * 2017/07/06 - Configuration updated to the latest Marlin version and added support for the - official BQ heated bed upgrade kit. + * 2016/03/21 - Activated 4-point auto leveling by default + Updated miscellaneous z-probe values - * 2016/12/13 - Configuration updated to the latest Marlin version. + * 2016/06/21 - Disabled hot bed related options + Activated software endstops + SD printing now disables the heater when finished - * 2016/07/13 - Configuration updated to the latest Marlin version. + * 2016/07/13 - Update the `DEFAULT_AXIS_STEPS_PER_UNIT` for the Z axis + Increased the `DEFAULT_XYJERK` - * 2016/06/21 - Disabled heated bed related options, activated software endstops and SD printing now - disables the heater when finishes printing. + * 2016/12/13 - Configuration updated. - * 2016/03/21 - Activated 4-point auto leveling by default and updated miscellaneous z-probe values. - - * 2016/03/01 - The first release of Marlin's configuration file for the - BQ Hephestos 2 3D printer. - - -## Support -This configuration should work easily with the stock Hephestos 2, nevertheless if you encounter any -issues you may contact me on [Github](https://github.com/jbrazio), [Twitter](https://twitter.com/jbrazio) or by mail. + * 2017/07/06 - Configuration updated to the latest Marlin version. + Added support for the official BQ heated bed kit. diff --git a/Marlin/example_configurations/BQ/Hephestos_2/_Bootscreen.h b/Marlin/example_configurations/BQ/Hephestos_2/_Bootscreen.h index 0e771c0..786d37b 100644 --- a/Marlin/example_configurations/BQ/Hephestos_2/_Bootscreen.h +++ b/Marlin/example_configurations/BQ/Hephestos_2/_Bootscreen.h @@ -21,80 +21,83 @@ */ /** - * Custom Boot Screen bitmap + * Custom Bitmap for splashscreen * - * Place this file in the root with your configuration files - * and enable SHOW_CUSTOM_BOOTSCREEN in Configuration.h. + * You may use one of the following tools to generate the C++ bitmap array from + * a black and white image: * - * Use the Marlin Bitmap Converter to make your own: - * http://marlinfw.org/tools/u8glib/converter.html + * - http://www.marlinfw.org/tools/u8glib/converter.html + * - http://www.digole.com/tools/PicturetoC_Hex_converter.php */ +#include -#define CUSTOM_BOOTSCREEN_BMPWIDTH 64 +#define CUSTOM_BOOTSCREEN_TIMEOUT 2500 +#define CUSTOM_BOOTSCREEN_BMPWIDTH 62 +#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 -const unsigned char custom_start_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000011,B11110000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000111,B11111000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000111,B11111000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001111,B11111100,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001111,B11111100,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000111,B11111000,B00000000,B00000000,B00000000, - B00000000,B00000000,B11111000,B00000111,B11111000,B00000111,B11000000,B00000000, - B00000000,B00000001,B11111100,B00000011,B11110000,B00001111,B11100000,B00000000, - B00000000,B00000011,B11111110,B00000000,B11000000,B00011111,B11110000,B00000000, - B00000000,B00000011,B11111110,B00000000,B00000000,B00011111,B11110000,B00000000, - B00000000,B00000011,B11111110,B00000000,B00000000,B00011111,B11110000,B00000000, - B00000000,B00000011,B11111110,B00000000,B00000000,B00011111,B11110000,B00000000, - B00000000,B00000011,B11111100,B00000000,B00000000,B00001111,B11100000,B00000000, - B00000000,B00000001,B11111000,B00000000,B00000000,B00001111,B11100000,B00000000, - B00000000,B00000000,B01110000,B00000000,B00000000,B00000011,B10000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01100000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111100, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111100, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111100, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111100, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111100, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111100, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001111,B10000000,B00000000,B00000000,B01110000,B00000000,B00000000,B00000000, - B00011111,B11000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000, - B00111111,B11000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000, - B00111111,B11100000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000, - B00111111,B11100000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000, - B00111111,B11100000,B00000000,B00000000,B01111011,B11000000,B00001111,B00000000, - B00111111,B11000000,B00000000,B00000000,B01111111,B11110000,B00111111,B11000000, - B00011111,B10000000,B00000000,B00000000,B01111111,B11111000,B01111111,B11100000, - B00001111,B00000000,B00000000,B00000000,B01111110,B11111100,B11111001,B11110000, - B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B11100000,B11110000, - B00000000,B00000000,B00000000,B00000000,B01111000,B00011101,B11100000,B01110000, - B00000000,B00000000,B00000000,B00000000,B01111000,B00011101,B11100000,B01110000, - B00000000,B00000000,B00000000,B00000000,B01111000,B00011101,B11100000,B01110000, - B00000000,B00000000,B00000000,B00000000,B01111000,B00011101,B11100000,B01110000, - B00000000,B00000000,B00000000,B00000000,B01111000,B00011101,B11100000,B01110000, - B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B11100000,B11110000, - B00000000,B00000000,B00000000,B00000000,B01111100,B01111100,B11111001,B11110000, - B00000000,B00000000,B00000000,B00000000,B00011111,B11111000,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00001111,B11110000,B01111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000111,B11100000,B00011111,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 +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/BQ/WITBOX/Configuration.h b/Marlin/example_configurations/BQ/WITBOX/Configuration.h index d121193..493e802 100644 --- a/Marlin/example_configurations/BQ/WITBOX/Configuration.h +++ b/Marlin/example_configurations/BQ/WITBOX/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -131,6 +126,9 @@ // Displayed in the LCD "Ready" message #define CUSTOM_MACHINE_NAME "WITBOX" +// Added for BQ +#define SOURCE_CODE_URL "http://www.bq.com/gb/downloads-witbox.html" + // 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" @@ -201,11 +199,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +235,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +248,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +256,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +266,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +287,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +295,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +344,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -371,39 +356,32 @@ // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. // Witbox - #define DEFAULT_Kp 22.2 - #define DEFAULT_Ki 1.08 - #define DEFAULT_Kd 114 + #define DEFAULT_Kp 22.2 + #define DEFAULT_Ki 1.08 + #define DEFAULT_Kd 114 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -412,35 +390,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -495,10 +468,11 @@ #define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -517,53 +491,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -631,16 +562,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -691,7 +612,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -702,7 +622,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -721,9 +641,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -761,16 +678,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -794,10 +708,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -833,6 +743,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -846,8 +759,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -880,7 +791,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -888,7 +799,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -896,23 +807,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -960,12 +866,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -988,12 +888,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1005,10 +905,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1031,6 +934,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1039,23 +953,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1064,21 +982,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1090,11 +995,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1368,11 +1268,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1400,6 +1300,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1426,28 +1339,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1499,18 +1403,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1528,6 +1426,40 @@ // //#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 @@ -1536,6 +1468,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1543,28 +1497,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1580,13 +1539,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1611,83 +1569,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1703,16 +1584,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1728,13 +1617,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1744,40 +1626,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1837,7 +1690,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1902,7 +1755,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h b/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h index 194d5d5..e8f5214 100644 --- a/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index e2fd74b..350f5dc 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -202,11 +197,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -238,15 +233,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -260,7 +246,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -269,8 +254,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -280,7 +264,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -302,7 +285,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -310,7 +293,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -360,7 +342,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -374,49 +356,42 @@ // 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 + #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 + //#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 + //#define DEFAULT_Kp 18 + //#define DEFAULT_Ki 1 + //#define DEFAULT_Kd 100 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -424,34 +399,29 @@ //#define PID_BED_DEBUG // Sends debug data to the serial port. //24V 500W silicone heater on to 4mm glass CartesioW - #define DEFAULT_bedKp 390 - #define DEFAULT_bedKi 70 - #define DEFAULT_bedKd 546 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -506,10 +476,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -526,55 +497,12 @@ #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 probe. - -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe. // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -642,16 +570,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -702,7 +620,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -713,7 +630,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -732,9 +649,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -772,16 +686,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -805,10 +716,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -844,6 +751,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -857,8 +767,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -891,7 +799,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -899,7 +807,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -907,23 +815,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -971,12 +874,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -999,12 +896,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1016,10 +913,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1042,6 +942,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1050,23 +961,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1075,21 +990,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1101,11 +1003,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1379,11 +1276,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1411,6 +1308,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1437,15 +1347,6 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // ENCODER SETTINGS // @@ -1510,18 +1411,12 @@ #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 #define LCD_FEEDBACK_FREQUENCY_HZ 1000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1539,6 +1434,40 @@ // //#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 @@ -1547,6 +1476,28 @@ // //#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/ @@ -1554,28 +1505,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1591,13 +1547,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1622,83 +1577,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1714,16 +1592,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1739,13 +1625,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1755,40 +1634,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1848,7 +1698,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1913,7 +1763,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index e064cbb..aa7bcff 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @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 -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 35 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X #define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 1 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - //#define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + //#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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Cartesio/_Bootscreen.h b/Marlin/example_configurations/Cartesio/_Bootscreen.h index e0efd83..b78b6e1 100644 --- a/Marlin/example_configurations/Cartesio/_Bootscreen.h +++ b/Marlin/example_configurations/Cartesio/_Bootscreen.h @@ -21,80 +21,83 @@ */ /** - * Custom Boot Screen bitmap + * Custom Bitmap for splashscreen * - * Place this file in the root with your configuration files - * and enable SHOW_CUSTOM_BOOTSCREEN in Configuration.h. + * You may use one of the following tools to generate the C++ bitmap array from + * a black and white image: * - * Use the Marlin Bitmap Converter to make your own: - * http://marlinfw.org/tools/u8glib/converter.html + * - http://www.marlinfw.org/tools/u8glib/converter.html + * - http://www.digole.com/tools/PicturetoC_Hex_converter.php */ +#include -#define CUSTOM_BOOTSCREEN_BMPWIDTH 64 +#define CUSTOM_BOOTSCREEN_TIMEOUT 2500 +#define CUSTOM_BOOTSCREEN_BMPWIDTH 63 +#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 -const unsigned char custom_start_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000111,B11000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00111111,B11111100,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000011,B11111111,B11111111,B11000000,B00000000,B00000000, - B00000000,B00000000,B00011111,B11111111,B11111111,B11110000,B00000000,B00000000, - B00000000,B00000000,B01111111,B11111111,B11111111,B11111100,B00000000,B00000000, - B00000000,B00000000,B11111111,B11111111,B11111111,B11111111,B00000000,B00000000, - B00000000,B00000011,B11111111,B11111111,B11111111,B11111111,B10000000,B00000000, - B00000000,B00000111,B11111111,B11111111,B11111111,B11111111,B11000000,B00000000, - B00000000,B00000000,B00000000,B00000111,B11000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000111,B11000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000111,B11000000,B00000000,B00000000,B00000000, - B00000000,B00001111,B00000111,B10000111,B11111111,B11111111,B11100000,B00000000, - B00000000,B00011111,B10001111,B11000111,B11111111,B11111111,B11110001,B00000000, - B00000001,B00011111,B10001111,B11000111,B11111111,B11111111,B11110001,B10000000, - B00000011,B00011111,B10001111,B11000111,B11111111,B11111111,B11110001,B10000000, - B00000111,B00011111,B10001111,B11000111,B11111111,B11111111,B11100001,B11000000, - B00000111,B00011111,B10001111,B11000111,B11000000,B00000000,B00000001,B11100000, - B00001111,B00011111,B10001111,B11000111,B11000000,B00000000,B00000001,B11100000, - B00001111,B00011111,B10001111,B11000111,B11000000,B00000000,B00000001,B11110000, - B00011111,B00011111,B10001111,B11000111,B11000000,B00000000,B00000001,B11110000, - B00011111,B00011111,B10001111,B11000111,B11111111,B11111111,B11100001,B11110000, - B00111111,B00011111,B10001111,B11000111,B11111111,B11111111,B11110001,B11111000, - B00111111,B00011111,B10001111,B11000111,B11111111,B11111111,B11110001,B11111000, - B00111111,B00011111,B10001111,B11000111,B11111111,B11111111,B11110001,B11111000, - B00111111,B00011111,B10001111,B11000111,B11111111,B11111111,B11100001,B11111000, - B01111111,B00011111,B10001111,B11000111,B11000000,B00000000,B00000001,B11111100, - B01111111,B00011111,B10001111,B11000111,B11000000,B00000000,B00000001,B11111100, - B01111111,B00011111,B10001111,B11000111,B11000000,B00000000,B00000001,B11111100, - B01111111,B00011111,B10001111,B11000111,B11000000,B00000000,B00000001,B11111100, - B01111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111100, - B01111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111100, - B01111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111100, - B01111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111100, - B01111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111100, - B01111111,B00000000,B00000000,B00000111,B11000111,B11100011,B11110001,B11111100, - B01111111,B00000000,B00000000,B00000111,B11000111,B11100011,B11110001,B11111100, - B01111111,B00000000,B00000000,B00000111,B11000111,B11100011,B11110001,B11111100, - B00111111,B00001111,B11111111,B11111111,B11000111,B11100011,B11110001,B11111000, - B00111111,B00011111,B11111111,B11111111,B11000111,B11100011,B11110001,B11111000, - B00111111,B00011111,B11111111,B11111111,B11000111,B11100011,B11110001,B11111000, - B00111111,B00011111,B11111111,B11111111,B11000111,B11100011,B11110001,B11111000, - B00011111,B00011111,B11111111,B11111111,B11000111,B11100011,B11110001,B11110000, - B00011111,B00001111,B11111111,B11111111,B11000111,B11100011,B11110001,B11110000, - B00011111,B00000000,B00000000,B00000111,B11000111,B11100011,B11110001,B11100000, - B00001111,B00000000,B00000000,B00000111,B11000111,B11100011,B11110001,B11100000, - B00001111,B00000000,B00000000,B00000111,B11000111,B11100011,B11110001,B11000000, - B00000111,B00001111,B11111111,B11111111,B11000111,B11100011,B11110001,B11000000, - B00000011,B00011111,B11111111,B11111111,B11000111,B11100011,B11110001,B10000000, - B00000011,B00011111,B11111111,B11111111,B11000111,B11100011,B11110001,B00000000, - B00000001,B00011111,B11111111,B11111111,B11000111,B11100011,B11110000,B00000000, - B00000000,B00011111,B11111111,B11111111,B11000111,B11100011,B11110000,B00000000, - B00000000,B00001111,B11111111,B11111111,B11000011,B11000001,B11100000,B00000000, - B00000000,B00000000,B00000000,B00000111,B11000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000111,B11000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000111,B11000000,B00000000,B00000000,B00000000, - B00000000,B00000111,B11111111,B11111111,B11111111,B11111111,B11000000,B00000000, - B00000000,B00000011,B11111111,B11111111,B11111111,B11111111,B10000000,B00000000, - B00000000,B00000001,B11111111,B11111111,B11111111,B11111110,B00000000,B00000000, - B00000000,B00000000,B01111111,B11111111,B11111111,B11111100,B00000000,B00000000, - B00000000,B00000000,B00011111,B11111111,B11111111,B11110000,B00000000,B00000000, - B00000000,B00000000,B00000111,B11111111,B11111111,B10000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B01111111,B11111000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 +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/Creality/CR-10/Configuration.h b/Marlin/example_configurations/Creality/CR-10/Configuration.h index b147cf4..efd299e 100644 --- a/Marlin/example_configurations/Creality/CR-10/Configuration.h +++ b/Marlin/example_configurations/Creality/CR-10/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 5 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,54 +355,47 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Stock CR-10 tuned for 70C - #define DEFAULT_Kp 22.57 - #define DEFAULT_Ki 1.72 - #define DEFAULT_Kd 73.96 + #define DEFAULT_Kp 22.57 + #define DEFAULT_Ki 1.72 + #define DEFAULT_Kd 73.96 // Ultimaker - //#define DEFAULT_Kp 22.2 - //#define DEFAULT_Ki 1.08 - //#define DEFAULT_Kd 114 + //#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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -428,41 +403,36 @@ //#define PID_BED_DEBUG // Sends debug data to the serial port. //Stock CR-10 Bed Tuned for 70C - #define DEFAULT_bedKp 426.68 - #define DEFAULT_bedKi 78.92 - #define DEFAULT_bedKd 576.71 + #define DEFAULT_bedKp 426.68 + #define DEFAULT_bedKi 78.92 + #define DEFAULT_bedKd 576.71 //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 + //#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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 1000 @@ -517,10 +487,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -//#define ENDSTOPPULLUPS +// coarse Endstop Settings +//#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -539,53 +510,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -626,7 +554,7 @@ * Override with M201 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 5000 } /** * Default Acceleration (change/s) change = mm/s @@ -653,16 +581,6 @@ #define DEFAULT_ZJERK 2.7 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -713,7 +631,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -724,7 +641,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -743,9 +660,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -783,16 +697,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -816,10 +727,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 10 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 10 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -855,6 +762,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -868,8 +778,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -902,7 +810,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -910,7 +818,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -918,23 +826,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -982,12 +885,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1010,12 +907,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1027,10 +924,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1053,6 +953,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1061,23 +972,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1086,21 +1001,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1112,11 +1014,6 @@ // Add a menu item to move between bed corners for manual bed adjustment #define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1277,7 +1174,7 @@ * P1 Raise the nozzle always to Z-park height. * P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS. */ -#define NOZZLE_PARK_FEATURE +//#define NOZZLE_PARK_FEATURE #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z } @@ -1390,11 +1287,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1422,6 +1319,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1448,28 +1358,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +#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 +#define ENCODER_STEPS_PER_MENU_ITEM 1 /** * Encoder Direction Options @@ -1521,18 +1422,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1550,6 +1445,40 @@ // //#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 @@ -1558,6 +1487,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1565,28 +1516,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1602,13 +1558,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1633,83 +1588,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1725,16 +1603,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1750,13 +1636,6 @@ // #define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1766,40 +1645,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1859,7 +1709,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1924,7 +1774,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h b/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h index 25bb874..f1dc2f0 100644 --- a/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h +++ b/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ #define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 420 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 8 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 120 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 6 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - #define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - #define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_RETRACT_LENGTH 4 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_UNLOAD_LENGTH 420 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 8 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 120 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 3 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + #define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + #define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1557,7 +1485,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1569,7 +1497,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1601,7 +1529,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1611,29 +1539,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1651,7 +1577,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Creality/CR-10/_Bootscreen.h b/Marlin/example_configurations/Creality/CR-10/_Bootscreen.h index d74e7ae..fdf09de 100644 --- a/Marlin/example_configurations/Creality/CR-10/_Bootscreen.h +++ b/Marlin/example_configurations/Creality/CR-10/_Bootscreen.h @@ -21,35 +21,80 @@ */ /** - * Custom Boot Screen bitmap - * - * Place this file in the root with your configuration files - * and enable SHOW_CUSTOM_BOOTSCREEN in Configuration.h. - * - * Use the Marlin Bitmap Converter to make your own: - * http://marlinfw.org/tools/u8glib/converter.html + * Tongue-in-cheek placeholder for a more Marlin-specific bitmap + * The joke is that every "CR-10" has different branding! + * Made using The Gimp and... + * - http://www.digole.com/tools/PicturetoC_Hex_converter.php */ +#include -#define CUSTOM_BOOTSCREEN_TIMEOUT 1000 -#define CUSTOM_BOOTSCREEN_BMPWIDTH 128 +#define CUSTOM_BOOTSCREEN_TIMEOUT 2500 +#define CUSTOM_BOOTSCREEN_BMPWIDTH 54 +#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 const unsigned char custom_start_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111100,B00000000,B00000000, - B00001111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000001,B10000110,B00011111,B11000000, - B00011000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B01100000,B00111100,B00001100,B00000000,B00000000,B00000001,B10000011,B00001100,B01100000, - B00010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B01100000,B00111100,B00001100,B00000000,B00000000,B00000001,B10000011,B00001100,B00110000, - B00110000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B01100000,B00000000,B00001100,B00000000,B00000000,B00000000,B00000011,B00001100,B00011000, - B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01100000,B00000000,B00111111,B00001111,B00111100,B00000000,B00000011,B00001100,B00001100, - B01100000,B00000001,B11011111,B00001111,B11100000,B11111110,B00000000,B01100000,B00011100,B00011100,B00000110,B00011000,B00000000,B00000110,B00001100,B00001100, - B01100000,B00000000,B11110011,B00011000,B00110001,B10000011,B00000000,B01100000,B00001100,B00001100,B00000011,B00011000,B00000000,B00011110,B00001100,B00001100, - B01100000,B00000000,B11100000,B00110000,B00111001,B10000011,B00000000,B01100000,B00001100,B00001100,B00000011,B00110000,B00000000,B00000011,B00001100,B00001100, - B01100000,B00000000,B11000000,B00110000,B00111000,B00001111,B00000000,B01100000,B00001100,B00001100,B00000011,B00110000,B00000000,B00000001,B10001100,B00001100, - B01100000,B00000000,B11000000,B00111111,B11111000,B11111011,B00000000,B01100000,B00001100,B00001100,B00000011,B00110000,B00000000,B00000001,B10001100,B00001100, - B01100000,B00110000,B11000000,B00110000,B00000001,B10000011,B00000000,B01100000,B00001100,B00001100,B00000001,B11110000,B00000001,B10000001,B10001100,B00001100, - B01100000,B00110000,B11000000,B00110000,B00000001,B10000011,B00000000,B01100000,B00001100,B00001100,B00000000,B11100000,B00000001,B10000001,B10001100,B00011000, - B00110000,B00110000,B11000000,B00011000,B00110001,B10000011,B00000000,B01100000,B00001100,B00001100,B01000000,B11100000,B00000001,B10000011,B10001100,B00110000, - B00011000,B01100000,B11000000,B00001100,B01100001,B10000111,B11000000,B11100000,B00011100,B00001100,B11000000,B01100000,B00000000,B11000011,B00001100,B01100000, - B00001111,B11000011,B11110000,B00000111,B11000000,B11111111,B11000111,B11111100,B01111111,B00000111,B10000001,B11000000,B00000000,B01111110,B00011111,B11000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00000000,B00000000,B00000000,B00000000,B00000000 -}; \ No newline at end of file + 0x00, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3F, 0xF8, 0x00, 0x00, + 0x00, 0x00, 0x03, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0x0F, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0x3F, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0x7F, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0x7F, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x0F, 0xF0, + 0x00, 0x00, 0xFF, 0xFF, 0xFD, 0xFF, 0xF8, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, + 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, + 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, + 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, + 0x7F, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x7F, 0xFC, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x1F, 0x80, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFE, 0x3F, 0xF8, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, + 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xC0, + 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFE, 0x00, + 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xE0, 0x00, + 0x00, 0x00, 0x07, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00 +}; diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 6dd0658..8e7e7ec 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. #define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -380,30 +362,23 @@ //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -420,20 +395,15 @@ // @section extruder -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -488,10 +458,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -510,53 +481,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -625,16 +553,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -685,7 +603,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -696,7 +613,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -715,9 +632,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -755,16 +669,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -788,10 +699,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -827,6 +734,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -840,8 +750,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -874,7 +782,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -882,7 +790,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -890,23 +798,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -954,12 +857,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -982,12 +879,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -999,10 +896,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 180 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1025,6 +925,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1033,23 +944,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1058,21 +973,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1084,11 +986,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1362,11 +1259,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1394,6 +1291,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1420,28 +1330,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1493,18 +1394,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1522,6 +1417,40 @@ // //#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 @@ -1530,6 +1459,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1537,28 +1488,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1574,13 +1530,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1605,83 +1560,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1697,16 +1575,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1722,13 +1608,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1738,40 +1617,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1831,7 +1681,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1896,7 +1746,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index e4deace..778c8e0 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 4fc761a..00c8993 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. #define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -380,30 +362,23 @@ //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -420,20 +395,15 @@ // @section extruder -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -488,10 +458,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -510,53 +481,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -625,16 +553,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -685,7 +603,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -696,7 +613,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -715,9 +632,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -755,16 +669,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -788,10 +699,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -827,6 +734,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -840,8 +750,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -874,7 +782,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -882,7 +790,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -890,23 +798,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -954,12 +857,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -982,12 +879,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -999,10 +896,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 180 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1025,6 +925,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1033,23 +944,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1058,21 +973,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1084,11 +986,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1362,11 +1259,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1394,6 +1291,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1420,28 +1330,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1493,18 +1394,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1522,6 +1417,40 @@ // //#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 @@ -1530,6 +1459,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1537,28 +1488,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1574,13 +1530,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1605,83 +1560,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1697,16 +1575,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1722,13 +1608,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1738,40 +1617,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1831,7 +1681,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1896,7 +1746,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h index f09bd99..ae48f44 100644 --- a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h +++ b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -129,7 +124,7 @@ // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message -#define CUSTOM_MACHINE_NAME "FT-2020 v9" +#define CUSTOM_MACHINE_NAME "FT-2020" // 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) @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,54 +355,47 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // FolgerTech i3-2020 - #define DEFAULT_Kp 11.50 - #define DEFAULT_Ki 0.50 - #define DEFAULT_Kd 60.00 + #define DEFAULT_Kp 11.50 + #define DEFAULT_Ki 0.50 + #define DEFAULT_Kd 60.00 // Ultimaker - //#define DEFAULT_Kp 22.2 - //#define DEFAULT_Ki 1.08 - //#define DEFAULT_Kd 114 + //#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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -429,35 +404,30 @@ //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 250.0 - #define DEFAULT_bedKi 18.0 - #define DEFAULT_bedKd 950.0 + #define DEFAULT_bedKp 250.0 + #define DEFAULT_bedKi 18.0 + #define DEFAULT_bedKd 950.0 //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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -512,10 +482,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -534,53 +505,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -606,8 +534,7 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -//#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 52.2 } // 52.4 is correct for printer as shipped -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 104.4 } // 104.4 with 32 micro steps enabled gives better results +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 52.2 } /** * Default Max Feed Rate (mm/s) @@ -649,16 +576,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 4.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -709,7 +626,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -720,7 +636,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. #define Z_SERVO_ANGLES {40,85} // Z Servo Deploy and Stow angles /** @@ -739,9 +655,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -777,18 +690,14 @@ */ #define X_PROBE_OFFSET_FROM_EXTRUDER 38 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -7 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -10.75 // Z offset: -below +above [the nozzle] - -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 0 +#define Z_PROBE_OFFSET_FROM_EXTRUDER -10.4 // Z offset: -below +above [the nozzle] // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 7500 - -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -812,10 +721,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 3 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 3 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 3 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -850,6 +755,8 @@ #define INVERT_X_DIR false #define INVERT_Y_DIR true #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA // @section extruder @@ -864,8 +771,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - #define Z_HOMING_HEIGHT 2 // (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. @@ -878,15 +783,15 @@ // @section machine // The size of the print bed -#define X_BED_SIZE (X_MAX_POS-X_MIN_POS) -#define Y_BED_SIZE (Y_MAX_POS-Y_MIN_POS) +#define X_BED_SIZE 207 +#define Y_BED_SIZE 182 // Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 6 #define Y_MIN_POS 3 #define Z_MIN_POS 0 -#define X_MAX_POS 207 -#define Y_MAX_POS 182 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 175 /** @@ -898,7 +803,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds //#define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -906,7 +811,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -914,23 +819,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -978,12 +878,6 @@ #define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1000,18 +894,18 @@ // For Cartesian machines, instead of dividing moves on mesh boundaries, // split up moves into short segments like a Delta. This follows the // contours of the bed more closely than edge-to-edge straight moves. -//#define SEGMENT_LEVELED_MOVES + #define SEGMENT_LEVELED_MOVES #define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one) /** * Enable the G26 Mesh Validation Pattern tool. */ - #define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1023,10 +917,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 39 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 10 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1049,6 +946,19 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 arbitrary points to probe. + // A simple cross-product is used to estimate the plane of the bed. + #define ABL_PROBE_PT_1_X 39 + #define ABL_PROBE_PT_1_Y 170 + #define ABL_PROBE_PT_2_X 39 + #define ABL_PROBE_PT_2_Y 10 + #define ABL_PROBE_PT_3_X 170 + #define ABL_PROBE_PT_3_Y 10 + + + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1057,23 +967,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 0 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. - #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_Y 10 + + #define UBL_PROBE_PT_1_X 45 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 170 + #define UBL_PROBE_PT_2_X 45 + #define UBL_PROBE_PT_2_Y 25 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 25 #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - #define UBL_Z_RAISE_WHEN_OFF_MESH 2.50// When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1082,21 +996,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - #define PROBE_PT_1_X 45 - #define PROBE_PT_1_Y 170 - #define PROBE_PT_2_X 45 - #define PROBE_PT_2_Y 25 - #define PROBE_PT_3_X 180 - #define PROBE_PT_3_Y 25 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1108,11 +1009,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1386,11 +1282,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1418,6 +1314,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1444,28 +1353,19 @@ */ #define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1517,18 +1417,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1546,6 +1440,40 @@ // //#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 @@ -1554,6 +1482,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1561,28 +1511,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1598,13 +1553,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1629,83 +1583,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1721,16 +1598,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1746,13 +1631,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1762,40 +1640,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1855,7 +1704,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1920,7 +1769,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 500, 500 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. #define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h index e71dfdf..d700c25 100644 --- a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h +++ b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - #define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ #define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - #define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + #define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,37 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ -#define MAX7219_DEBUG +//#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) -#define MAX7219_CLK_PIN 64 // on RAMPS // Configuration of the 3 pins to control the display -#define MAX7219_DIN_PIN 57 // on RAMPS -#define MAX7219_LOAD_PIN 44 // on RAMPS + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM -//#define MAX7219_CLK_PIN 77 // on Re-ARM // Configuration of the 3 pins to control the display -//#define MAX7219_DIN_PIN 78 // on Re-ARM -//#define MAX7219_LOAD_PIN 79 // on Re-ARM - -//#define MAX7219_CLK_PIN 30 // for RAMPS E1 // Configuration of the 3 pins to control the display -//#define MAX7219_DIN_PIN 34 // for RAMPS E1 -//#define MAX7219_LOAD_PIN 36 // for RAMPS E1 - - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 2 // Number of Max7219 units in chain. - #define MAX7219_ROTATE -90 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1656,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Geeetech/GT2560/Configuration.h b/Marlin/example_configurations/Geeetech/GT2560/Configuration.h index 015129f..7c50253 100644 --- a/Marlin/example_configurations/Geeetech/GT2560/Configuration.h +++ b/Marlin/example_configurations/Geeetech/GT2560/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -371,61 +353,54 @@ // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. // Geeetech MK8 Extruder - #define DEFAULT_Kp 12.33 - #define DEFAULT_Ki 0.51 - #define DEFAULT_Kd 74.50 + #define DEFAULT_Kp 12.33 + #define DEFAULT_Ki 0.51 + #define DEFAULT_Kd 74.50 // CTC MK8 Extruder - //#define DEFAULT_Kp 19.86 - //#define DEFAULT_Ki 1.0 - //#define DEFAULT_Kd 98.83 + //#define DEFAULT_Kp 19.86 + //#define DEFAULT_Ki 1.0 + //#define DEFAULT_Kd 98.83 // 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 + //#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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -433,41 +408,36 @@ //#define PID_BED_DEBUG // Sends debug data to the serial port. //12v (120 watt?) MK2a PCB Heatbed into 4mm borosilicate (Geeetech Prusa i3 Pro, Pro/B/C/X) - #define DEFAULT_bedKp 234.88 - #define DEFAULT_bedKi 42.79 - #define DEFAULT_bedKd 322.28 + #define DEFAULT_bedKp 234.88 + #define DEFAULT_bedKi 42.79 + #define DEFAULT_bedKd 322.28 //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 + //#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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -522,10 +492,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -544,53 +515,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -658,16 +586,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -718,7 +636,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -729,7 +646,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -748,9 +665,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -788,16 +702,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -821,10 +732,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -860,6 +767,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -873,8 +783,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -907,7 +815,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -915,7 +823,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -923,23 +831,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -987,12 +890,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1015,12 +912,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1032,10 +929,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1058,6 +958,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1066,23 +977,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1091,21 +1006,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1117,11 +1019,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1395,11 +1292,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1427,6 +1324,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1453,28 +1363,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1526,18 +1427,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1555,6 +1450,40 @@ // //#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 @@ -1563,6 +1492,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1570,28 +1521,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1607,13 +1563,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1638,83 +1593,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1730,16 +1608,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1755,13 +1641,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1771,40 +1650,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1864,7 +1714,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1929,7 +1779,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE /** @@ -1937,8 +1789,8 @@ */ #if ENABLED(ULTIMAKERCONTROLLER) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) || ENABLED(G3D_PANEL) || ENABLED(MKS_MINI_12864) #define SDSUPPORT // Force SD Card support on for these displays -#else - #define LCD_WIDTH_OVERRIDE 20 // Default is 22. For this Geeetech use 20. +#elif ENABLED(ULTRA_LCD) && ENABLED(DOGLCD) // No panel, just graphical LCD? + #define LCD_WIDTH 20 // Default is 22. For this Geeetech use 20 #endif #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h b/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h index d997f76..ca93091 100644 --- a/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -124,7 +119,7 @@ // 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_GT2560_REV_A_PLUS + #define MOTHERBOARD BOARD_ULTIMAKER #endif // Optional custom name for your RepStrap or other custom machine @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,49 +355,42 @@ // 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 + #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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -424,35 +399,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 300 @@ -507,10 +477,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -529,53 +500,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -643,16 +571,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 4.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -703,7 +621,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -714,7 +631,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 1 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 1 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {10,90} // Z Servo Deploy and Stow angles /** @@ -733,9 +650,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -773,16 +687,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 8 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -806,10 +717,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 6 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 6 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -845,6 +752,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -858,8 +768,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - #define Z_HOMING_HEIGHT 8 // (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. @@ -892,7 +800,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -900,7 +808,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -908,23 +816,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -972,12 +875,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1000,12 +897,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1017,10 +914,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 8 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1043,6 +943,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1051,23 +962,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1076,21 +991,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1102,11 +1004,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1380,11 +1277,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1412,6 +1309,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1438,28 +1348,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1511,18 +1412,12 @@ #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 #define LCD_FEEDBACK_FREQUENCY_HZ 1000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1540,6 +1435,40 @@ // //#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 @@ -1548,6 +1477,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1555,28 +1506,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1592,13 +1548,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1623,83 +1578,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1715,16 +1593,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1740,13 +1626,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1756,40 +1635,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1849,7 +1699,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1914,7 +1764,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Infitary/i3-M508/Configuration.h b/Marlin/example_configurations/Infitary/i3-M508/Configuration.h index 68c434e..c5f36bb 100644 --- a/Marlin/example_configurations/Infitary/i3-M508/Configuration.h +++ b/Marlin/example_configurations/Infitary/i3-M508/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,53 +355,46 @@ // 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 + //#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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 - #define DEFAULT_Kp 213.2 - #define DEFAULT_Ki 1.54 - #define DEFAULT_Kd 765 + #define DEFAULT_Kp 213.2 + #define DEFAULT_Ki 1.54 + #define DEFAULT_Kd 765 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -428,35 +403,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -511,10 +481,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -525,61 +496,18 @@ #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 probe. - -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 +#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 probe. // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -647,16 +575,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -707,7 +625,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -718,7 +635,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -737,9 +654,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -777,16 +691,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -810,10 +721,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -849,6 +756,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -862,8 +772,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -896,7 +804,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -904,7 +812,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -912,23 +820,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -976,12 +879,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1004,12 +901,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1021,10 +918,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1047,6 +947,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1055,23 +966,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1080,21 +995,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1106,11 +1008,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1384,11 +1281,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1416,6 +1313,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1442,28 +1352,19 @@ */ #define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1515,18 +1416,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1544,6 +1439,40 @@ // //#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 @@ -1552,6 +1481,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1559,28 +1510,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1596,13 +1552,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1627,83 +1582,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1719,16 +1597,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1744,13 +1630,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1760,40 +1639,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1853,7 +1703,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1918,7 +1768,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h b/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h index 542df5b..4715634 100644 --- a/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Malyan/M150/Configuration.h b/Marlin/example_configurations/Malyan/M150/Configuration.h index cf8897b..3b199e0 100644 --- a/Marlin/example_configurations/Malyan/M150/Configuration.h +++ b/Marlin/example_configurations/Malyan/M150/Configuration.h @@ -42,7 +42,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -81,30 +81,25 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(Gunther)" // 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 WEBSITE_URL // will be shown during bootup in line 2 +//#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 +//#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -129,7 +124,7 @@ // 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_MELZI_MALYAN + #define MOTHERBOARD BOARD_MELZI #endif // Optional custom name for your RepStrap or other custom machine @@ -206,11 +201,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -242,15 +237,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -264,7 +250,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -273,8 +258,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -284,7 +268,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -306,7 +289,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -317,7 +300,6 @@ // For Malyan M150, some discussions around changing the TEMP_SENSOR_BED from 1 to 3 on a french discussion board. // The reasons are inconclusive so I leave at 1 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -367,7 +349,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -381,49 +363,42 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Malyan M150 example - #define DEFAULT_Kp 29 - #define DEFAULT_Ki 2 - #define DEFAULT_Kd 97 + #define DEFAULT_Kp 29 + #define DEFAULT_Ki 2 + #define DEFAULT_Kd 97 // MakerGear - //#define DEFAULT_Kp 7.0 - //#define DEFAULT_Ki 0.1 - //#define DEFAULT_Kd 12 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -432,35 +407,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -515,10 +485,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -530,61 +501,18 @@ // 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. - -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 +#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. // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -663,16 +591,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -723,7 +641,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -734,7 +651,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -753,9 +670,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -797,16 +711,13 @@ //#define Y_PROBE_OFFSET_FROM_EXTRUDER -50 // Y offset: -front +behind [the nozzle] //#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes //#define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) //#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point //#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -830,10 +741,6 @@ */ //#define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow //#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset //#define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -869,6 +776,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -882,8 +792,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -916,7 +824,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -924,7 +832,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -932,23 +840,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -1000,12 +903,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1028,12 +925,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1045,10 +942,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 50 - //#define RIGHT_PROBE_BED_POSITION 150 - //#define FRONT_PROBE_BED_POSITION 50 - //#define BACK_PROBE_BED_POSITION 150 + #define LEFT_PROBE_BED_POSITION 50 + #define RIGHT_PROBE_BED_POSITION 150 + #define FRONT_PROBE_BED_POSITION 50 + #define BACK_PROBE_BED_POSITION 150 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1071,6 +971,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 arbitrary points to probe. + // A simple cross-product is used to estimate the plane of the bed. + #define ABL_PROBE_PT_1_X 50 + #define ABL_PROBE_PT_1_Y 150 + #define ABL_PROBE_PT_2_X 50 + #define ABL_PROBE_PT_2_Y 50 + #define ABL_PROBE_PT_3_X 150 + #define ABL_PROBE_PT_3_Y 50 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1079,23 +990,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1104,21 +1019,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - #define PROBE_PT_1_X 50 - #define PROBE_PT_1_Y 150 - #define PROBE_PT_2_X 50 - #define PROBE_PT_2_Y 50 - #define PROBE_PT_3_X 150 - #define PROBE_PT_3_Y 50 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1130,11 +1032,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1408,11 +1305,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1440,6 +1337,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1466,28 +1376,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1539,18 +1440,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1568,6 +1463,40 @@ // //#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 @@ -1576,6 +1505,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1583,28 +1534,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1620,13 +1576,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1651,83 +1606,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1743,16 +1621,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1768,13 +1654,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1784,40 +1663,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1877,7 +1727,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1942,7 +1792,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Malyan/M150/Configuration_adv.h b/Marlin/example_configurations/Malyan/M150/Configuration_adv.h index a7a2824..c46e7f7 100644 --- a/Marlin/example_configurations/Malyan/M150/Configuration_adv.h +++ b/Marlin/example_configurations/Malyan/M150/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 #define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Malyan/M150/README.md b/Marlin/example_configurations/Malyan/M150/README.md index 6183603..1d31177 100644 --- a/Marlin/example_configurations/Malyan/M150/README.md +++ b/Marlin/example_configurations/Malyan/M150/README.md @@ -1,55 +1,3 @@ -# Configuration for Malyan M150 HobbyKing printer - -Config without automatic bed level sensor, or in other words, "as stock" - -## To install: - -1. Install [Arduino](https://www.arduino.cc/en/Main/Software) - -1. Install U8glib - * `Sketch` -> `Include Library` -> `Manage Libraries...` - * Search for and install `U8glib` by oliver - -1. Install Sanguino - * `File` -> `Preferences` - * Add - `https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json` - to `Additional Boards Manager URLs` - -1. Modify Sanguino `boards.txt` - * Close Arduino - * Locate Arduino15 folder - - `C:\Users\\AppData\Local\Arduino15` for Windows - - `~/.arduino15` for Linux - - * Locate `boards.txt` in `packages/Sanguino/hardware/avr/1.0.2` - (version number may change) - * Add the following to the end of `boards.txt` - (note that it is the same as sanguino.menu.cpu.atmega1284p but with - a different name and upload speed) - - ## Malyan M150 W/ ATmega1284P 16MHz - sanguino.menu.cpu.malyan_m150=Malyan M150 - sanguino.menu.cpu.malyan_m150.upload.maximum_size=130048 - sanguino.menu.cpu.malyan_m150.upload.maximum_data_size=16384 - sanguino.menu.cpu.malyan_m150.upload.speed=57600 - sanguino.menu.cpu.malyan_m150.bootloader.file=optiboot/optiboot_atmega1284p.hex - sanguino.menu.cpu.malyan_m150.build.mcu=atmega1284p - sanguino.menu.cpu.malyan_m150.build.f_cpu=16000000L - -1. Configure Marlin - * Copy `_Bootscreen.h`, `Configuration.h`, and `Configuration_adv.h` - from `Marlin/example_configurations/Malyan/M150` to `Marlin` - (overwrite files) - * Read `Configuration.h` and make any necessary changes - -1. Flash Marlin - * Turn on printer while pressing scroll wheel button - * Plug printer in to computer with USB cable - * Open `Marlin/Marlin.ino` with Arduino - * Configure Arduino - - `Tools` -> `Board` -> `Sanguino` - - `Tools` -> `Processor` -> `Malyan M150` - - `Tools` -> `Port` -> Select your port - - * `Sketch` -> `Upload` or click arrow in top right corner +# Configuration for Malyan M150 hobbyking printer +# config without automatic bed level sensor +# or in other words, "as stock" diff --git a/Marlin/example_configurations/Malyan/M150/_Bootscreen.h b/Marlin/example_configurations/Malyan/M150/_Bootscreen.h index 678a7a1..25570b1 100644 --- a/Marlin/example_configurations/Malyan/M150/_Bootscreen.h +++ b/Marlin/example_configurations/Malyan/M150/_Bootscreen.h @@ -21,50 +21,84 @@ */ /** - * Custom Boot Screen bitmap + * Custom Bitmap for splashscreen * - * Place this file in the root with your configuration files - * and enable SHOW_CUSTOM_BOOTSCREEN in Configuration.h. + * You may use one of the following tools to generate the C++ bitmap array from + * a black and white image: * - * Use the Marlin Bitmap Converter to make your own: - * http://marlinfw.org/tools/u8glib/converter.html + * - http://www.marlinfw.org/tools/u8glib/converter.html + * - http://www.digole.com/tools/PicturetoC_Hex_converter.php */ +#include #define CUSTOM_BOOTSCREEN_TIMEOUT 1000 #define CUSTOM_BOOTSCREEN_BMPWIDTH 128 +#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 + +const unsigned char custom_start_bmp[1024] PROGMEM = { + 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 +,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 +,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 +,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 +,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +,0x07,0x00,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +,0x1f,0xc0,0x00,0x0f,0xe0,0x7c,0x03,0xe0,0x78,0x1c,0x07,0x81,0xe0,0xf0,0x3e,0x0e +,0x7f,0xe0,0x00,0x3f,0xf0,0x7e,0x07,0xe0,0xfc,0x1c,0x03,0x81,0xc1,0xf8,0x3f,0x0e +,0x7f,0xf8,0x00,0x7f,0xf0,0x7e,0x07,0xe0,0xfc,0x1c,0x03,0xc3,0xc1,0xf8,0x3f,0x0e +,0x7b,0xfe,0x01,0xfe,0xf0,0x7f,0x0f,0xe1,0xfe,0x1c,0x01,0xc3,0x83,0xfc,0x3f,0x8e +,0x7c,0xff,0x87,0xf9,0xf0,0x77,0x0e,0xe1,0xfe,0x1c,0x01,0xe7,0x83,0xfc,0x3b,0x8e +,0x7f,0x7f,0xcf,0xf7,0xf0,0x77,0x9e,0xe1,0xce,0x1c,0x00,0xe7,0x03,0x9c,0x3b,0xce +,0x7f,0x9f,0xff,0xcf,0xf0,0x73,0x9c,0xe3,0xcf,0x1c,0x00,0xff,0x07,0x9e,0x39,0xce +,0x7f,0xe7,0xff,0x3f,0xf0,0x73,0xfc,0xe3,0x87,0x1c,0x00,0x7e,0x07,0x0e,0x39,0xee +,0x7f,0xfb,0xfe,0xff,0xf0,0x71,0xf8,0xe3,0x87,0x1c,0x00,0x7e,0x0f,0x0f,0x38,0xee +,0x7f,0xfc,0xf9,0xff,0xf0,0x71,0xf8,0xe7,0xff,0x9c,0x00,0x3c,0x0f,0xff,0x38,0xfe +,0x7f,0xff,0x27,0xff,0xf0,0x70,0xf0,0xe7,0xff,0x9c,0x00,0x3c,0x0f,0xff,0x38,0x7e +,0x7f,0xff,0xdf,0xff,0xf0,0x70,0xf0,0xef,0xff,0xdc,0x00,0x3c,0x1f,0xff,0xb8,0x7e +,0x7f,0xdf,0xff,0xdf,0xf0,0x70,0x60,0xef,0x03,0xdf,0xf8,0x3c,0x1e,0x07,0xb8,0x3e +,0x7f,0xc7,0xff,0x1f,0xf0,0x70,0x60,0xee,0x01,0xdf,0xf8,0x3c,0x1c,0x03,0xb8,0x3e +,0x7f,0xc3,0xfe,0x1f,0xf0,0x70,0x00,0xee,0x01,0xdf,0xf8,0x3c,0x1c,0x03,0xb8,0x1e +,0x7f,0xc3,0xfe,0x1f,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +,0x7f,0xc3,0xde,0x1f,0xf0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe +,0x7f,0xc3,0xde,0x1f,0xf0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe +,0x7f,0xc3,0xde,0x1f,0xf0,0x7c,0x3f,0xfa,0xfb,0xff,0xff,0xff,0xfd,0x7a,0xbf,0xfe +,0x7f,0xc3,0xde,0x1f,0xf0,0x7d,0x9f,0xfb,0xff,0xff,0xff,0xff,0xff,0x7e,0xf7,0xfe +,0x7f,0xc3,0xde,0x1f,0xf0,0x7d,0x93,0x1a,0x8a,0x18,0xe3,0x8c,0x45,0x1a,0xa2,0xde +,0x3f,0xc3,0xde,0x0f,0xf0,0x7c,0x2d,0xca,0xca,0xd6,0xe9,0x24,0xcd,0x6a,0xb6,0xbe +,0x1f,0x83,0xde,0x07,0xe0,0x7d,0xa3,0x6a,0x9a,0xd6,0xe9,0x26,0x65,0x6a,0xb6,0x3e +,0x06,0x03,0xde,0x01,0x80,0x7d,0x91,0x0a,0x8a,0xd8,0xe3,0x8c,0x45,0x1a,0xb3,0x7e +,0x00,0x03,0xde,0x00,0x00,0x7f,0xff,0xff,0xff,0xfe,0xef,0xff,0xff,0xff,0xff,0x7e +,0x00,0x03,0xde,0x00,0x00,0x7f,0xff,0xff,0xff,0xf1,0xef,0xff,0xff,0xff,0xfe,0xfe +,0x00,0x03,0xde,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe +,0x00,0x03,0xde,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe +,0x00,0x03,0xde,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +,0x00,0x01,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +,0x00,0x00,0x50,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,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,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,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 -const unsigned char custom_start_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000111,B00000000,B00000000,B00000011,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00011111,B11000000,B00000000,B00001111,B11100000,B01111100,B00000011,B11100000,B01111000,B00011100,B00000111,B10000001,B11100000,B11110000,B00111110,B00001110, - B01111111,B11100000,B00000000,B00111111,B11110000,B01111110,B00000111,B11100000,B11111100,B00011100,B00000011,B10000001,B11000001,B11111000,B00111111,B00001110, - B01111111,B11111000,B00000000,B01111111,B11110000,B01111110,B00000111,B11100000,B11111100,B00011100,B00000011,B11000011,B11000001,B11111000,B00111111,B00001110, - B01111011,B11111110,B00000001,B11111110,B11110000,B01111111,B00001111,B11100001,B11111110,B00011100,B00000001,B11000011,B10000011,B11111100,B00111111,B10001110, - B01111100,B11111111,B10000111,B11111001,B11110000,B01110111,B00001110,B11100001,B11111110,B00011100,B00000001,B11100111,B10000011,B11111100,B00111011,B10001110, - B01111111,B01111111,B11001111,B11110111,B11110000,B01110111,B10011110,B11100001,B11001110,B00011100,B00000000,B11100111,B00000011,B10011100,B00111011,B11001110, - B01111111,B10011111,B11111111,B11001111,B11110000,B01110011,B10011100,B11100011,B11001111,B00011100,B00000000,B11111111,B00000111,B10011110,B00111001,B11001110, - B01111111,B11100111,B11111111,B00111111,B11110000,B01110011,B11111100,B11100011,B10000111,B00011100,B00000000,B01111110,B00000111,B00001110,B00111001,B11101110, - B01111111,B11111011,B11111110,B11111111,B11110000,B01110001,B11111000,B11100011,B10000111,B00011100,B00000000,B01111110,B00001111,B00001111,B00111000,B11101110, - B01111111,B11111100,B11111001,B11111111,B11110000,B01110001,B11111000,B11100111,B11111111,B10011100,B00000000,B00111100,B00001111,B11111111,B00111000,B11111110, - B01111111,B11111111,B00100111,B11111111,B11110000,B01110000,B11110000,B11100111,B11111111,B10011100,B00000000,B00111100,B00001111,B11111111,B00111000,B01111110, - B01111111,B11111111,B11011111,B11111111,B11110000,B01110000,B11110000,B11101111,B11111111,B11011100,B00000000,B00111100,B00011111,B11111111,B10111000,B01111110, - B01111111,B11011111,B11111111,B11011111,B11110000,B01110000,B01100000,B11101111,B00000011,B11011111,B11111000,B00111100,B00011110,B00000111,B10111000,B00111110, - B01111111,B11000111,B11111111,B00011111,B11110000,B01110000,B01100000,B11101110,B00000001,B11011111,B11111000,B00111100,B00011100,B00000011,B10111000,B00111110, - B01111111,B11000011,B11111110,B00011111,B11110000,B01110000,B00000000,B11101110,B00000001,B11011111,B11111000,B00111100,B00011100,B00000011,B10111000,B00011110, - B01111111,B11000011,B11111110,B00011111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01111111,B11000011,B11011110,B00011111,B11110000,B01111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111110, - B01111111,B11000011,B11011110,B00011111,B11110000,B01111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111110, - B01111111,B11000011,B11011110,B00011111,B11110000,B01111100,B00111111,B11111010,B11111011,B11111111,B11111111,B11111111,B11111101,B01111010,B10111111,B11111110, - B01111111,B11000011,B11011110,B00011111,B11110000,B01111101,B10011111,B11111011,B11111111,B11111111,B11111111,B11111111,B11111111,B01111110,B11110111,B11111110, - B01111111,B11000011,B11011110,B00011111,B11110000,B01111101,B10010011,B00011010,B10001010,B00011000,B11100011,B10001100,B01000101,B00011010,B10100010,B11011110, - B00111111,B11000011,B11011110,B00001111,B11110000,B01111100,B00101101,B11001010,B11001010,B11010110,B11101001,B00100100,B11001101,B01101010,B10110110,B10111110, - B00011111,B10000011,B11011110,B00000111,B11100000,B01111101,B10100011,B01101010,B10011010,B11010110,B11101001,B00100110,B01100101,B01101010,B10110110,B00111110, - B00000110,B00000011,B11011110,B00000001,B10000000,B01111101,B10010001,B00001010,B10001010,B11011000,B11100011,B10001100,B01000101,B00011010,B10110011,B01111110, - B00000000,B00000011,B11011110,B00000000,B00000000,B01111111,B11111111,B11111111,B11111111,B11111110,B11101111,B11111111,B11111111,B11111111,B11111111,B01111110, - B00000000,B00000011,B11011110,B00000000,B00000000,B01111111,B11111111,B11111111,B11111111,B11110001,B11101111,B11111111,B11111111,B11111111,B11111110,B11111110, - B00000000,B00000011,B11011110,B00000000,B00000000,B01111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111110, - B00000000,B00000011,B11011110,B00000000,B00000000,B01111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111110, - B00000000,B00000011,B11011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B11011100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, }; diff --git a/Marlin/example_configurations/Micromake/C1/basic/Configuration.h b/Marlin/example_configurations/Micromake/C1/basic/Configuration.h index b11a3dc..65294b6 100644 --- a/Marlin/example_configurations/Micromake/C1/basic/Configuration.h +++ b/Marlin/example_configurations/Micromake/C1/basic/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,49 +355,42 @@ // 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 + #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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -424,35 +399,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -507,10 +477,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -529,53 +500,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -647,16 +575,6 @@ #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -707,7 +625,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -718,7 +635,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -737,9 +654,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -777,16 +691,13 @@ #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -810,10 +721,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -849,6 +756,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -862,8 +772,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -896,7 +804,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -904,7 +812,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -912,23 +820,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -976,12 +879,6 @@ //#define AUTO_BED_LEVELING_UBL #define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1004,12 +901,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1021,10 +918,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1047,6 +947,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1055,23 +966,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1080,21 +995,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ #define LCD_BED_LEVELING @@ -1106,11 +1008,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1384,11 +1281,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1416,6 +1313,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1442,28 +1352,19 @@ */ #define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1515,18 +1416,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1544,6 +1439,40 @@ // //#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 @@ -1552,6 +1481,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1559,28 +1510,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1596,13 +1552,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1627,83 +1582,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1719,16 +1597,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1744,13 +1630,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1760,40 +1639,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1853,7 +1703,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1918,7 +1768,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h index 86ca7f4..b21eebc 100644 --- a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h +++ b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,49 +355,42 @@ // 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 + #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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -424,35 +399,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -507,10 +477,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -523,59 +494,16 @@ // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). #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 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 true // set to true to invert the logic of the probe. - -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe. // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -647,16 +575,6 @@ #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -707,7 +625,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -718,7 +635,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -737,9 +654,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -777,16 +691,13 @@ #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -810,10 +721,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -849,6 +756,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -862,8 +772,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -896,7 +804,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -904,7 +812,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -912,23 +820,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -976,12 +879,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1004,12 +901,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1021,10 +918,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1047,6 +947,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1055,23 +966,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1080,21 +995,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1106,11 +1008,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1384,13 +1281,13 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ -#define LCD_LANGUAGE en +#define LCD_LANGUAGE fr /** * LCD Character Set @@ -1416,6 +1313,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1442,28 +1352,19 @@ */ #define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1515,18 +1416,12 @@ #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 #define LCD_FEEDBACK_FREQUENCY_HZ 1000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1544,6 +1439,40 @@ // //#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 @@ -1552,6 +1481,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1559,28 +1510,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1596,13 +1552,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1627,83 +1582,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1719,16 +1597,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1744,13 +1630,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1760,40 +1639,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1853,7 +1703,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1918,7 +1768,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h index 5d548ff..db90655 100644 --- a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h +++ b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -576,6 +509,7 @@ #define SD_DETECT_INVERTED #define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. // Reverse SD sort to show "more recent" files first, according to the card's FAT. @@ -585,20 +519,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +557,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +596,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +611,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +632,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +671,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +752,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +879,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +973,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1067,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1115,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1137,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1149,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1483,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1495,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1527,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1537,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1575,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 750e113..ea6607a 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -116,7 +111,7 @@ * * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] */ -#define BAUDRATE 115200 +#define BAUDRATE 250000 // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,49 +355,42 @@ // 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 + #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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -424,35 +399,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -507,10 +477,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -527,55 +498,12 @@ #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 probe. - -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe. // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -643,16 +571,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -703,7 +621,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -714,7 +631,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -733,9 +650,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -773,16 +687,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -806,10 +717,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -845,6 +752,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -858,8 +768,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -892,7 +800,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -900,7 +808,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -908,23 +816,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -972,12 +875,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1000,12 +897,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1017,10 +914,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1043,6 +943,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1051,23 +962,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1076,21 +991,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1102,11 +1004,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1380,11 +1277,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1412,6 +1309,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1438,28 +1348,19 @@ */ #define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1511,18 +1412,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1540,6 +1435,40 @@ // //#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 @@ -1548,6 +1477,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1555,28 +1506,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1592,13 +1548,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1623,83 +1578,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1715,16 +1593,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1740,13 +1626,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1756,40 +1635,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 1.0 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1849,7 +1699,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1914,7 +1764,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index b41d1e0..4da0058 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -204,11 +199,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -240,15 +235,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -262,7 +248,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -271,8 +256,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -282,7 +266,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -304,7 +287,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -312,7 +295,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -362,7 +344,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -376,49 +358,42 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Rigidbot hotend - #define DEFAULT_Kp 16.17 - #define DEFAULT_Ki 0.85 - #define DEFAULT_Kd 76.55 + #define DEFAULT_Kp 16.17 + #define DEFAULT_Ki 0.85 + #define DEFAULT_Kd 76.55 // Base DGlass3D/E3Dv6 hotend - //#define DEFAULT_Kp 10 - //#define DEFAULT_Ki 0.85 - //#define DEFAULT_Kd 245 + //#define DEFAULT_Kp 10 + //#define DEFAULT_Ki 0.85 + //#define DEFAULT_Kd 245 // E3D w/ rigidbot cartridge - //#define DEFAULT_Kp 16.30 - //#define DEFAULT_Ki 0.95 - //#define DEFAULT_Kd 69.69 + //#define DEFAULT_Kp 16.30 + //#define DEFAULT_Ki 0.95 + //#define DEFAULT_Kd 69.69 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -426,29 +401,24 @@ //#define PID_BED_DEBUG // Sends debug data to the serial port. //RigidBot, from pid autotune - #define DEFAULT_bedKp 355 - #define DEFAULT_bedKi 66.5 - #define DEFAULT_bedKd 480 + #define DEFAULT_bedKp 355 + #define DEFAULT_bedKi 66.5 + #define DEFAULT_bedKd 480 // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #endif // PIDTEMPBED // @section extruder -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -503,10 +473,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -523,55 +494,12 @@ #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 probe. - -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe. // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -641,16 +569,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -701,7 +619,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -712,7 +629,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -731,9 +648,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -771,16 +685,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -804,10 +715,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -843,6 +750,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -856,8 +766,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -890,7 +798,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -898,7 +806,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -906,23 +814,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -970,12 +873,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -998,12 +895,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1015,10 +912,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1041,6 +941,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1049,23 +960,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1074,21 +989,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1100,11 +1002,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1378,11 +1275,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1410,6 +1307,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1436,28 +1346,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1509,18 +1410,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1538,6 +1433,40 @@ // //#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 @@ -1546,6 +1475,30 @@ // //#define G3D_PANEL +// +// RepRapDiscount FULL GRAPHIC Smart Controller +// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller +// +// RigidBoard: To rewire this for a RigidBot see http://rigidtalk.com/wiki/index.php?title=LCD_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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1553,28 +1506,33 @@ #define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1590,13 +1548,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1621,85 +1578,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -// RigidBoard: To rewire this for a RigidBot see http://rigidtalk.com/wiki/index.php?title=LCD_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1715,16 +1593,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1740,13 +1626,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1756,40 +1635,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1849,7 +1699,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1914,7 +1764,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 98e3f74..fdcac90 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 9425e9a..e92e11d 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -72,9 +72,8 @@ //#define MAKERARM_SCARA #if ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA) - //#define DEBUG_SCARA_KINEMATICS - #define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly + //#define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly // If movement is choppy try lowering this value #define SCARA_SEGMENTS_PER_SECOND 200 @@ -110,27 +109,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -232,11 +226,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -268,15 +262,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -290,7 +275,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -299,8 +283,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -310,7 +293,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -332,7 +314,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -340,7 +322,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -390,7 +371,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -402,39 +383,32 @@ // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. // Merlin Hotend: From Autotune - #define DEFAULT_Kp 24.5 - #define DEFAULT_Ki 1.72 - #define DEFAULT_Kd 87.73 + #define DEFAULT_Kp 24.5 + #define DEFAULT_Ki 1.72 + #define DEFAULT_Kd 87.73 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -443,29 +417,24 @@ //12v Heatbed Mk3 12V in parallel //from pidautotune - #define DEFAULT_bedKp 630.14 - #define DEFAULT_bedKi 121.71 - #define DEFAULT_bedKd 815.64 + #define DEFAULT_bedKp 630.14 + #define DEFAULT_bedKi 121.71 + #define DEFAULT_bedKd 815.64 // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #endif // PIDTEMPBED // @section extruder -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -513,23 +482,24 @@ // 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 +#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 -// Enable pullup for all endstops to prevent a floating state -//#define ENDSTOPPULLUPS #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually - #define ENDSTOPPULLUP_XMAX - #define ENDSTOPPULLUP_YMAX - //#define ENDSTOPPULLUP_ZMAX // open pin, inverted - //#define ENDSTOPPULLUP_XMIN // open pin, inverted - //#define ENDSTOPPULLUP_YMIN // open pin, inverted - #define ENDSTOPPULLUP_ZMIN + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined + //#define ENDSTOPPULLUP_XMAX + //#define ENDSTOPPULLUP_YMAX + #define ENDSTOPPULLUP_ZMAX // open pin, inverted + #define ENDSTOPPULLUP_XMIN // open pin, inverted + #define ENDSTOPPULLUP_YMIN // open pin, inverted + //#define ENDSTOPPULLUP_ZMIN //#define ENDSTOPPULLUP_ZMIN_PROBE #endif @@ -540,55 +510,12 @@ #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 probe. - -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe. // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -656,16 +583,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 3.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -716,7 +633,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -727,7 +643,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -746,9 +662,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -786,16 +699,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -819,10 +729,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -858,6 +764,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -871,8 +780,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -905,7 +812,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -913,7 +820,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -921,23 +828,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -985,12 +887,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1013,12 +909,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1030,10 +926,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1056,6 +955,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1064,23 +974,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1089,21 +1003,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1115,11 +1016,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1393,11 +1289,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1425,6 +1321,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1451,28 +1360,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1524,18 +1424,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1553,6 +1447,40 @@ // //#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 @@ -1561,6 +1489,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1568,28 +1518,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1605,13 +1560,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1636,83 +1590,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1728,16 +1605,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1753,13 +1638,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1769,40 +1647,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1862,7 +1711,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1927,7 +1776,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 60f11d9..8909af8 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 3000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Sanguinololu/Configuration.h b/Marlin/example_configurations/Sanguinololu/Configuration.h index 1beddbc..2ffe002 100644 --- a/Marlin/example_configurations/Sanguinololu/Configuration.h +++ b/Marlin/example_configurations/Sanguinololu/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,49 +355,42 @@ // 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 + #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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -424,35 +399,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -507,10 +477,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -529,53 +500,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -674,16 +602,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -734,7 +652,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -745,7 +662,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -764,9 +681,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -804,16 +718,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -837,10 +748,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -876,6 +783,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -889,8 +799,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - #define Z_HOMING_HEIGHT 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. @@ -923,7 +831,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -931,7 +839,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -939,23 +847,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -1003,12 +906,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1031,12 +928,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1048,10 +945,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1074,6 +974,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1082,23 +993,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1107,21 +1022,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1133,11 +1035,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1411,11 +1308,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, 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, tr, uk, + * zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1443,6 +1340,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1469,28 +1379,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1542,18 +1443,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1571,6 +1466,40 @@ // //#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 @@ -1579,6 +1508,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1586,28 +1537,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1623,13 +1579,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1654,83 +1609,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1746,16 +1624,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1771,13 +1657,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1787,40 +1666,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1880,7 +1730,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1945,7 +1795,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Sanguinololu/Configuration_adv.h b/Marlin/example_configurations/Sanguinololu/Configuration_adv.h index 519416a..4b326e8 100644 --- a/Marlin/example_configurations/Sanguinololu/Configuration_adv.h +++ b/Marlin/example_configurations/Sanguinololu/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,21 +219,9 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed -/** - * Part-Cooling Fan Multiplexer - * - * This feature allows you to digitally multiplex the fan output. - * The multiplexer is automatically switched at tool-change. - * Set FANMUX[012]_PINs below for up to 2, 4, or 8 multiplexed fans. - */ -#define FANMUX0_PIN -1 -#define FANMUX1_PIN -1 -#define FANMUX2_PIN -1 - /** * M355 Case Light on-off / brightness */ @@ -267,10 +232,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +292,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +347,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +399,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +443,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +471,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +507,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +545,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +584,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +599,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +620,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +659,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +740,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -891,28 +778,6 @@ // :[0, 2, 4, 8, 16, 32, 64, 128, 256] #define TX_BUFFER_SIZE 0 -// Host Receive Buffer Size -// Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough. -// To use flow control, set this buffer size to at least 1024 bytes. -// :[0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048] -//#define RX_BUFFER_SIZE 1024 - -#if RX_BUFFER_SIZE >= 1024 - // Enable to have the controller send XON/XOFF control characters to - // the host to signal the RX buffer is becoming full. - //#define SERIAL_XON_XOFF -#endif - -#if ENABLED(SDSUPPORT) - // Enable this option to collect and display the maximum - // RX queue usage after transferring a file to SD. - //#define SERIAL_STATS_MAX_RX_QUEUED - - // Enable this option to collect and display the number - // of dropped bytes after a file transfer to SD. - //#define SERIAL_STATS_DROPPED_RX -#endif - // 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 @@ -980,55 +845,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +939,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1033,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1081,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1103,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1115,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1449,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1461,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1493,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1503,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1541,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/TinyBoy2/Configuration.h b/Marlin/example_configurations/TinyBoy2/Configuration.h index 5367c9f..055dbb1 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 /** * Sample configuration file for TinyBoy2 L10/L16 @@ -95,27 +95,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -223,11 +218,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -259,15 +254,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -281,7 +267,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -290,8 +275,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -301,7 +285,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -323,7 +306,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -336,7 +319,6 @@ #else #define TEMP_SENSOR_BED 0 #endif -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -386,7 +368,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -400,59 +382,52 @@ // 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 + //#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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 // TinyBoy2 Extruder - calculated with PID Autotune and tested // "M303 E0 C8 S200" - //#define DEFAULT_Kp 25.63 - //#define DEFAULT_Ki 2.66 - //#define DEFAULT_Kd 61.73 + //#define DEFAULT_Kp 25.63 + //#define DEFAULT_Ki 2.66 + //#define DEFAULT_Kd 61.73 // TinyBoy2 Extruder - same, but with fan @ 25% duty - #define DEFAULT_Kp 26.15 - #define DEFAULT_Ki 2.71 - #define DEFAULT_Kd 63.02 + #define DEFAULT_Kp 26.15 + #define DEFAULT_Ki 2.71 + #define DEFAULT_Kd 63.02 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -461,48 +436,43 @@ //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 + //#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 + //#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. // TinyBoy2 heatbed - calculated with PID Autotune and tested // "M303 E-1 C8 S75" - //#define DEFAULT_bedKp 421.80 - //#define DEFAULT_bedKi 82.51 - //#define DEFAULT_bedKd 539.06 + //#define DEFAULT_bedKp 421.80 + //#define DEFAULT_bedKi 82.51 + //#define DEFAULT_bedKd 539.06 // TinyBoy2 heatbed - same, but with fan @ 25% duty // "M303 E-1 C8 S75" - #define DEFAULT_bedKp 267.54 - #define DEFAULT_bedKi 52.34 - #define DEFAULT_bedKd 341.92 + #define DEFAULT_bedKp 267.54 + #define DEFAULT_bedKi 52.34 + #define DEFAULT_bedKd 341.92 #endif // PIDTEMPBED // @section extruder -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -558,10 +528,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -573,60 +544,17 @@ // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). #define X_MIN_ENDSTOP_INVERTING false // 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_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 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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. #define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -694,16 +622,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -754,7 +672,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -765,7 +682,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -784,9 +701,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -824,16 +738,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -857,10 +768,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -912,8 +819,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -951,7 +856,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -959,7 +864,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -967,23 +872,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -1031,12 +931,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1059,12 +953,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1076,10 +970,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1102,6 +999,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1110,23 +1018,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1135,21 +1047,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1161,11 +1060,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1439,11 +1333,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1471,6 +1365,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1497,28 +1404,19 @@ */ #define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +#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 +#define ENCODER_STEPS_PER_MENU_ITEM 1 /** * Encoder Direction Options @@ -1570,18 +1468,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1599,6 +1491,40 @@ // //#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 @@ -1607,6 +1533,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1614,28 +1562,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1651,13 +1604,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1682,83 +1634,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1774,16 +1649,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // #define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1799,13 +1682,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1815,40 +1691,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1908,7 +1755,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1973,7 +1820,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h index 76d50c2..8fdc831 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Velleman/K8200/Configuration.h b/Marlin/example_configurations/Velleman/K8200/Configuration.h index 17c1282..c3d7fe3 100644 --- a/Marlin/example_configurations/Velleman/K8200/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8200/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 /** * Sample configuration file for Vellemann K8200 @@ -95,27 +95,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -221,11 +216,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -257,15 +252,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -279,7 +265,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -288,8 +273,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -299,7 +283,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -321,7 +304,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -329,7 +312,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 5 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -379,7 +361,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -393,53 +375,46 @@ // 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 + //#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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 // Vellemann K8200 Extruder - calculated with PID Autotune and tested - #define DEFAULT_Kp 24.29 - #define DEFAULT_Ki 1.58 - #define DEFAULT_Kd 93.51 + #define DEFAULT_Kp 24.29 + #define DEFAULT_Ki 1.58 + #define DEFAULT_Kd 93.51 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -448,41 +423,36 @@ //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 + //#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 + //#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. // Vellemann K8200 PCB heatbed with standard PCU at 60 degreesC - calculated with PID Autotune and tested // from pidautotune - #define DEFAULT_bedKp 341.88 - #define DEFAULT_bedKi 25.32 - #define DEFAULT_bedKd 1153.89 + #define DEFAULT_bedKp 341.88 + #define DEFAULT_bedKi 25.32 + #define DEFAULT_bedKd 1153.89 #endif // PIDTEMPBED // @section extruder -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -537,10 +507,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -559,53 +530,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -672,16 +600,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -732,7 +650,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -743,7 +660,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -762,9 +679,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -802,16 +716,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -835,10 +746,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -874,6 +781,9 @@ #define INVERT_Y_DIR false // K8200: false #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -887,8 +797,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - // K8200: it is usual to have clamps for the glass plate on the heatbed #define Z_HOMING_HEIGHT 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. @@ -922,7 +830,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -930,7 +838,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -938,23 +846,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -1002,12 +905,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1030,12 +927,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1047,10 +944,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1073,6 +973,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1081,23 +992,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1106,21 +1021,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1132,11 +1034,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1413,11 +1310,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1445,6 +1342,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE // K8200: for Display VM8201 // this is the most common hardware +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1471,15 +1381,6 @@ */ #define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // ENCODER SETTINGS // @@ -1544,18 +1445,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1573,6 +1468,40 @@ // //#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 @@ -1581,6 +1510,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1588,28 +1539,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1625,13 +1581,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1656,83 +1611,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1748,16 +1626,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1773,13 +1659,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1789,42 +1668,8 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// -// Silvergate GLCD controller -// http://github.com/android444/Silvergate -// -//#define SILVER_GATE_GLCD_CONTROLLER - #endif // K8200_VM8201 -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1884,7 +1729,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1949,7 +1794,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h b/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h index 3c35de8..a593ca7 100644 --- a/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h @@ -41,7 +41,7 @@ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -49,17 +49,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -195,12 +184,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -211,7 +198,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -245,7 +232,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -270,10 +256,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -334,20 +316,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -394,9 +371,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -449,24 +423,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -509,8 +467,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -538,20 +495,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - #define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -581,26 +524,10 @@ #define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. - // Reverse SD sort to show "more recent" files first, according to the card's FAT. - // Since the FAT gets out of order with usage, SDCARD_SORT_ALPHA is recommended. - #define SDCARD_RATHERRECENTFIRST - - // Add an option in the menu to run all auto#.g files - //#define MENU_ADDAUTOSTART - - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif + #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 /** * Sort SD file listings in alphabetical order. @@ -640,6 +567,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 #define LONG_FILENAME_HOST_SUPPORT @@ -660,11 +606,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -680,9 +621,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -704,25 +642,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -762,29 +681,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 140 // start value for PLA on K8200 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -819,46 +762,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -983,55 +889,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1079,27 +983,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1138,16 +1077,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1196,21 +1125,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1219,22 +1147,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1247,61 +1159,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1557,7 +1493,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1569,7 +1505,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1601,7 +1537,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1611,29 +1547,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1651,7 +1585,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Velleman/K8400/Configuration.h b/Marlin/example_configurations/Velleman/K8400/Configuration.h index e71916e..02a6e6e 100644 --- a/Marlin/example_configurations/Velleman/K8400/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8400/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,49 +355,42 @@ // 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 + //#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 + //#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 + #define DEFAULT_Kp 63.0 + #define DEFAULT_Ki 2.25 + #define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -424,35 +399,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -507,10 +477,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -529,53 +500,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -643,16 +571,6 @@ #define DEFAULT_ZJERK 0.5 #define DEFAULT_EJERK 20.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -703,7 +621,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -714,7 +631,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -733,9 +650,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -773,16 +687,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -806,10 +717,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -845,6 +752,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -858,8 +768,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -873,11 +781,11 @@ // The size of the print bed #define X_BED_SIZE 200 -#define Y_BED_SIZE 180 +#define Y_BED_SIZE 200 // Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 -#define Y_MIN_POS 0 +#define Y_MIN_POS 20 #define Z_MIN_POS 0 #define X_MAX_POS X_BED_SIZE #define Y_MAX_POS Y_BED_SIZE @@ -892,7 +800,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -900,7 +808,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -908,23 +816,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -972,12 +875,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1000,12 +897,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1017,10 +914,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1043,6 +943,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1051,23 +962,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1076,21 +991,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1102,11 +1004,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1380,11 +1277,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1412,6 +1309,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1438,15 +1348,6 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // ENCODER SETTINGS // @@ -1511,18 +1412,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1540,6 +1435,40 @@ // //#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 @@ -1548,6 +1477,28 @@ // //#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/ @@ -1555,28 +1506,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1592,13 +1548,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1623,83 +1578,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1715,16 +1593,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1740,13 +1626,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1756,40 +1635,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1849,7 +1699,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1859,14 +1709,13 @@ * LED Type. Enable only one of the following two options. * */ -//#define RGB_LED // Enable for the Velleman RGB LED Add-on. https://www.velleman.eu/products/view/?id=430100 +//#define RGB_LED //#define RGBW_LED #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) - // Pin defines for the RGB LED Add-on. - #define RGB_LED_R_PIN 41 - #define RGB_LED_G_PIN 40 - #define RGB_LED_B_PIN 12 + #define RGB_LED_R_PIN 34 + #define RGB_LED_G_PIN 43 + #define RGB_LED_B_PIN 35 #define RGB_LED_W_PIN -1 #endif @@ -1915,7 +1764,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h b/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h index 527c82b..19d0433 100644 --- a/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 1000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 5 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 600 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 100 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 100 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h index f5fb4e7..17c20aa 100644 --- a/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,49 +355,42 @@ // 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 + //#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 + //#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 + #define DEFAULT_Kp 63.0 + #define DEFAULT_Ki 2.25 + #define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -424,35 +399,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -507,10 +477,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -529,53 +500,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -643,16 +571,6 @@ #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 20.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -703,7 +621,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -714,7 +631,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -733,9 +650,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -773,16 +687,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -806,10 +717,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -845,6 +752,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -858,8 +768,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -873,11 +781,11 @@ // The size of the print bed #define X_BED_SIZE 200 -#define Y_BED_SIZE 180 +#define Y_BED_SIZE 200 // Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 -#define Y_MIN_POS 0 +#define Y_MIN_POS 20 #define Z_MIN_POS 0 #define X_MAX_POS X_BED_SIZE #define Y_MAX_POS Y_BED_SIZE @@ -892,7 +800,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -900,7 +808,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -908,23 +816,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -972,12 +875,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1000,12 +897,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1017,10 +914,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1043,6 +943,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1051,23 +962,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1076,21 +991,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1102,11 +1004,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1380,11 +1277,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1412,6 +1309,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1438,15 +1348,6 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // ENCODER SETTINGS // @@ -1511,18 +1412,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1540,6 +1435,40 @@ // //#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 @@ -1548,6 +1477,28 @@ // //#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/ @@ -1555,28 +1506,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1592,13 +1548,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1623,83 +1578,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1715,16 +1593,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1740,13 +1626,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1756,40 +1635,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1849,7 +1699,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1859,14 +1709,13 @@ * LED Type. Enable only one of the following two options. * */ -//#define RGB_LED // Enable for the Velleman RGB LED Add-on. https://www.velleman.eu/products/view/?id=430100 +//#define RGB_LED //#define RGBW_LED #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) - // Pin defines for the RGB LED Add-on. - #define RGB_LED_R_PIN 41 - #define RGB_LED_G_PIN 40 - #define RGB_LED_B_PIN 12 + #define RGB_LED_R_PIN 34 + #define RGB_LED_G_PIN 43 + #define RGB_LED_B_PIN 35 #define RGB_LED_W_PIN -1 #endif @@ -1915,7 +1764,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Velleman/K8400/README.md b/Marlin/example_configurations/Velleman/K8400/README.md index 1ebdd16..14c8f83 100644 --- a/Marlin/example_configurations/Velleman/K8400/README.md +++ b/Marlin/example_configurations/Velleman/K8400/README.md @@ -4,7 +4,7 @@ http://www.k8400.eu/ Configuration files for the K8400, ported upstream from the official Velleman firmware. Like its 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 /src/config directory. +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!** diff --git a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h index 51f349e..1bc4230 100644 --- a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h +++ b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 20 #define TEMP_SENSOR_1 0 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,54 +355,47 @@ // 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 + //#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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 // Duplicator 6 - #define DEFAULT_Kp 9.12 - #define DEFAULT_Ki 0.41 - #define DEFAULT_Kd 50.98 + #define DEFAULT_Kp 9.12 + #define DEFAULT_Ki 0.41 + #define DEFAULT_Kd 50.98 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -429,40 +404,35 @@ //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 +// #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 + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 // Duplicator 6 - #define DEFAULT_bedKp 124.55 - #define DEFAULT_bedKi 23.46 - #define DEFAULT_bedKd 165.29 + #define DEFAULT_bedKp 124.55 + #define DEFAULT_bedKi 23.46 + #define DEFAULT_bedKd 165.29 // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #endif // PIDTEMPBED // @section extruder -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -517,10 +487,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -531,61 +502,18 @@ #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_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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -653,16 +581,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 1.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -713,7 +631,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -724,7 +641,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -743,9 +660,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -783,16 +697,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -816,10 +727,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -855,6 +762,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -868,8 +778,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -902,7 +810,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -910,7 +818,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -918,30 +826,25 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif //=========================================================================== //=============================== Bed Leveling ============================== //=========================================================================== -// @section calibrate +// @section bedlevel /** * Choose one of the options below to enable G29 Bed Leveling. The parameters @@ -982,12 +885,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1010,12 +907,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + #define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1027,10 +924,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1053,6 +953,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1061,23 +972,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1086,21 +1001,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1112,11 +1014,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1155,63 +1052,6 @@ #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (4*60) -// @section calibrate - -/** - * Bed Skew Compensation - * - * This feature corrects for misalignment in the XYZ axes. - * - * Take the following steps to get the bed skew in the XY plane: - * 1. Print a test square (e.g., https://www.thingiverse.com/thing:2563185) - * 2. For XY_DIAG_AC measure the diagonal A to C - * 3. For XY_DIAG_BD measure the diagonal B to D - * 4. For XY_SIDE_AD measure the edge A to D - * - * Marlin automatically computes skew factors from these measurements. - * Skew factors may also be computed and set manually: - * - * - Compute AB : SQRT(2*AC*AC+2*BD*BD-4*AD*AD)/2 - * - XY_SKEW_FACTOR : TAN(PI/2-ACOS((AC*AC-AB*AB-AD*AD)/(2*AB*AD))) - * - * If desired, follow the same procedure for XZ and YZ. - * Use these diagrams for reference: - * - * Y Z Z - * ^ B-------C ^ B-------C ^ B-------C - * | / / | / / | / / - * | / / | / / | / / - * | A-------D | A-------D | A-------D - * +-------------->X +-------------->X +-------------->Y - * XY_SKEW_FACTOR XZ_SKEW_FACTOR YZ_SKEW_FACTOR - */ -//#define SKEW_CORRECTION - -#if ENABLED(SKEW_CORRECTION) - // Input all length measurements here: - #define XY_DIAG_AC 282.8427124746 - #define XY_DIAG_BD 282.8427124746 - #define XY_SIDE_AD 200 - - // Or, set the default skew factors directly here - // to override the above measurements: - #define XY_SKEW_FACTOR 0.0 - - //#define SKEW_CORRECTION_FOR_Z - #if ENABLED(SKEW_CORRECTION_FOR_Z) - #define XZ_DIAG_AC 282.8427124746 - #define XZ_DIAG_BD 282.8427124746 - #define YZ_DIAG_AC 282.8427124746 - #define YZ_DIAG_BD 282.8427124746 - #define YZ_SIDE_AD 200 - #define XZ_SKEW_FACTOR 0.0 - #define YZ_SKEW_FACTOR 0.0 - #endif - - // Enable this option for M852 to set skew at runtime - //#define SKEW_CORRECTION_GCODE -#endif - //============================================================================= //============================= Additional Features =========================== //============================================================================= @@ -1390,11 +1230,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1422,6 +1262,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1448,15 +1301,6 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // ENCODER SETTINGS // @@ -1521,18 +1365,12 @@ #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 5 #define LCD_FEEDBACK_FREQUENCY_HZ 1000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1550,6 +1388,40 @@ // //#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 @@ -1558,6 +1430,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1565,28 +1459,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1602,13 +1501,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1633,83 +1531,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1728,16 +1549,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1753,13 +1582,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1769,40 +1591,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1862,7 +1655,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1927,7 +1720,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration_adv.h b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration_adv.h index 2114cd5..4aae637 100644 --- a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration_adv.h +++ b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 255 // Set default power-up brightness (0-255, requires PWM pin) #define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -508,8 +456,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -537,20 +484,6 @@ // The timeout (in ms) to return to the status screen from sub-menus #define LCD_TIMEOUT_TO_STATUS 60000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -587,20 +520,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -639,6 +558,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -659,11 +597,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -679,9 +612,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen //#define XYZ_HOLLOW_FRAME @@ -703,25 +633,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -761,29 +672,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ #define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 0 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -818,46 +753,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -982,55 +880,53 @@ */ #define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1078,27 +974,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1137,16 +1068,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1195,21 +1116,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1218,22 +1138,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1246,61 +1150,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1556,7 +1484,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1568,7 +1496,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1600,7 +1528,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1610,29 +1538,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1650,7 +1576,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 50fa169..5d459d0 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,49 +355,42 @@ // 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 + #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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -424,35 +399,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -507,10 +477,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -529,53 +500,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -643,16 +571,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -703,7 +621,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -714,7 +631,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -733,9 +650,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -773,16 +687,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -806,10 +717,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -845,6 +752,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -858,8 +768,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -892,7 +800,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -900,7 +808,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -908,23 +816,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -972,12 +875,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1000,12 +897,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1017,10 +914,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1043,6 +943,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1051,23 +962,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1076,21 +991,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1102,11 +1004,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1380,11 +1277,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1412,6 +1309,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1438,28 +1348,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1511,18 +1412,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1546,6 +1441,34 @@ // //#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 @@ -1554,6 +1477,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1561,28 +1506,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1598,13 +1548,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1629,83 +1578,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1721,16 +1593,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1746,13 +1626,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1762,40 +1635,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1855,7 +1699,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1920,7 +1764,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h index ae35dd5..fe183f8 100644 --- a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h @@ -1,4 +1,4 @@ -/** +/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 5 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,54 +355,47 @@ // 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 + //#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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 //E3D with 30MM fan - #define DEFAULT_Kp 24.77 - #define DEFAULT_Ki 1.84 - #define DEFAULT_Kd 83.61 + #define DEFAULT_Kp 24.77 + #define DEFAULT_Ki 1.84 + #define DEFAULT_Kd 83.61 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -429,40 +404,35 @@ //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 + //#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 + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 //D-force - #define DEFAULT_bedKp 22.97 - #define DEFAULT_bedKi 3.76 - #define DEFAULT_bedKd 29.2 + #define DEFAULT_bedKp 22.97 + #define DEFAULT_bedKi 3.76 + #define DEFAULT_bedKd 29.2 // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #endif // PIDTEMPBED // @section extruder -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 300 @@ -514,9 +484,6 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 160 - // Convert feedrates to apply to the Effector instead of the Carriages - #define DELTA_FEEDRATE_SCALING - // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -533,13 +500,19 @@ #if ENABLED(DELTA_AUTO_CALIBRATION) // set the default number of probe points : n*n (1 -> 7) #define DELTA_CALIBRATION_DEFAULT_POINTS 4 + + // Enable and set these values based on results of 'G33 A' + //#define H_FACTOR 1.01 + //#define R_FACTOR 2.61 + //#define A_FACTOR 0.87 + #endif #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes + // Set the radius for the calibration probe points - max 0.9 * DELTA_PRINTABLE_RADIUS for non-eccentric probes #define DELTA_CALIBRATION_RADIUS 73.5 // mm // Set the steprate for papertest probing - #define PROBE_MANUALLY_STEP 0.05 // mm + #define PROBE_MANUALLY_STEP 0.025 #endif // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers). @@ -583,10 +556,11 @@ #define USE_YMAX_PLUG #define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -603,55 +577,12 @@ #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 probe. - -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe. // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -678,15 +609,7 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -// variables to calculate steps -#define XYZ_FULL_STEPS_PER_ROTATION 200 -#define XYZ_MICROSTEPS 16 -#define XYZ_BELT_PITCH 2 -#define XYZ_PULLEY_TEETH 16 - -// delta speeds must be the same on xyz -#define DEFAULT_XYZ_STEPS_PER_UNIT ((XYZ_FULL_STEPS_PER_ROTATION) * (XYZ_MICROSTEPS) / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH)) -#define DEFAULT_AXIS_STEPS_PER_UNIT { DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, 100 } // default steps per unit for Kossel (GT2, 20 tooth) +#define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 100, 100 } // default steps per unit for Kossel (GT2, 20 tooth) /** * Default Max Feed Rate (mm/s) @@ -728,16 +651,6 @@ #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -788,7 +701,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -799,7 +711,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -818,9 +730,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -858,16 +767,13 @@ #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0.10 // Z offset: -below +above [the nozzle] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 20 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 5000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST) / 6 // The number of probes to perform at each point. @@ -941,10 +847,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 2 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 2 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -980,6 +882,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -993,8 +898,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - #define Z_HOMING_HEIGHT 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. @@ -1027,7 +930,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds //#define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -1035,7 +938,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -1043,23 +946,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -1107,12 +1005,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1135,12 +1027,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1153,10 +1045,14 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - MIN_PROBE_EDGE) - //#define RIGHT_PROBE_BED_POSITION (DELTA_PRINTABLE_RADIUS - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - MIN_PROBE_EDGE) - //#define BACK_PROBE_BED_POSITION (DELTA_PRINTABLE_RADIUS - MIN_PROBE_EDGE) + #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 15) + #define LEFT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) + #define RIGHT_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS + #define FRONT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) + #define BACK_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 20 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1179,6 +1075,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1187,23 +1094,29 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define _PX(R,A) (R) * cos(RADIANS(A)) + #define _PY(R,A) (R) * sin(RADIANS(A)) + #define UBL_PROBE_PT_1_X _PX(DELTA_PROBEABLE_RADIUS, 0) // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y _PY(DELTA_PROBEABLE_RADIUS, 0) + #define UBL_PROBE_PT_2_X _PX(DELTA_PROBEABLE_RADIUS, 120) + #define UBL_PROBE_PT_2_Y _PY(DELTA_PROBEABLE_RADIUS, 120) + #define UBL_PROBE_PT_3_X _PX(DELTA_PROBEABLE_RADIUS, 240) + #define UBL_PROBE_PT_3_Y _PY(DELTA_PROBEABLE_RADIUS, 240) + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1212,21 +1125,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1238,11 +1138,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1406,7 +1301,7 @@ #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z } - #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), 0, 20 } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } #define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) #define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) #endif @@ -1515,11 +1410,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1547,6 +1442,19 @@ */ #define DISPLAY_CHARSET_HD44780 WESTERN +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1573,28 +1481,19 @@ */ #define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1647,18 +1546,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1676,6 +1569,40 @@ // //#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 @@ -1684,6 +1611,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1691,28 +1640,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1728,13 +1682,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1759,83 +1712,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1851,16 +1727,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1876,13 +1760,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1892,40 +1769,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1985,7 +1833,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -2050,7 +1898,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h index d63294a..8e2568b 100644 --- a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -448,24 +412,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -508,8 +456,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -537,20 +484,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -587,20 +520,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -639,6 +558,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -659,11 +597,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -679,9 +612,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -703,25 +633,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -761,29 +672,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -818,46 +753,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -982,55 +880,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1078,27 +974,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1137,16 +1068,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1195,21 +1116,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1218,22 +1138,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1246,61 +1150,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1556,7 +1484,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1568,7 +1496,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1600,7 +1528,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1610,29 +1538,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1650,7 +1576,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h index eb268b6..4420de5 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h @@ -1,4 +1,4 @@ -/** +/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,54 +355,47 @@ // 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 + //#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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 //E3D with 30MM fan - #define DEFAULT_Kp 24.77 - #define DEFAULT_Ki 1.84 - #define DEFAULT_Kd 83.61 + #define DEFAULT_Kp 24.77 + #define DEFAULT_Ki 1.84 + #define DEFAULT_Kd 83.61 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -429,40 +404,35 @@ //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 + //#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 + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 //D-force - #define DEFAULT_bedKp 22.97 - #define DEFAULT_bedKi 3.76 - #define DEFAULT_bedKd 29.2 + #define DEFAULT_bedKp 22.97 + #define DEFAULT_bedKi 3.76 + #define DEFAULT_bedKd 29.2 // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #endif // PIDTEMPBED // @section extruder -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 175 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 300 @@ -514,9 +484,6 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 160 - // Convert feedrates to apply to the Effector instead of the Carriages - #define DELTA_FEEDRATE_SCALING - // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -533,13 +500,19 @@ #if ENABLED(DELTA_AUTO_CALIBRATION) // set the default number of probe points : n*n (1 -> 7) #define DELTA_CALIBRATION_DEFAULT_POINTS 4 + + // Enable and set these values based on results of 'G33 A' + //#define H_FACTOR 1.01 + //#define R_FACTOR 2.61 + //#define A_FACTOR 0.87 + #endif #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes + // Set the radius for the calibration probe points - max 0.9 * DELTA_PRINTABLE_RADIUS for non-eccentric probes #define DELTA_CALIBRATION_RADIUS 73.5 // mm // Set the steprate for papertest probing - #define PROBE_MANUALLY_STEP 0.05 // mm + #define PROBE_MANUALLY_STEP 0.025 #endif // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers). @@ -583,10 +556,11 @@ #define USE_YMAX_PLUG #define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -605,53 +579,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -678,15 +609,7 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -// variables to calculate steps -#define XYZ_FULL_STEPS_PER_ROTATION 200 -#define XYZ_MICROSTEPS 16 -#define XYZ_BELT_PITCH 2 -#define XYZ_PULLEY_TEETH 16 - -// delta speeds must be the same on xyz -#define DEFAULT_XYZ_STEPS_PER_UNIT ((XYZ_FULL_STEPS_PER_ROTATION) * (XYZ_MICROSTEPS) / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH)) -#define DEFAULT_AXIS_STEPS_PER_UNIT { DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, 90 } // default steps per unit for Kossel (GT2, 20 tooth) +#define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 100, 90 } // default steps per unit for Kossel (GT2, 20 tooth) /** * Default Max Feed Rate (mm/s) @@ -728,16 +651,6 @@ #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -788,7 +701,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -799,7 +711,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -818,9 +730,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -858,16 +767,13 @@ #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0.25 // Z offset: -below +above [the nozzle] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 2000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -902,7 +808,8 @@ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position + // 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 @@ -940,10 +847,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 50 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -979,6 +882,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -992,8 +898,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - #define Z_HOMING_HEIGHT 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. @@ -1026,7 +930,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -1034,7 +938,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -1042,23 +946,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -1106,12 +1005,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1134,12 +1027,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1147,25 +1040,23 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - // Works best with 5 or more points in each dimension. #define GRID_MAX_POINTS_X 9 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - MIN_PROBE_EDGE) - //#define RIGHT_PROBE_BED_POSITION (DELTA_PRINTABLE_RADIUS - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - MIN_PROBE_EDGE) - //#define BACK_PROBE_BED_POSITION (DELTA_PRINTABLE_RADIUS - MIN_PROBE_EDGE) + #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 15) + #define LEFT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) + #define RIGHT_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS + #define FRONT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) + #define BACK_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - // Beyond the probed grid, continue the implied tilt? - // Default is to maintain the height of the nearest edge. - //#define EXTRAPOLATE_BEYOND_GRID - // // Experimental Subdivision of the grid by Catmull-Rom method. // Synthesizes intermediate points to produce a more detailed mesh. @@ -1178,6 +1069,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1186,23 +1088,29 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define _PX(R,A) (R) * cos(RADIANS(A)) + #define _PY(R,A) (R) * sin(RADIANS(A)) + #define UBL_PROBE_PT_1_X _PX(DELTA_PROBEABLE_RADIUS, 0) // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y _PY(DELTA_PROBEABLE_RADIUS, 0) + #define UBL_PROBE_PT_2_X _PX(DELTA_PROBEABLE_RADIUS, 120) + #define UBL_PROBE_PT_2_Y _PY(DELTA_PROBEABLE_RADIUS, 120) + #define UBL_PROBE_PT_3_X _PX(DELTA_PROBEABLE_RADIUS, 240) + #define UBL_PROBE_PT_3_Y _PY(DELTA_PROBEABLE_RADIUS, 240) + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1211,21 +1119,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1237,11 +1132,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1405,7 +1295,7 @@ #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z } - #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), 0, 20 } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } #define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) #define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) #endif @@ -1514,11 +1404,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1546,6 +1436,19 @@ */ #define DISPLAY_CHARSET_HD44780 WESTERN +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1572,28 +1475,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1645,18 +1539,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1674,6 +1562,40 @@ // //#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 @@ -1682,6 +1604,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1689,28 +1633,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1726,13 +1675,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1757,83 +1705,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1849,16 +1720,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1874,13 +1753,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1890,40 +1762,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1983,7 +1826,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -2048,7 +1891,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h index 19376d9..60d7c0a 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -1,4 +1,4 @@ -/** +/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -448,24 +412,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -508,8 +456,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -537,20 +484,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -587,20 +520,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -639,6 +558,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -659,11 +597,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -679,9 +612,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -703,25 +633,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -761,29 +672,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -818,46 +753,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -982,55 +880,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1078,27 +974,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1137,16 +1068,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1195,21 +1116,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1218,22 +1138,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1246,61 +1150,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1556,7 +1484,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1568,7 +1496,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1600,7 +1528,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1610,29 +1538,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1650,7 +1576,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index cdd3e71..75f40fd 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -1,4 +1,4 @@ -/** +/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,49 +355,42 @@ // 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 + #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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -424,35 +399,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -504,9 +474,6 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 200 - // Convert feedrates to apply to the Effector instead of the Carriages - #define DELTA_FEEDRATE_SCALING - // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -523,13 +490,19 @@ #if ENABLED(DELTA_AUTO_CALIBRATION) // set the default number of probe points : n*n (1 -> 7) #define DELTA_CALIBRATION_DEFAULT_POINTS 4 + + // Enable and set these values based on results of 'G33 A' + //#define H_FACTOR 1.01 + //#define R_FACTOR 2.61 + //#define A_FACTOR 0.87 + #endif #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes + // Set the radius for the calibration probe points - max 0.9 * DELTA_PRINTABLE_RADIUS for non-eccentric probes #define DELTA_CALIBRATION_RADIUS 121.5 // mm // Set the steprate for papertest probing - #define PROBE_MANUALLY_STEP 0.05 // mm + #define PROBE_MANUALLY_STEP 0.025 #endif // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers). @@ -573,10 +546,11 @@ #define USE_YMAX_PLUG #define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -595,53 +569,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -668,15 +599,7 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -// variables to calculate steps -#define XYZ_FULL_STEPS_PER_ROTATION 200 -#define XYZ_MICROSTEPS 16 -#define XYZ_BELT_PITCH 2 -#define XYZ_PULLEY_TEETH 20 - -// delta speeds must be the same on xyz -#define DEFAULT_XYZ_STEPS_PER_UNIT ((XYZ_FULL_STEPS_PER_ROTATION) * (XYZ_MICROSTEPS) / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH)) -#define DEFAULT_AXIS_STEPS_PER_UNIT { DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, 760*1.1 } // default steps per unit for Kossel (GT2, 20 tooth) +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 80, 760*1.1 } // default steps per unit for Kossel (GT2, 20 tooth) /** * Default Max Feed Rate (mm/s) @@ -718,16 +641,6 @@ #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -778,7 +691,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -789,7 +701,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -808,9 +720,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -848,16 +757,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 4000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -928,10 +834,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -967,6 +869,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -980,8 +885,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -1014,7 +917,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -1022,7 +925,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -1030,23 +933,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -1094,12 +992,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1113,6 +1005,10 @@ // The height can be set with M420 Z //#define ENABLE_LEVELING_FADE_HEIGHT + // Set the boundaries for probing (where the probe can reach). + #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) + + // For Cartesian machines, instead of dividing moves on mesh boundaries, // split up moves into short segments like a Delta. This follows the // contours of the bed more closely than edge-to-edge straight moves. @@ -1122,12 +1018,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1139,11 +1035,13 @@ #define GRID_MAX_POINTS_X 9 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) + #define RIGHT_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS + #define FRONT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) + #define BACK_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1166,6 +1064,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1174,23 +1083,29 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define _PX(R,A) (R) * cos(RADIANS(A)) + #define _PY(R,A) (R) * sin(RADIANS(A)) + #define UBL_PROBE_PT_1_X _PX(DELTA_PROBEABLE_RADIUS, 0) // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y _PY(DELTA_PROBEABLE_RADIUS, 0) + #define UBL_PROBE_PT_2_X _PX(DELTA_PROBEABLE_RADIUS, 120) + #define UBL_PROBE_PT_2_Y _PY(DELTA_PROBEABLE_RADIUS, 120) + #define UBL_PROBE_PT_3_X _PX(DELTA_PROBEABLE_RADIUS, 240) + #define UBL_PROBE_PT_3_Y _PY(DELTA_PROBEABLE_RADIUS, 240) + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1199,21 +1114,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1225,11 +1127,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1393,7 +1290,7 @@ #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z } - #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), 0, 20 } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } #define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) #define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) #endif @@ -1502,11 +1399,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1534,6 +1431,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1560,28 +1470,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1633,18 +1534,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1662,6 +1557,40 @@ // //#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 @@ -1670,6 +1599,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1677,28 +1628,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1714,13 +1670,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1745,83 +1700,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1837,16 +1715,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1862,13 +1748,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1878,40 +1757,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1971,7 +1821,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -2036,7 +1886,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 19376d9..60d7c0a 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -1,4 +1,4 @@ -/** +/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -448,24 +412,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -508,8 +456,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -537,20 +484,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -587,20 +520,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -639,6 +558,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -659,11 +597,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -679,9 +612,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -703,25 +633,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -761,29 +672,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -818,46 +753,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -982,55 +880,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1078,27 +974,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1137,16 +1068,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1195,21 +1116,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1218,22 +1138,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1246,61 +1150,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1556,7 +1484,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1568,7 +1496,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1600,7 +1528,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1610,29 +1538,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1650,7 +1576,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #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 6e29ccb..7ba05c3 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -1,4 +1,4 @@ -/** +/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 11 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,49 +355,42 @@ // 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 + #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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -424,35 +399,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -504,9 +474,6 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 200 - // Convert feedrates to apply to the Effector instead of the Carriages - #define DELTA_FEEDRATE_SCALING - // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -523,13 +490,19 @@ #if ENABLED(DELTA_AUTO_CALIBRATION) // set the default number of probe points : n*n (1 -> 7) #define DELTA_CALIBRATION_DEFAULT_POINTS 4 + + // Enable and set these values based on results of 'G33 A' + //#define H_FACTOR 1.01 + //#define R_FACTOR 2.61 + //#define A_FACTOR 0.87 + #endif #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes + // Set the radius for the calibration probe points - max 0.9 * DELTA_PRINTABLE_RADIUS for non-eccentric probes #define DELTA_CALIBRATION_RADIUS 78.0 // mm // Set the steprate for papertest probing - #define PROBE_MANUALLY_STEP 0.05 // mm + #define PROBE_MANUALLY_STEP 0.025 #endif // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers). @@ -573,10 +546,11 @@ #define USE_YMAX_PLUG #define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -595,53 +569,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -668,15 +599,7 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -// variables to calculate steps -#define XYZ_FULL_STEPS_PER_ROTATION 200 -#define XYZ_MICROSTEPS 16 -#define XYZ_BELT_PITCH 2 -#define XYZ_PULLEY_TEETH 20 - -// delta speeds must be the same on xyz -#define DEFAULT_XYZ_STEPS_PER_UNIT ((XYZ_FULL_STEPS_PER_ROTATION) * (XYZ_MICROSTEPS) / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH)) -#define DEFAULT_AXIS_STEPS_PER_UNIT { DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, 760*1.1 } // default steps per unit for Kossel (GT2, 20 tooth) +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 80, 760*1.1 } // default steps per unit for Kossel (GT2, 20 tooth) /** * Default Max Feed Rate (mm/s) @@ -718,16 +641,6 @@ #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -778,7 +691,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -789,7 +701,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -808,9 +720,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -848,16 +757,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 4000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -892,7 +798,8 @@ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position + // 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 @@ -930,10 +837,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 50 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -969,6 +872,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -982,8 +888,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -1016,7 +920,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -1024,7 +928,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -1032,23 +936,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -1096,12 +995,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1115,6 +1008,10 @@ // The height can be set with M420 Z //#define ENABLE_LEVELING_FADE_HEIGHT + // Set the boundaries for probing (where the probe can reach). + #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) + + // For Cartesian machines, instead of dividing moves on mesh boundaries, // split up moves into short segments like a Delta. This follows the // contours of the bed more closely than edge-to-edge straight moves. @@ -1124,12 +1021,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1141,11 +1038,13 @@ #define GRID_MAX_POINTS_X 9 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) + #define RIGHT_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS + #define FRONT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) + #define BACK_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1168,6 +1067,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1176,23 +1086,29 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define _PX(R,A) (R) * cos(RADIANS(A)) + #define _PY(R,A) (R) * sin(RADIANS(A)) + #define UBL_PROBE_PT_1_X _PX(DELTA_PROBEABLE_RADIUS, 0) // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y _PY(DELTA_PROBEABLE_RADIUS, 0) + #define UBL_PROBE_PT_2_X _PX(DELTA_PROBEABLE_RADIUS, 120) + #define UBL_PROBE_PT_2_Y _PY(DELTA_PROBEABLE_RADIUS, 120) + #define UBL_PROBE_PT_3_X _PX(DELTA_PROBEABLE_RADIUS, 240) + #define UBL_PROBE_PT_3_Y _PY(DELTA_PROBEABLE_RADIUS, 240) + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1201,21 +1117,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1227,11 +1130,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1395,7 +1293,7 @@ #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z } - #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), 0, 20 } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } #define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) #define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) #endif @@ -1504,11 +1402,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1536,6 +1434,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1562,28 +1473,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1635,18 +1537,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1664,6 +1560,40 @@ // #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 @@ -1672,6 +1602,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1679,28 +1631,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1716,13 +1673,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1747,83 +1703,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1839,16 +1718,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1864,13 +1751,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1880,40 +1760,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1973,7 +1824,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -2038,7 +1889,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #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 19376d9..60d7c0a 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -1,4 +1,4 @@ -/** +/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -448,24 +412,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -508,8 +456,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -537,20 +484,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -587,20 +520,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -639,6 +558,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -659,11 +597,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -679,9 +612,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -703,25 +633,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -761,29 +672,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -818,46 +753,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -982,55 +880,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1078,27 +974,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1137,16 +1068,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1195,21 +1116,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1218,22 +1138,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1246,61 +1150,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1556,7 +1484,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1568,7 +1496,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1600,7 +1528,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1610,29 +1538,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1650,7 +1576,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #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 c9874d0..5f1af79 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -1,4 +1,4 @@ -/** +/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * @@ -41,7 +41,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -83,27 +83,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -205,11 +200,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -241,15 +236,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -263,7 +249,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -272,8 +257,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -283,7 +267,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -305,7 +288,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -313,7 +296,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 5 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -363,7 +345,7 @@ #define PIDTEMP #define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current #define PID_MAX 125 // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -375,39 +357,32 @@ // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. // Kossel Pro - #define DEFAULT_Kp 19.30 - #define DEFAULT_Ki 3.51 - #define DEFAULT_Kd 26.56 + #define DEFAULT_Kp 19.30 + #define DEFAULT_Ki 3.51 + #define DEFAULT_Kd 26.56 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -416,29 +391,24 @@ //Kossel Pro heated bed plate with borosilicate glass //from pidautotune (M303 E-1 S60 C8) - #define DEFAULT_bedKp 370.25 - #define DEFAULT_bedKi 62.77 - #define DEFAULT_bedKd 545.98 + #define DEFAULT_bedKp 370.25 + #define DEFAULT_bedKi 62.77 + #define DEFAULT_bedKd 545.98 // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #endif // PIDTEMPBED // @section extruder -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -490,9 +460,6 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 160 - // Convert feedrates to apply to the Effector instead of the Carriages - #define DELTA_FEEDRATE_SCALING - // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -509,13 +476,19 @@ #if ENABLED(DELTA_AUTO_CALIBRATION) // set the default number of probe points : n*n (1 -> 7) #define DELTA_CALIBRATION_DEFAULT_POINTS 4 + + // Enable and set these values based on results of 'G33 A' + //#define H_FACTOR 1.01 + //#define R_FACTOR 2.61 + //#define A_FACTOR 0.87 + #endif #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes + // Set the radius for the calibration probe points - max 0.9 * DELTA_PRINTABLE_RADIUS for non-eccentric probes #define DELTA_CALIBRATION_RADIUS 110.0 // mm // Set the steprate for papertest probing - #define PROBE_MANUALLY_STEP 0.05 // mm + #define PROBE_MANUALLY_STEP 0.025 #endif // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers). @@ -559,10 +532,11 @@ #define USE_YMAX_PLUG #define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -581,53 +555,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -661,15 +592,7 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -// variables to calculate steps -#define XYZ_FULL_STEPS_PER_ROTATION 200 -#define XYZ_MICROSTEPS 32 -#define XYZ_BELT_PITCH 2 -#define XYZ_PULLEY_TEETH 20 - -// delta speeds must be the same on xyz -#define DEFAULT_XYZ_STEPS_PER_UNIT ((XYZ_FULL_STEPS_PER_ROTATION) * (XYZ_MICROSTEPS) / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH)) -#define DEFAULT_AXIS_STEPS_PER_UNIT { DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, 184.8 } // default steps per unit for Kossel (GT2, 20 tooth) +#define DEFAULT_AXIS_STEPS_PER_UNIT { XYZ_STEPS, XYZ_STEPS, XYZ_STEPS, 184.8 } /** * Default Max Feed Rate (mm/s) @@ -711,16 +634,6 @@ #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -771,7 +684,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -782,7 +694,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -801,9 +713,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -844,16 +753,13 @@ * 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). -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -930,10 +836,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 100 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset @@ -970,6 +872,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -983,8 +888,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -1017,7 +920,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -1025,7 +928,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -1033,23 +936,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -1097,12 +995,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1116,6 +1008,10 @@ // The height can be set with M420 Z //#define ENABLE_LEVELING_FADE_HEIGHT + // Set the boundaries for probing (where the probe can reach). + #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) + + // For Cartesian machines, instead of dividing moves on mesh boundaries, // split up moves into short segments like a Delta. This follows the // contours of the bed more closely than edge-to-edge straight moves. @@ -1125,12 +1021,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1142,11 +1038,13 @@ #define GRID_MAX_POINTS_X 7 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) + #define RIGHT_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS + #define FRONT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) + #define BACK_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1169,6 +1067,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1177,23 +1086,29 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define _PX(R,A) (R) * cos(RADIANS(A)) + #define _PY(R,A) (R) * sin(RADIANS(A)) + #define UBL_PROBE_PT_1_X _PX(DELTA_PROBEABLE_RADIUS, 0) // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y _PY(DELTA_PROBEABLE_RADIUS, 0) + #define UBL_PROBE_PT_2_X _PX(DELTA_PROBEABLE_RADIUS, 120) + #define UBL_PROBE_PT_2_Y _PY(DELTA_PROBEABLE_RADIUS, 120) + #define UBL_PROBE_PT_3_X _PX(DELTA_PROBEABLE_RADIUS, 240) + #define UBL_PROBE_PT_3_Y _PY(DELTA_PROBEABLE_RADIUS, 240) + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1202,21 +1117,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1228,11 +1130,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1396,7 +1293,7 @@ #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z } - #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), 0, 20 } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } #define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) #define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) #endif @@ -1505,11 +1402,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1537,6 +1434,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1563,28 +1473,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1636,18 +1537,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1665,6 +1560,40 @@ // //#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 @@ -1673,6 +1602,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1680,28 +1631,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1717,13 +1673,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1748,83 +1703,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1840,16 +1718,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1865,13 +1751,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1881,40 +1760,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1974,7 +1824,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -2039,7 +1889,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #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 5a2aeec..c533040 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -1,4 +1,4 @@ -/** +/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -45,17 +45,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -187,12 +176,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -203,7 +190,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -213,20 +200,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -247,7 +224,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -272,10 +248,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -336,20 +308,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -396,9 +363,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -453,24 +417,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -513,8 +461,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -542,20 +489,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -592,20 +525,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -644,6 +563,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -664,11 +602,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -684,9 +617,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -708,25 +638,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -766,29 +677,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -823,46 +758,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -987,55 +885,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1083,27 +979,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1142,16 +1073,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1200,21 +1121,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1223,22 +1143,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1251,61 +1155,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1561,7 +1489,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1573,7 +1501,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1605,7 +1533,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1615,29 +1543,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1655,7 +1581,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index e59459e..c691839 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -1,4 +1,4 @@ -/** +/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. #define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 5 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -382,44 +364,37 @@ //#define DEFAULT_Kd 85.30 // MakerGear - //#define DEFAULT_Kp 7.0 - //#define DEFAULT_Ki 0.1 - //#define DEFAULT_Kd 12 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -428,35 +403,30 @@ //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 15.00 - #define DEFAULT_bedKi .04 - #define DEFAULT_bedKd 305.4 + #define DEFAULT_bedKp 15.00 + #define DEFAULT_bedKi .04 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -508,9 +478,6 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 160 - // Convert feedrates to apply to the Effector instead of the Carriages - #define DELTA_FEEDRATE_SCALING - // After homing move down to a height where XY movement is unconstrained //#define DELTA_HOME_TO_SAFE_ZONE @@ -527,13 +494,19 @@ #if ENABLED(DELTA_AUTO_CALIBRATION) // set the default number of probe points : n*n (1 -> 7) #define DELTA_CALIBRATION_DEFAULT_POINTS 4 + + // Enable and set these values based on results of 'G33 A' + //#define H_FACTOR 1.01 + //#define R_FACTOR 2.61 + //#define A_FACTOR 0.87 + #endif #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes + // Set the radius for the calibration probe points - max 0.9 * DELTA_PRINTABLE_RADIUS for non-eccentric probes #define DELTA_CALIBRATION_RADIUS 121.5 // mm // Set the steprate for papertest probing - #define PROBE_MANUALLY_STEP 0.05 // mm + #define PROBE_MANUALLY_STEP 0.025 #endif // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers). @@ -577,10 +550,11 @@ #define USE_YMAX_PLUG #define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -//#define ENDSTOPPULLUPS +// coarse Endstop Settings +//#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined #define ENDSTOPPULLUP_XMAX #define ENDSTOPPULLUP_YMAX #define ENDSTOPPULLUP_ZMAX @@ -599,58 +573,24 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= // @section motion +// variables to calculate steps +#define XYZ_FULL_STEPS_PER_ROTATION 200 +#define XYZ_MICROSTEPS 16 +#define XYZ_BELT_PITCH 2 +#define XYZ_PULLEY_TEETH 16 + +// 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 * @@ -671,15 +611,7 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -// variables to calculate steps -#define XYZ_FULL_STEPS_PER_ROTATION 200 -#define XYZ_MICROSTEPS 16 -#define XYZ_BELT_PITCH 2 -#define XYZ_PULLEY_TEETH 16 - -// delta speeds must be the same on xyz -#define DEFAULT_XYZ_STEPS_PER_UNIT ((XYZ_FULL_STEPS_PER_ROTATION) * (XYZ_MICROSTEPS) / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH)) -#define DEFAULT_AXIS_STEPS_PER_UNIT { DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, 158 } // default steps per unit for PowerWasp +#define DEFAULT_AXIS_STEPS_PER_UNIT { XYZ_STEPS, XYZ_STEPS, XYZ_STEPS, 158 } // default steps per unit for PowerWasp /** * Default Max Feed Rate (mm/s) @@ -721,16 +653,6 @@ #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta #define DEFAULT_EJERK 20.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -781,7 +703,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -792,7 +713,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -811,9 +732,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -851,16 +769,13 @@ #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!) -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -931,10 +846,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 20 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 10 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 10 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -970,6 +881,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -983,8 +897,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -1017,7 +929,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds //#define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -1025,7 +937,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -1033,23 +945,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -1097,12 +1004,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1116,6 +1017,10 @@ // The height can be set with M420 Z //#define ENABLE_LEVELING_FADE_HEIGHT + // Set the boundaries for probing (where the probe can reach). + #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) + + // For Cartesian machines, instead of dividing moves on mesh boundaries, // split up moves into short segments like a Delta. This follows the // contours of the bed more closely than edge-to-edge straight moves. @@ -1125,12 +1030,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1142,11 +1047,13 @@ #define GRID_MAX_POINTS_X 5 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS + MIN_PROBE_EDGE) - //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS + MIN_PROBE_EDGE) - //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) + #define RIGHT_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS + #define FRONT_PROBE_BED_POSITION - (DELTA_PROBEABLE_RADIUS - 20) + #define BACK_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS - 40 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1169,6 +1076,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1177,23 +1095,29 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define _PX(R,A) (R) * cos(RADIANS(A)) + #define _PY(R,A) (R) * sin(RADIANS(A)) + #define UBL_PROBE_PT_1_X _PX(DELTA_PROBEABLE_RADIUS, 0) // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y _PY(DELTA_PROBEABLE_RADIUS, 0) + #define UBL_PROBE_PT_2_X _PX(DELTA_PROBEABLE_RADIUS, 120) + #define UBL_PROBE_PT_2_Y _PY(DELTA_PROBEABLE_RADIUS, 120) + #define UBL_PROBE_PT_3_X _PX(DELTA_PROBEABLE_RADIUS, 240) + #define UBL_PROBE_PT_3_Y _PY(DELTA_PROBEABLE_RADIUS, 240) + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1202,21 +1126,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1228,11 +1139,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1396,7 +1302,7 @@ #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z } - #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), 0, 20 } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } #define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) #define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) #endif @@ -1505,11 +1411,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1537,6 +1443,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1563,28 +1482,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1636,18 +1546,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1665,6 +1569,40 @@ // //#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 @@ -1673,6 +1611,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1680,28 +1640,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1717,13 +1682,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1748,83 +1712,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1840,16 +1727,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1865,13 +1760,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1881,40 +1769,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1974,7 +1833,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -2039,7 +1898,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #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 5bee3c3..0edc91d 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -1,4 +1,4 @@ -/** +/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -448,24 +412,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -508,8 +456,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -537,20 +484,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -587,20 +520,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -639,6 +558,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -659,11 +597,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -679,9 +612,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -703,25 +633,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -761,29 +672,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -818,46 +753,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -982,55 +880,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1078,27 +974,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1137,16 +1068,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1195,21 +1116,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1218,22 +1138,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1246,61 +1150,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1556,7 +1484,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1568,7 +1496,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1600,7 +1528,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1610,29 +1538,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1650,7 +1576,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h index 2590338..25d20ce 100644 --- a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h +++ b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -206,11 +201,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -242,15 +237,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -264,7 +250,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -273,8 +258,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -284,7 +268,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -306,7 +289,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -317,7 +300,6 @@ // to print on glass. And I'm using a 400mm x 400mm silicon heat pad powered through // a Fortek SSR to do it. If you are using an unaltered gCreate machine, this needs // to be set to 0 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -367,7 +349,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -381,54 +363,47 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // gMax J-Head - #define DEFAULT_Kp 15.35 - #define DEFAULT_Ki 0.85 - #define DEFAULT_Kd 69.45 + #define DEFAULT_Kp 15.35 + #define DEFAULT_Ki 0.85 + #define DEFAULT_Kd 69.45 // Ultimaker - //#define DEFAULT_Kp 22.2 - //#define DEFAULT_Ki 1.08 - //#define DEFAULT_Kd 114 + //#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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -437,35 +412,30 @@ //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 135.44 - #define DEFAULT_bedKi 24.60 - #define DEFAULT_bedKd 186.40 + #define DEFAULT_bedKp 135.44 + #define DEFAULT_bedKi 24.60 + #define DEFAULT_bedKd 186.40 //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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -520,10 +490,11 @@ #define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -//#define ENDSTOPPULLUPS +// coarse Endstop Settings +//#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -542,53 +513,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. #define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -656,16 +584,6 @@ #define DEFAULT_ZJERK 0.7 #define DEFAULT_EJERK 4.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -716,7 +634,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -727,7 +644,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -746,9 +663,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -786,16 +700,13 @@ #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -0.25 // Z offset: -below +above [the nozzle] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 45 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 7500 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -819,10 +730,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 6 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 6 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -858,6 +765,9 @@ #define INVERT_Y_DIR true #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -871,8 +781,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - #define Z_HOMING_HEIGHT 10 // (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. @@ -906,7 +814,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds //#define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -914,7 +822,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -922,23 +830,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ #define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -986,12 +889,6 @@ #define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1014,12 +911,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - #define G26_MESH_VALIDATION + #define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.5 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.3 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.5 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.3 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1031,10 +928,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1057,6 +957,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1065,23 +976,27 @@ #define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 45 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 45 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 53 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 323 + #define UBL_PROBE_PT_2_X 53 + #define UBL_PROBE_PT_2_Y 63 + #define UBL_PROBE_PT_3_X 348 + #define UBL_PROBE_PT_3_Y 211 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1090,21 +1005,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - #define PROBE_PT_1_X 53 - #define PROBE_PT_1_Y 323 - #define PROBE_PT_2_X 53 - #define PROBE_PT_2_Y 63 - #define PROBE_PT_3_X 348 - #define PROBE_PT_3_Y 211 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1116,11 +1018,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1151,8 +1048,8 @@ #define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2 - 8) // X point for Z homing when homing all axes (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2 - 4) // Y point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2 - 4) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2 + 4) // Y point for Z homing when homing all axes (G28). #endif // Homing speeds (mm/m) @@ -1394,11 +1291,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1426,6 +1323,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1452,15 +1362,6 @@ */ #define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // ENCODER SETTINGS // @@ -1525,18 +1426,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1554,6 +1449,40 @@ // //#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 @@ -1562,6 +1491,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1569,28 +1520,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1606,13 +1562,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1637,83 +1592,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1729,16 +1607,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1754,13 +1640,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1770,40 +1649,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1863,7 +1713,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1928,7 +1778,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300, 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h index 2735f6e..8bad79a 100644 --- a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ #define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ #define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - #define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + #define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,28 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ + #define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE -90 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1575,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/gCreate/gMax1.5+/_Bootscreen.h b/Marlin/example_configurations/gCreate/gMax1.5+/_Bootscreen.h index 9fa6b95..b691e81 100644 --- a/Marlin/example_configurations/gCreate/gMax1.5+/_Bootscreen.h +++ b/Marlin/example_configurations/gCreate/gMax1.5+/_Bootscreen.h @@ -21,80 +21,88 @@ */ /** - * Custom Boot Screen bitmap + * Custom Bitmap for splashscreen * - * Place this file in the root with your configuration files - * and enable SHOW_CUSTOM_BOOTSCREEN in Configuration.h. + * You may use one of the following tools to generate the C++ bitmap array from + * a black and white image: * - * Use the Marlin Bitmap Converter to make your own: - * http://marlinfw.org/tools/u8glib/converter.html + * - http://www.marlinfw.org/tools/u8glib/converter.html + * - http://www.digole.com/tools/PicturetoC_Hex_converter.php */ +//custom screen can be up to 112 wide and 64 high +#include + +#define CUSTOM_BOOTSCREEN_TIMEOUT 2500 #define CUSTOM_BOOTSCREEN_BMPWIDTH 112 +#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 -const unsigned char custom_start_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B11111111,B11111110,B00000000,B00111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00110001,B00000000,B00000000,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000001,B11111001,B00000000,B00000000,B00000011,B11111000,B00000000,B00000000,B00000001,B11000000,B00000001, - B10000000,B00000000,B00000000,B00000110,B01001101,B00000000,B00000000,B00000111,B00111000,B00000000,B00000000,B00000001,B11000000,B00000001, - B10000000,B00000000,B00000000,B00001100,B00100110,B00000000,B00000111,B01100111,B00111001,B11010011,B11100001,B11110011,B11100111,B11000001, - B10000000,B00000000,B00000000,B00011001,B00010010,B00000000,B00001111,B11100111,B00111001,B11110111,B11110011,B11111011,B11101111,B11100001, - B10000000,B00000000,B00000000,B00110111,B11001110,B00000000,B00001110,B11100111,B00000001,B11110111,B01110011,B10111001,B11001110,B11100001, - B10000000,B00000000,B00000000,B01100100,B01100110,B00000000,B00001110,B11100111,B00000001,B11000111,B11110011,B10111001,B11001111,B11100001, - B10000000,B00000000,B00000000,B01001011,B10100110,B00000000,B00001110,B11100111,B00111001,B11000111,B11110000,B11111001,B11001111,B11100001, - B10000000,B00000000,B00000000,B11001010,B10110100,B00000000,B00001111,B11100111,B00111001,B11000111,B00000011,B11111001,B11001110,B00000001, - B10000000,B00000000,B00000000,B11001101,B10100100,B00000000,B00000110,B11100111,B00111001,B11000111,B01110011,B10111001,B11001110,B11100001, - B10000000,B00000000,B00000011,B10100110,B01101100,B00000000,B00000000,B11100111,B00111001,B11000111,B01110011,B10111001,B11001110,B11100001, - B10000000,B00000000,B11111111,B00010011,B11011000,B00000000,B00001110,B11100011,B11110001,B11000111,B11110011,B11111001,B11101111,B11100001, - B10000000,B00000001,B00100001,B10001000,B00011000,B00000000,B00001111,B11100001,B11100001,B11000011,B11100001,B10111001,B11100111,B11000001, - B10000000,B00000110,B01100001,B00010110,B00110000,B00000000,B00000111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000100,B01000001,B00100011,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000100,B11111110,B01000001,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00001011,B10000110,B10001111,B00000000,B00000000,B00000000,B00000000,B00111111,B00011111,B10000000,B00000000,B00000000,B00000001, - B10000000,B00011110,B00000001,B10011010,B00000000,B00000000,B00000000,B00000000,B00111111,B00011111,B10000000,B00000000,B00000000,B00000001, - B10000000,B00011100,B00000111,B00100010,B00000000,B00000000,B00000111,B10111100,B00111111,B10011111,B10000001,B11111000,B11110001,B11100001, - B10000000,B00001000,B00011111,B11100010,B00000000,B00000000,B00001111,B11111100,B00111111,B10111111,B10000111,B11111110,B01110001,B11000001, - B10000000,B00000000,B00110011,B01100010,B00000000,B00000000,B00001111,B00111100,B00111101,B10110111,B10000111,B10011110,B01111011,B11000001, - B10000000,B00000000,B11000010,B00100010,B00000000,B00000000,B00001111,B00111100,B00111101,B10110111,B10000111,B10011110,B01111011,B11000001, - B10000000,B00000000,B11000010,B00111110,B00000000,B00000000,B00001111,B00111100,B00111101,B11110111,B10000000,B01111110,B00111011,B10000001, - B10000000,B00000001,B11100110,B00011110,B00000000,B00000000,B00001111,B00111100,B00111101,B11110111,B10000011,B11111110,B00111111,B10000001, - B10000000,B00000001,B00111100,B00010010,B00000000,B00000000,B00001111,B00111100,B00111101,B11110111,B10000111,B10011110,B00111011,B10000001, - B10000000,B00000001,B00011100,B00100110,B00000000,B00000000,B00001111,B11111100,B00111101,B11110111,B10000111,B10011110,B01111011,B11000001, - B10000000,B00000001,B01110000,B01100100,B00000000,B00000000,B00000111,B10111100,B00111100,B11100111,B10000111,B10011110,B01111011,B11000001, - B10000000,B00000011,B11000000,B01011000,B00000000,B00000000,B00000000,B00111100,B00111100,B11100111,B10000111,B11111110,B01110001,B11000001, - B10000000,B00001101,B10000000,B11110000,B00000000,B00000000,B00001111,B00111100,B00111100,B11100111,B10000011,B11011110,B11110001,B11100001, - B10000000,B00011010,B00000000,B11100000,B00000000,B00000000,B00001111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00100110,B00000000,B01000000,B00000000,B00000000,B00000011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B01001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B10110010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B10000001,B00000110,B00000000,B00000000,B00000000,B00000000,B00000111,B00011100,B00000011,B11000000,B00100000,B00010000,B00000000,B00000001, - B10000011,B00100100,B00000000,B00000000,B00000000,B00000000,B00001000,B10010010,B00000010,B00100000,B00000000,B00010000,B00000000,B00000001, - B00000010,B00100100,B00000000,B00000000,B00000000,B00000000,B00000000,B10010001,B00000010,B00100011,B00100111,B00111001,B10001100,B11100001, - B00000110,B00111000,B00000000,B00000000,B00000000,B00000000,B00000011,B00010001,B00000011,B11000010,B00100100,B10010010,B01001001,B00000001, - B00000100,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B10010001,B00000010,B00000010,B00100100,B10010011,B11001000,B11000001, - B00001101,B10100000,B00000000,B00000000,B00000000,B00000000,B00001000,B10010010,B00000010,B00000010,B00100100,B10010010,B00001000,B00100001, - B00001000,B11100000,B00000000,B00000000,B00000000,B00000000,B00000111,B00011100,B00000010,B00000010,B00100100,B10011001,B11001001,B11000001, - B00011000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B00010000,B00110000,B00000000,B00011100,B00000000,B00000000,B00000000,B00001100,B00011000,B00001111,B11100000,B00001111,B00000000,B00000001, - B00110000,B00100000,B00000000,B00110111,B00000000,B00000000,B00000000,B00010010,B00100100,B00001000,B00010000,B00001001,B00000000,B00000001, - B00100000,B00110000,B00000000,B01101101,B10000000,B00000000,B00000000,B00010010,B00100100,B00001001,B10001000,B00001001,B00000000,B00000001, - B00010000,B00011000,B00011111,B01100000,B11000000,B00000000,B00000000,B00010010,B00100100,B00001001,B01001000,B00001001,B00000000,B00000001, - B00110000,B00001100,B00111001,B11100000,B01100000,B00000000,B00000000,B00010010,B00100100,B00001001,B10010000,B00001001,B00000000,B00000001, - B00110000,B00000111,B10010000,B01110000,B01100000,B00000000,B00000000,B00010010,B00100100,B00001000,B01100000,B00001001,B00000000,B00000001, - B00010000,B00010110,B11110000,B00011000,B00100000,B00000000,B00000000,B00010010,B00100100,B00001000,B00010000,B00001001,B00000000,B00000001, - B00011010,B00010000,B01100000,B00001000,B00110000,B00000000,B00000000,B00010010,B00100100,B00001001,B11001000,B00001001,B00000000,B00000001, - B00001011,B00001001,B10000000,B00000000,B00110000,B00000000,B00000000,B00010010,B00100100,B00001001,B00100100,B00001001,B00000000,B00000001, - B00001110,B00000111,B10000000,B00000000,B00010000,B00000000,B00000000,B00010011,B11100100,B10001001,B11000100,B10001001,B11111001,B00000001, - B00000110,B00011110,B01000000,B00010000,B00010000,B00000000,B00000000,B00010000,B00000101,B11001000,B00001001,B11001000,B00001011,B10000001, - B00000110,B00000000,B01000000,B00100000,B00010000,B00000000,B00000000,B00001111,B11111000,B10001111,B11110000,B10001111,B11111001,B00000001, - B00000011,B10000000,B00000000,B00100000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, - B00000001,B11111111,B11111111,B11111111,B11100000,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111 +// Width: 112, Height: 64 +const unsigned char custom_start_bmp[896] PROGMEM = { + 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x00, 0x00, 0x01, 0xf9, 0x00, 0x00, 0x03, 0xf8, 0x00, 0x00, 0x01, 0xc0, 0x01, + 0x80, 0x00, 0x00, 0x06, 0x4d, 0x00, 0x00, 0x07, 0x38, 0x00, 0x00, 0x01, 0xc0, 0x01, + 0x80, 0x00, 0x00, 0x0c, 0x26, 0x00, 0x0e, 0xe7, 0x39, 0xd3, 0xe1, 0xf3, 0xe7, 0xc1, + 0x80, 0x00, 0x00, 0x19, 0x12, 0x00, 0x0f, 0xe7, 0x39, 0xf7, 0xf3, 0xfb, 0xef, 0xe1, + 0x80, 0x00, 0x00, 0x37, 0xce, 0x00, 0x0e, 0xe7, 0x01, 0xf7, 0x73, 0xb9, 0xce, 0xe1, + 0x80, 0x00, 0x00, 0x64, 0x66, 0x00, 0x0e, 0xe7, 0x01, 0xc7, 0xf3, 0xb9, 0xcf, 0xe1, + 0x80, 0x00, 0x00, 0x4b, 0xa6, 0x00, 0x0e, 0xe7, 0x39, 0xc7, 0xf0, 0xf9, 0xcf, 0xe1, + 0x80, 0x00, 0x00, 0xca, 0xb4, 0x00, 0x0f, 0xe7, 0x39, 0xc7, 0x03, 0xf9, 0xce, 0x01, + 0x80, 0x00, 0x00, 0xcd, 0xa4, 0x00, 0x06, 0xe7, 0x39, 0xc7, 0x73, 0xb9, 0xce, 0xe1, + 0x80, 0x00, 0x03, 0xa6, 0x6c, 0x00, 0x00, 0xe7, 0x39, 0xc7, 0x73, 0xb9, 0xce, 0xe1, + 0x80, 0x00, 0xff, 0x13, 0xd8, 0x00, 0x0e, 0xe3, 0xf1, 0xc7, 0xf3, 0xf9, 0xef, 0xe1, + 0x80, 0x01, 0x21, 0x88, 0x18, 0x00, 0x0f, 0xe1, 0xe1, 0xc3, 0xe1, 0xb9, 0xe7, 0xc1, + 0x80, 0x06, 0x61, 0x16, 0x30, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x04, 0x41, 0x23, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x04, 0xfe, 0x41, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x0b, 0x86, 0x8f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x80, 0x00, 0x00, 0x01, + 0x80, 0x1e, 0x01, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x80, 0x00, 0x00, 0x01, + 0x80, 0x1c, 0x07, 0x22, 0x00, 0x00, 0x07, 0xbc, 0x3f, 0x9f, 0x81, 0xf8, 0xf1, 0xe1, + 0x80, 0x08, 0x1f, 0xe2, 0x00, 0x00, 0x0f, 0xfc, 0x3f, 0xbf, 0x87, 0xfe, 0x71, 0xc1, + 0x80, 0x00, 0x33, 0x62, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xb7, 0x87, 0x9e, 0x7b, 0xc1, + 0x80, 0x00, 0xc2, 0x22, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xb7, 0x87, 0x9e, 0x7b, 0xc1, + 0x80, 0x00, 0xc2, 0x3e, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xf7, 0x80, 0x7e, 0x3b, 0x81, + 0x80, 0x01, 0xe6, 0x1e, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xf7, 0x83, 0xfe, 0x3f, 0x81, + 0x80, 0x01, 0x3c, 0x12, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xf7, 0x87, 0x9e, 0x3b, 0x81, + 0x80, 0x01, 0x1c, 0x26, 0x00, 0x00, 0x0f, 0xfc, 0x3d, 0xf7, 0x87, 0x9e, 0x7b, 0xc1, + 0x80, 0x01, 0x70, 0x64, 0x00, 0x00, 0x07, 0xbc, 0x3c, 0xe7, 0x87, 0x9e, 0x7b, 0xc1, + 0x80, 0x03, 0xc0, 0x58, 0x00, 0x00, 0x00, 0x3c, 0x3c, 0xe7, 0x87, 0xfe, 0x71, 0xc1, + 0x80, 0x0d, 0x80, 0xf0, 0x00, 0x00, 0x0f, 0x3c, 0x3c, 0xe7, 0x83, 0xde, 0xf1, 0xe1, + 0x80, 0x1a, 0x00, 0xe0, 0x00, 0x00, 0x0f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x26, 0x00, 0x40, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x80, 0xb2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + + 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x07, 0x1c, 0x03, 0xc0, 0x20, 0x10, 0x00, 0x01, + 0x83, 0x24, 0x00, 0x00, 0x00, 0x00, 0x08, 0x92, 0x02, 0x20, 0x00, 0x10, 0x00, 0x01, + 0x02, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x02, 0x23, 0x27, 0x39, 0x8c, 0xe1, + 0x06, 0x38, 0x00, 0x00, 0x00, 0x00, 0x03, 0x11, 0x03, 0xc2, 0x24, 0x92, 0x49, 0x01, + 0x04, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x02, 0x02, 0x24, 0x93, 0xc8, 0xc1, + 0x0d, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x08, 0x92, 0x02, 0x02, 0x24, 0x92, 0x08, 0x21, + 0x08, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x1c, 0x02, 0x02, 0x24, 0x99, 0xc9, 0xc1, + 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + + 0x10, 0x30, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x0f, 0xe0, 0x0f, 0x00, 0x01, + 0x30, 0x20, 0x00, 0x37, 0x00, 0x00, 0x00, 0x12, 0x24, 0x08, 0x10, 0x09, 0x00, 0x01, + 0x20, 0x30, 0x00, 0x6d, 0x80, 0x00, 0x00, 0x12, 0x24, 0x09, 0x88, 0x09, 0x00, 0x01, + 0x10, 0x18, 0x1f, 0x60, 0xc0, 0x00, 0x00, 0x12, 0x24, 0x09, 0x48, 0x09, 0x00, 0x01, + 0x30, 0x0c, 0x39, 0xe0, 0x60, 0x00, 0x00, 0x12, 0x24, 0x09, 0x90, 0x09, 0x00, 0x01, + 0x30, 0x07, 0x90, 0x70, 0x60, 0x00, 0x00, 0x12, 0x24, 0x08, 0x60, 0x09, 0x00, 0x01, + 0x10, 0x16, 0xf0, 0x18, 0x20, 0x00, 0x00, 0x12, 0x24, 0x08, 0x10, 0x09, 0x00, 0x01, + 0x1a, 0x10, 0x60, 0x08, 0x30, 0x00, 0x00, 0x12, 0x24, 0x09, 0xc8, 0x09, 0x00, 0x01, + 0x0b, 0x09, 0x80, 0x00, 0x30, 0x00, 0x00, 0x12, 0x24, 0x09, 0x24, 0x09, 0x00, 0x01, + 0x0e, 0x07, 0x80, 0x00, 0x10, 0x00, 0x00, 0x13, 0xe4, 0x89, 0xc4, 0x89, 0xf9, 0x01, + 0x06, 0x1e, 0x40, 0x10, 0x10, 0x00, 0x00, 0x10, 0x05, 0xc8, 0x09, 0xc8, 0x0b, 0x81, + 0x06, 0x00, 0x40, 0x20, 0x10, 0x00, 0x00, 0x0f, 0xf8, 0x8f, 0xf0, 0x8f, 0xf9, 0x01, + 0x03, 0x80, 0x00, 0x20, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x01, 0xff, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index d845442..5150cc8 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 12 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,49 +355,42 @@ // 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 + #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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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 175 // limits duty cycle to bed; 255=full current // This limit is set to 175 by default in the Makibox configuration and it can be adjusted // to increase the heatup rate. However, if changed, be aware of the safety concerns of @@ -427,35 +402,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -510,10 +480,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -532,53 +503,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -646,16 +574,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -706,7 +624,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -717,7 +634,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -736,9 +653,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -776,16 +690,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -809,10 +720,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -848,6 +755,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false +// Enable this option for Toshiba stepper drivers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -861,8 +771,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -895,7 +803,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -903,7 +811,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -911,23 +819,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -975,12 +878,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1003,12 +900,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1020,10 +917,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1046,6 +946,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1054,23 +965,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1079,21 +994,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1105,11 +1007,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1383,11 +1280,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1415,6 +1312,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1441,28 +1351,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1514,18 +1415,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1543,6 +1438,40 @@ // //#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 @@ -1551,6 +1480,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1558,28 +1509,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1595,13 +1551,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1626,83 +1581,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1718,16 +1596,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1743,13 +1629,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1759,40 +1638,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1852,7 +1702,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1917,7 +1767,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 756a972..35af642 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +185,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 4 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS #define DIGIPOT_I2C_MOTOR_CURRENTS { 1.7, 1.7, 1.7, 1.7 } // 5DPRINT //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 448b0c3..5731fa7 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 5 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -372,39 +354,32 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // J-Head Mk V-B - #define DEFAULT_Kp 25.05 - #define DEFAULT_Ki 2.30 - #define DEFAULT_Kd 68.15 + #define DEFAULT_Kp 25.05 + #define DEFAULT_Ki 2.30 + #define DEFAULT_Kd 68.15 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -413,35 +388,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -496,10 +466,11 @@ //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -#define ENDSTOPPULLUPS +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -518,53 +489,10 @@ #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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -638,16 +566,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -698,7 +616,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -709,7 +626,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -728,9 +645,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -768,16 +682,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -801,10 +712,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -840,6 +747,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR true +// Enable this option for Toshiba stepper drivers +#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -853,8 +763,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -887,7 +795,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -895,7 +803,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -903,23 +811,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -967,12 +870,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -995,12 +892,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1012,10 +909,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1038,6 +938,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1046,23 +957,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1071,21 +986,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1097,11 +999,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1375,11 +1272,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1407,6 +1304,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1433,28 +1343,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +//#define ENCODER_PULSES_PER_STEP 1 // // 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 +//#define ENCODER_STEPS_PER_MENU_ITEM 5 /** * Encoder Direction Options @@ -1506,18 +1407,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1535,6 +1430,40 @@ // //#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 @@ -1543,6 +1472,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1550,28 +1501,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1587,13 +1543,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1618,83 +1573,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1710,16 +1588,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1735,13 +1621,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1751,40 +1630,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1844,7 +1694,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1909,7 +1759,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 96b3d77..cf2d78b 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -182,12 +171,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -208,20 +195,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +219,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +243,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +303,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +358,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +410,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -506,8 +454,7 @@ //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. +// 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 } // AZTEEG_X3_PRO //=========================================================================== @@ -535,20 +482,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -585,20 +518,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -637,6 +556,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -657,11 +595,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -677,9 +610,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -701,25 +631,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -759,29 +670,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -816,46 +751,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -980,55 +878,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1076,27 +972,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1135,16 +1066,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1193,21 +1114,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1216,22 +1136,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1244,61 +1148,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1554,7 +1482,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1566,7 +1494,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1598,7 +1526,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1608,29 +1536,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1648,7 +1574,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/wt150/Configuration.h b/Marlin/example_configurations/wt150/Configuration.h index 6a66cbc..bf8642a 100644 --- a/Marlin/example_configurations/wt150/Configuration.h +++ b/Marlin/example_configurations/wt150/Configuration.h @@ -37,7 +37,7 @@ */ #ifndef CONFIGURATION_H #define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 +#define CONFIGURATION_H_VERSION 010107 //=========================================================================== //============================= Getting Started ============================= @@ -79,27 +79,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 -/** - * *** VENDORS PLEASE READ *** - * - * Marlin allows you to add a custom boot image for Graphical LCDs. - * With this option Marlin will first show your custom screen followed - * by the standard Marlin logo with version number and web URL. - * - * We encourage you to take advantage of this new feature and we also - * respectfully request that you retain the unmodified Marlin boot screen. - */ - -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// +// *** 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 then 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 - -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -//#define CUSTOM_STATUS_SCREEN_IMAGE - // @section machine /** - * Select the serial port on the board to use for communication with the host. + * Select which serial port on the board will 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 always used by the Arduino bootloader regardless of this setting. * @@ -201,11 +196,11 @@ /** * "Mixing Extruder" - * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - 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 Firmware's 'M164 S' supporting virtual tools. - * - This implementation supports up to two mixing extruders. - * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + * - Optional support for Repetier Firmware 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) @@ -237,15 +232,6 @@ // Enable this option to leave the PSU off at startup. // Power to steppers and heaters will need to be turned on with M80. //#define PS_DEFAULT_OFF - - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin - #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define POWER_TIMEOUT 30 - #endif - #endif // @section temperature @@ -259,7 +245,6 @@ * * Temperature sensors available: * - * -4 : thermocouple with AD8495 * -3 : thermocouple with MAX31855 (only for sensor 0) * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 @@ -268,8 +253,7 @@ * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup) * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! - * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) - * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 5 : 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -279,7 +263,6 @@ * 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" - * 15 : 100k thermistor calibration for JGAurora A5 hotend * 20 : the PT100 circuit found in the Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 66 : 4.7M High Temperature thermistor from Dyze Design @@ -301,7 +284,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '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)", '501':"100K Zonestar (Tronxy X3A)", '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)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'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 -2 #define TEMP_SENSOR_1 0 @@ -309,7 +292,6 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 -#define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -359,7 +341,7 @@ #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 -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within the PID #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. @@ -373,54 +355,47 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it //WT150, based on: M303 E0 S220 C8 - #define DEFAULT_Kp 22.10 - #define DEFAULT_Ki 1.10 - #define DEFAULT_Kd 110.78 + #define DEFAULT_Kp 22.10 + #define DEFAULT_Ki 1.10 + #define DEFAULT_Kd 110.78 // Ultimaker - //#define DEFAULT_Kp 22.2 - //#define DEFAULT_Ki 1.08 - //#define DEFAULT_Kd 114 + //#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 + //#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 + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 #endif // PIDTEMP //=========================================================================== //============================= PID > Bed Temperature Control =============== //=========================================================================== - -/** - * PID Bed Heating - * - * If this option is enabled set PID constants below. - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. - * - * The PID frequency will be the same as the extruder PWM. - * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, - * which is fine for driving a square wave into a resistive load and does not significantly - * impact 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, don't use bed PID until someone else verifies that your hardware works. - */ +// 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 -/** - * Max Bed Power - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) - */ +// 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) @@ -429,35 +404,30 @@ //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 + #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 + //#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 -/** - * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. - * Add M302 to set the minimum extrusion temperature and/or turn - * cold extrusion prevention on and off. - * - * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** - */ +// This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP. +// It also enables the M302 command to set the minimum extrusion temperature +// or to allow moving the extruder regardless of the hotend temperature. +// *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** #define PREVENT_COLD_EXTRUSION #define EXTRUDE_MINTEMP 170 -/** - * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. - * Note: For Bowden Extruders make this large enough to allow load/unload. - */ +// This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH. +// Note that for Bowden Extruders a too-small value here may prevent loading. #define PREVENT_LENGTHY_EXTRUDE #define EXTRUDE_MAXLENGTH 200 @@ -512,10 +482,11 @@ //#define USE_YMAX_PLUG #define USE_ZMAX_PLUG -// Enable pullup for all endstops to prevent a floating state -//#define ENDSTOPPULLUPS +// coarse Endstop Settings +//#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + #if DISABLED(ENDSTOPPULLUPS) - // Disable ENDSTOPPULLUPS to set pullups individually + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX @@ -526,61 +497,18 @@ #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 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 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 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 probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE -/** - * Endstop Noise Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -648,16 +576,6 @@ #define DEFAULT_ZJERK 0.3 #define DEFAULT_EJERK 5.0 -/** - * S-Curve Acceleration - * - * This option eliminates vibration during printing by fitting a Bézier - * curve to move acceleration, producing much smoother direction changes. - * - * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained - */ -//#define S_CURVE_ACCELERATION - //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== @@ -708,7 +626,6 @@ * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY -//#define MANUAL_PROBE_START_Z 0.2 /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -719,7 +636,7 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles /** @@ -738,9 +655,6 @@ * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing -#if ENABLED(PROBING_HEATERS_OFF) - //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) -#endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors @@ -778,16 +692,13 @@ #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] -// Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 - // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +// Speed for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Feedrate (mm/m) for the "accurate" probe of each point +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // The number of probes to perform at each point. @@ -811,10 +722,6 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done - -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 @@ -850,6 +757,9 @@ #define INVERT_Y_DIR false #define INVERT_Z_DIR false +// Enable this option for Toshiba steppers +//#define CONFIG_STEPPERS_TOSHIBA + // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. @@ -863,8 +773,6 @@ //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed -//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. - //#define Z_HOMING_HEIGHT 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. @@ -897,7 +805,7 @@ * - Use 'M211' to set software endstops on/off or report current state */ -// Min software endstops constrain movement within minimum coordinate bounds +// Min software endstops curtail movement below minimum coordinate bounds #define MIN_SOFTWARE_ENDSTOPS #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X @@ -905,7 +813,7 @@ #define MIN_SOFTWARE_ENDSTOP_Z #endif -// Max software endstops constrain movement within maximum coordinate bounds +// Max software endstops curtail movement above maximum coordinate bounds #define MAX_SOFTWARE_ENDSTOPS #if ENABLED(MAX_SOFTWARE_ENDSTOPS) #define MAX_SOFTWARE_ENDSTOP_X @@ -913,23 +821,18 @@ #define MAX_SOFTWARE_ENDSTOP_Z #endif -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD -#endif - /** - * Filament Runout Sensors - * Mechanical or opto endstops are used to check for the presence of filament. + * Filament Runout Sensor + * A mechanical or opto endstop is used to check for the presence of filament. * - * RAMPS-based boards use SERVO3_PIN for the first runout sensor. - * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. - * By default the firmware assumes HIGH=FILAMENT PRESENT. + * RAMPS-based boards use SERVO3_PIN. + * For other boards you may need to define FIL_RUNOUT_PIN. + * By default the firmware assumes HIGH = has filament, LOW = ran out */ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif @@ -977,12 +880,6 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING -/** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. - */ -//#define RESTORE_LEVELING_AFTER_G28 - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -1005,12 +902,12 @@ /** * Enable the G26 Mesh Validation Pattern tool. */ - //#define G26_MESH_VALIDATION + //#define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) - #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. - #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif @@ -1022,10 +919,13 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + // The Z probe minimum outer margin (to validate G29 parameters). + #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1048,6 +948,17 @@ #endif +#elif ENABLED(AUTO_BED_LEVELING_3POINT) + + // 3 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 + #elif ENABLED(AUTO_BED_LEVELING_UBL) //=========================================================================== @@ -1056,23 +967,27 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh + #define UBL_PROBE_PT_1_Y 180 + #define UBL_PROBE_PT_2_X 39 + #define UBL_PROBE_PT_2_Y 20 + #define UBL_PROBE_PT_3_X 180 + #define UBL_PROBE_PT_3_Y 20 + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 - //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used - // as the Z-Height correction value. - #elif ENABLED(MESH_BED_LEVELING) //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Mesh inset margin on print area #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1081,21 +996,8 @@ #endif // BED_LEVELING /** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - -/** - * Add a bed leveling sub-menu for ABL or MBL. - * Include a guided procedure if manual probing is enabled. + * Use the LCD controller for bed leveling + * Requires MESH_BED_LEVELING or PROBE_MANUALLY */ //#define LCD_BED_LEVELING @@ -1107,11 +1009,6 @@ // Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling - //#define LEVEL_CENTER_TOO // Move to the center after the last corner -#endif - /** * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. @@ -1385,11 +1282,11 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cn, cz, cz_utf8, de, el, el-gr, es, eu, fi, fr, fr_utf8, gl, + * hr, it, kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, + * tr, uk, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', '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', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', test':'TEST' } */ #define LCD_LANGUAGE en @@ -1417,6 +1314,19 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * LCD TYPE + * + * Enable ULTRA_LCD for a 16x2, 16x4, 20x2, or 20x4 character-based LCD. + * Enable DOGLCD for a 128x64 (ST7565R) Full Graphical Display. + * (These options will be enabled automatically for most displays.) + * + * IMPORTANT: 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 * @@ -1443,28 +1353,19 @@ */ //#define SD_CHECK_AND_RETRY -/** - * LCD Menu Items - * - * Disable all menus and only display the Status Screen, or - * just remove some extraneous menu items to recover space. - */ -//#define NO_LCD_MENUS -//#define SLIM_LCD_MENUS - // // 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 +#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 +#define ENCODER_STEPS_PER_MENU_ITEM 1 /** * Encoder Direction Options @@ -1516,18 +1417,12 @@ //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000 -//============================================================================= -//======================== LCD / Controller Selection ========================= -//======================== (Character-based LCDs) ========================= -//============================================================================= - // -// RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// CONTROLLER TYPE: Standard // -// Note: Usually sold with a white PCB. +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. // -//#define REPRAP_DISCOUNT_SMART_CONTROLLER // // ULTIMAKER Controller. @@ -1545,6 +1440,40 @@ // //#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 @@ -1553,6 +1482,28 @@ // //#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 1.0 + // // RigidBot Panel V1.0 // http://www.inventapart.com/ @@ -1560,28 +1511,33 @@ //#define RIGIDBOT_PANEL // -// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller -// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. // -//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 +//#define BQ_LCD_SMART_CONTROLLER // -// ANET and Tronxy 20x4 Controller +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// ANET and Tronxy Controller supported displays. // //#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. // This LCD is known to be susceptible to electrical interference // which scrambles the display. Pressing any button clears it up. // This is a LCD2004 display with 5 analog buttons. -// -// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. -// -//#define ULTRA_LCD +//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 + // A clone of the RepRapDiscount full graphics display but with + // different pins/wiring (see pins_ANET_10.h). -//============================================================================= -//======================== LCD / Controller Selection ========================= -//===================== (I2C and Shift-Register LCDs) ===================== -//============================================================================= +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI // // CONTROLLER TYPE: I2C @@ -1597,13 +1553,12 @@ //#define RA_CONTROL_PANEL // -// Sainsmart (YwRobot) LCD Displays +// Sainsmart YW Robot (LCM1602) LCD Display // -// These require F.Malpartida's LiquidCrystal_I2C library +// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home // -//#define LCD_SAINSMART_I2C_1602 -//#define LCD_SAINSMART_I2C_2004 +//#define LCD_I2C_SAINSMART_YWROBOT // // Generic LCM1602 LCD adapter @@ -1628,83 +1583,6 @@ // //#define LCD_I2C_VIKI -// -// 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 - -//============================================================================= -//======================= LCD / Controller Selection ======================= -//========================= (Graphical LCDs) ======================== -//============================================================================= - -// -// CONTROLLER TYPE: Graphical 128x64 (DOGM) -// -// IMPORTANT: The U8glib library is required for Graphical Display! -// https://github.com/olikraus/U8glib_Arduino -// - -// -// RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller -// -#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// 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 - -// -// MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel -// -//#define MINIPANEL - -// -// MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel -// -//#define MAKRPANEL - -// -// Adafruit ST7565 Full Graphic Controller. -// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ -// -//#define ELB_FULL_GRAPHIC_CONTROLLER - -// -// BQ LCD Smart Controller shipped by -// default with the BQ Hephestos 2 and Witbox 2. -// -//#define BQ_LCD_SMART_CONTROLLER - -// -// Cartesio UI -// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface -// -//#define CARTESIO_UI - -// -// LCD for Melzi Card with Graphical LCD -// -//#define LCD_FOR_MELZI - // // SSD1306 OLED full graphics generic display // @@ -1720,16 +1598,24 @@ #endif // -// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder -// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// CONTROLLER TYPE: Shift register panels // -//#define ULTI_CONTROLLER +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD // // TinyBoy2 128x64 OLED / Encoder Panel // //#define OLED_PANEL_TINYBOY2 +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + // // MKS MINI12864 with graphic controller and SD support // http://reprap.org/wiki/MKS_MINI_12864 @@ -1745,13 +1631,6 @@ // //#define CR10_STOCKDISPLAY -// -// ANET and Tronxy Graphical Controller -// -//#define ANET_FULL_GRAPHICS_LCD // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 - // A clone of the RepRapDiscount full graphics display but with - // different pins/wiring (see pins_ANET_10.h). - // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1761,40 +1640,11 @@ //#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller -// // Silvergate GLCD controller // http://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - //============================================================================= //=============================== Extra Features ============================== //============================================================================= @@ -1854,7 +1704,7 @@ * For Neopixel LED an overall brightness parameter is also available. * * *** CAUTION *** - * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * LED Strips require a MOFSET Chip between PWM lines and LEDs, * as the Arduino cannot handle the current the LEDs will require. * Failure to follow this precaution can destroy your Arduino! * NOTE: A separate 5V power supply is required! The Neopixel LED needs @@ -1919,7 +1769,9 @@ // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } -// Only power servos during movement, otherwise leave off to prevent jitter +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE #endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/wt150/Configuration_adv.h b/Marlin/example_configurations/wt150/Configuration_adv.h index 1aa252b..ea1b461 100644 --- a/Marlin/example_configurations/wt150/Configuration_adv.h +++ b/Marlin/example_configurations/wt150/Configuration_adv.h @@ -32,7 +32,7 @@ */ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 +#define CONFIGURATION_ADV_H_VERSION 010107 // @section temperature @@ -40,17 +40,6 @@ //=============================Thermal Settings ============================ //=========================================================================== -// -// Hephestos 2 24V heated bed upgrade kit. -// https://store.bq.com/en/heated-bed-kit-hephestos2 -// -//#define HEPHESTOS2_HEATED_BED_KIT -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 - #define HEATER_BED_INVERTING true -#endif - #if DISABLED(PIDTEMPBED) #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control #if ENABLED(BED_LIMIT_SWITCHING) @@ -136,6 +125,9 @@ // Show extra position information in M114 //#define M114_DETAIL +// Show extra position information in M114 +//#define M114_DETAIL + // Show Temperature ADC value // Enable for M105 to include ADC values read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES @@ -182,12 +174,10 @@ // @section temperature -// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. -// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. -#define TEMP_SENSOR_AD595_OFFSET 0.0 -#define TEMP_SENSOR_AD595_GAIN 1.0 -#define TEMP_SENSOR_AD8495_OFFSET 0.0 -#define TEMP_SENSOR_AD8495_GAIN 1.0 +//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 /** * Controller Fan @@ -198,7 +188,7 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + //#define CONTROLLER_FAN_PIN FAN1_PIN // Set a custom pin for the controller fan #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled #define CONTROLLERFAN_SPEED 255 // 255 == full speed #endif @@ -208,20 +198,10 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -/** - * PWM Fan Scaling - * - * Define the min/max speeds for PWM fans (as set with M106). - * - * With these options the M106 0-255 value range is scaled to a subset - * to ensure that the fan has enough power to spin, or to run lower - * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) - * Value 0 always turns off the fan. - * - * Define one or both of these to override the default 0-255 range. - */ +// 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 -//#define FAN_MAX_PWM 128 // @section extruder @@ -242,7 +222,6 @@ #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 -#define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed @@ -267,10 +246,6 @@ #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } - #endif #endif //=========================================================================== @@ -331,20 +306,15 @@ #endif #endif -/** - * Dual X Carriage - * - * This setup has two X carriages that can move independently, each with its own hotend. - * The carriages can be used to print an object with two colors or materials, or in - * "duplication mode" it can print two identical or X-mirrored objects simultaneously. - * The inactive carriage is parked automatically to prevent oozing. - * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. - * By default the X2 stepper is assigned to the first unused E plug on the board. - */ +// 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) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second 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 @@ -391,9 +361,6 @@ // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING - // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -446,24 +413,8 @@ // if unwanted behavior is observed on a user's machine when running at very slow speeds. #define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible - * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the - * lowest stepping frequencies. - */ -//#define ADAPTIVE_STEP_SMOOTHING - // 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] +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] /** * @section stepper motor current @@ -491,25 +442,10 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro #define DIGIPOT_I2C - -#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) // Default to settings in pins_XXXX.h files - /** - * Common slave addresses: - * - * A (A shifted) B (B shifted) IC - * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 - * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 - * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 - */ - #define DIGIPOT_I2C_ADDRESS_A 0x2F // unshifted slave address for DIGIPOT (5E <- 2F << 1) - //#define DIGIPOT_I2C_ADDRESS_B 0x2D // one DIGIPOT on this board -#endif - #define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 5 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 -// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. -// These correspond to the physical drivers, so be mindful if the order is changed. -#define DIGIPOT_I2C_MOTOR_CURRENTS { 0.22, 0.22, 0.39, 0.42, 0.42 } // MIGHTYBOARD_REVE +// Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS +#define DIGIPOT_I2C_MOTOR_CURRENTS {0.22, 0.22, 0.39, 0.42, 0.42} //=========================================================================== //=============================Additional Features=========================== @@ -536,20 +472,6 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY - -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing - #if ENABLED(LCD_PROGRESS_BAR) - #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar - #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message - #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) - //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it - //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar - #endif -#endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - /** * LED Control Menu * Enable this feature to add LED Control to the LCD menu @@ -586,20 +508,6 @@ // Add an option in the menu to run all auto#.g files //#define MENU_ADDAUTOSTART - /** - * Continue after Power-Loss (Creality3D) - * - * Store the current state to the SD Card at the start of each layer - * during SD printing. If the recovery file is found at boot time, present - * an option on the LCD screen to continue the print from the last-known - * point in the file. - */ - //#define POWER_LOSS_RECOVERY - #if ENABLED(POWER_LOSS_RECOVERY) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - #endif - /** * Sort SD file listings in alphabetical order. * @@ -638,6 +546,25 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // 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 + // Add a menu item to test the progress bar: + //#define LCD_PROGRESS_BAR_TEST + #endif + + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT @@ -658,11 +585,6 @@ */ //#define SD_REPRINT_LAST_SELECTED_FILE - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS - #endif // SDSUPPORT /** @@ -678,9 +600,6 @@ * printing performance versus fast display updates. */ #if ENABLED(DOGLCD) - // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT - // Enable to save many cycles by drawing a hollow frame on the Info Screen #define XYZ_HOLLOW_FRAME @@ -702,25 +621,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - #if ENABLED(U8GLIB_ST7920) - /** - * ST7920-based LCDs can emulate a 16 x 4 character display using - * the ST7920 character-generator for very fast screen updates. - * Enable LIGHTWEIGHT_UI to use this special display mode. - * - * Since LIGHTWEIGHT_UI has limited space, the position and status - * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the - * length of time to display the status message before clearing. - * - * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. - * This will prevent position updates from being displayed. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif // DOGLCD // @section safety @@ -760,29 +660,53 @@ // @section extruder /** - * Linear Pressure Control v1.5 + * Implementation of linear pressure control * - * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * Assumption: advance = k * (delta velocity) * K=0 means advance disabled. - * - * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! - * - * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. - * Larger K values will be needed for flexible filament and greater distances. - * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) - * print acceleration will be reduced during the affected moves to keep within the limit. - * - * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. - * Mention @Sebastianv650 on GitHub to alert the author of any issues. + * See Marlin documentation for calibration instructions. */ //#define LIN_ADVANCE + #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed - //#define LA_DEBUG // If enabled, this will generate debug information output over USB. + #define LIN_ADVANCE_K 75 + + /** + * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. + * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width. + * While this is harmless for normal printing (the fluid nature of the filament will + * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption. + * + * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio + * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures + * if the slicer is using variable widths or layer heights within one print! + * + * This option sets the default E:D ratio at startup. Use `M900` to override this value. + * + * Example: `M900 W0.4 H0.2 D1.75`, where: + * - W is the extrusion width in mm + * - H is the layer height in mm + * - D is the filament diameter in mm + * + * Example: `M900 R0.0458` to set the ratio directly. + * + * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves. + * + * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode. + * Cura (as of this writing) may produce Gcode incompatible with the automatic mode. + */ + #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI) + // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135 #endif // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -817,46 +741,9 @@ // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 -/** - * Minimum delay after setting the stepper DIR (in ns) - * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) - * 20 : Minimum for TMC2xxx drivers - * 200 : Minimum for A4988 drivers - * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) - * 650 : Minimum for DRV8825 drivers - * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) - * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 stepper drivers - * 2 : Minimum for DRV8825 stepper drivers - * 3 : Minimum for TB6600 stepper drivers - * 30 : Minimum for TB6560 stepper drivers - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MINIMUM_STEPPER_PULSE 2 - -/** - * Maximum stepping rate (in Hz) the stepper driver allows - * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) - * 500000 : Maximum for A4988 stepper driver - * 400000 : Maximum for TMC2xxx stepper drivers - * 250000 : Maximum for DRV8825 stepper driver - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 stepper driver - * 15000 : Maximum for TB6560 stepper driver - * - * Override the default value based on the driver type set in Configuration.h. - */ -//#define MAXIMUM_STEPPER_RATE 250000 +// The minimum pulse width (in µs) for stepping a stepper. +// Set this if you find stepping unreliable, or if using a very fast CPU. +#define MINIMUM_STEPPER_PULSE 0 // (µs) The smallest stepper pulse allowed // @section temperature @@ -981,55 +868,53 @@ */ //#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. - // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - // Set to 0 for manual unloading. - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. - // 0 to disable start loading and skip to fast load only - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. - // For Bowden, the full length of the tube and nozzle. - // For direct drive, the full length of the nozzle. - //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. - #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. - // Set to 0 for manual extrusion. - // Filament can be extruded repeatedly from the Filament Change menu - // until extrusion is consistent, and to purge old filament. - - // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. - - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. - #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. - - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define PAUSE_PARK_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_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #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 length for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube 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 ADVANCED_PAUSE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #define ADVANCED_PAUSE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is loaded 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 PAUSE_PARK_NOZZLE_TIMEOUT 45 // Turn off nozzle if user doesn't change filament within this time limit in seconds + #define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5 // Number of alert beeps before printer goes quiet + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable to have stepper motors hold position during filament change + // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME. + //#define PARK_HEAD_ON_PAUSE // Go to filament change position on pause, return to print position on resume + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #endif // @section tmc /** - * TMC26X Stepper Driver options - * - * The TMC26XStepper library is required for this stepper driver. - * https://github.com/trinamic/TMC26XStepper + * Enable this section if you have TMC26X motor drivers. + * You will need to import the TMC26XStepper library into the Arduino IDE for this + * (https://github.com/trinamic/TMC26XStepper.git) */ -#if HAS_DRIVER(TMC26X) +//#define HAVE_TMCDRIVER + +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + //#define X2_IS_TMC + //#define Y_IS_TMC + //#define Y2_IS_TMC + //#define Z_IS_TMC + //#define Z2_IS_TMC + //#define E0_IS_TMC + //#define E1_IS_TMC + //#define E2_IS_TMC + //#define E3_IS_TMC + //#define E4_IS_TMC #define X_MAX_CURRENT 1000 // in mA #define X_SENSE_RESISTOR 91 // in mOhms @@ -1077,27 +962,62 @@ #endif -// @section tmc_smart +// @section TMC2130, TMC2208 /** - * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to - * the hardware SPI interface on your board and define the required CS pins - * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). - * You may also use software SPI if you wish to use general purpose IO pins. + * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers. * * You'll also need the TMC2130Stepper Arduino library * (https://github.com/teemuatlut/TMC2130Stepper). * - * To use TMC2208 stepper UART-configurable stepper drivers - * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + */ +//#define HAVE_TMC2130 + +/** + * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers. + * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin. * To use the reading capabilities, also connect #_SERIAL_RX_PIN - * to PDN_UART without a resistor. + * to #_SERIAL_TX_PIN with a 1K resistor. * The drivers can also be used with hardware serial. * * You'll also need the TMC2208Stepper Arduino library * (https://github.com/teemuatlut/TMC2208Stepper). */ -#if HAS_TRINAMIC +//#define HAVE_TMC2208 + +#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) + + // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY + //#define X_IS_TMC2130 + //#define X2_IS_TMC2130 + //#define Y_IS_TMC2130 + //#define Y2_IS_TMC2130 + //#define Z_IS_TMC2130 + //#define Z2_IS_TMC2130 + //#define E0_IS_TMC2130 + //#define E1_IS_TMC2130 + //#define E2_IS_TMC2130 + //#define E3_IS_TMC2130 + //#define E4_IS_TMC2130 + + //#define X_IS_TMC2208 + //#define X2_IS_TMC2208 + //#define Y_IS_TMC2208 + //#define Y2_IS_TMC2208 + //#define Z_IS_TMC2208 + //#define Z2_IS_TMC2208 + //#define E0_IS_TMC2208 + //#define E1_IS_TMC2208 + //#define E2_IS_TMC2208 + //#define E3_IS_TMC2208 + //#define E4_IS_TMC2208 + + /** + * Stepper driver settings + */ #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current @@ -1136,16 +1056,6 @@ #define E4_CURRENT 800 #define E4_MICROSTEPS 16 - /** - * Use software SPI for TMC2130. - * The default SW SPI pins are defined the respective pins files, - * but you can override or define them here. - */ - //#define TMC_USE_SW_SPI - //#define TMC_SW_MOSI -1 - //#define TMC_SW_MISO -1 - //#define TMC_SW_SCK -1 - /** * Use Trinamic's ultra quiet stepping mode. * When disabled, Marlin will use spreadCycle stepping mode. @@ -1194,21 +1104,20 @@ /** * Use stallGuard2 to sense an obstacle and trigger an endstop. * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin. - * X, Y, and Z homing will always be done in spreadCycle mode. + * X and Y homing will always be done in spreadCycle mode. * - * X/Y/Z_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. + * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. * Higher values make the system LESS sensitive. * Lower value make the system MORE sensitive. * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting + * It is advised to set X/Y_HOME_BUMP_MM to 0. + * M914 X/Y to live tune the setting */ //#define SENSORLESS_HOMING // TMC2130 only #if ENABLED(SENSORLESS_HOMING) #define X_HOMING_SENSITIVITY 8 #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 #endif /** @@ -1217,22 +1126,6 @@ */ //#define TMC_DEBUG - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - /** * You can set your own advanced settings by filling in predefined functions. * A list of available functions can be found on the library github page @@ -1245,61 +1138,85 @@ * stepperY.interpolate(0); \ * } */ - #define TMC_ADV() { } + #define TMC_ADV() { } #endif // TMC2130 || TMC2208 // @section L6470 /** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 + * Enable this section if you have L6470 motor drivers. + * You need to import the L6470 library into the Arduino IDE for this. + * (https://github.com/ameyer/Arduino-L6470) */ -#if HAS_DRIVER(L6470) + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + //#define X2_IS_L6470 + //#define Y_IS_L6470 + //#define Y2_IS_L6470 + //#define Z_IS_L6470 + //#define Z2_IS_L6470 + //#define E0_IS_L6470 + //#define E1_IS_L6470 + //#define E2_IS_L6470 + //#define E3_IS_L6470 + //#define E4_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_MICROSTEPS 16 + #define X2_K_VAL 50 #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define Y_MICROSTEPS 16 + #define Y_K_VAL 50 #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y2_MICROSTEPS 16 + #define Y2_K_VAL 50 #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Z_MICROSTEPS 16 + #define Z_K_VAL 50 #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z2_MICROSTEPS 16 + #define Z2_K_VAL 50 #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define E0_MICROSTEPS 16 + #define E0_K_VAL 50 #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E1_MICROSTEPS 16 + #define E1_K_VAL 50 #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E2_MICROSTEPS 16 + #define E2_K_VAL 50 #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E3_MICROSTEPS 16 + #define E3_K_VAL 50 #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E4_MICROSTEPS 16 + #define E4_K_VAL 50 #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 @@ -1510,7 +1427,6 @@ /** * Specify an action command to send to the host when the printer is killed. * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. - * The host must be configured to handle the action command. */ //#define ACTION_ON_KILL "poweroff" @@ -1555,7 +1471,7 @@ //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev * microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_NONE // Type of error error correction. #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the // printer will attempt to correct the error; errors // smaller than this are ignored to minimize effects of @@ -1567,7 +1483,7 @@ #define I2CPE_ENC_2_TICKS_UNIT 2048 //#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_NONE #define I2CPE_ENC_2_EC_THRESH 0.10 #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options @@ -1599,7 +1515,7 @@ * this setting determines the minimum update time between checks. A value of 100 works well with * error rolling average when attempting to correct only for skips and not for vibration. */ - #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + #define I2CPE_MIN_UPD_TIME_MS 100 // Minimum time in miliseconds between encoder checks. // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. #define I2CPE_ERR_ROLLING_AVERAGE @@ -1609,29 +1525,27 @@ /** * MAX7219 Debug Matrix * - * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. - * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip, which can be used as a status + * display. Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + * + * Fully assembled MAX7219 boards can be found on the internet for under $2(US). + * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049 */ //#define MAX7219_DEBUG #if ENABLED(MAX7219_DEBUG) - #define MAX7219_CLK_PIN 64 - #define MAX7219_DIN_PIN 57 - #define MAX7219_LOAD_PIN 44 + #define MAX7219_CLK_PIN 64 // 77 on Re-ARM // Configuration of the 3 pins to control the display + #define MAX7219_DIN_PIN 57 // 78 on Re-ARM + #define MAX7219_LOAD_PIN 44 // 79 on Re-ARM - //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix - #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. - #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) - // connector at: right=0 bottom=-90 top=90 left=180 /** * Sample debug features * If you add more debug displays, be careful to avoid conflicts! */ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning - #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_HEAD 3 // Show the stepper queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_TAIL 5 // Show the stepper queue tail position on this and the next LED matrix row - #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + #define MAX7219_DEBUG_STEPPER_QUEUE 0 // Show the current stepper queue depth on this and the next LED matrix row // If you experience stuttering, reboots, etc. this option can reveal how // tweaks made to the configuration are affecting the printer in real-time. #endif @@ -1649,7 +1563,4 @@ // Default behaviour is limited to Z axis only. #endif -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - #endif // CONFIGURATION_ADV_H diff --git a/Marlin/fastio.h b/Marlin/fastio.h index 839db99..d5ae8f2 100644 --- a/Marlin/fastio.h +++ b/Marlin/fastio.h @@ -21,23 +21,23 @@ */ /** - * Fast I/O Routines for AVR + * Fast I/O Routines * Use direct port manipulation to save scads of processor time. - * Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al. + * Contributed by Triffid_Hunter. Modified by Kliment and the Marlin team. */ -#include - -#ifndef _FASTIO_ARDUINO_H_ -#define _FASTIO_ARDUINO_H_ +#ifndef _FASTIO_ARDUINO_H +#define _FASTIO_ARDUINO_H #include +#include "macros.h" #define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__) || defined(__AVR_AT90USB647__)) #define AVR_ATmega1284_FAMILY (defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)) #define AVR_ATmega2560_FAMILY (defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)) #define AVR_ATmega2561_FAMILY (defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)) -#define AVR_ATmega328_FAMILY (defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)) +#define AVR_ATmega328_FAMILY (defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328p__)) + /** * Include Ports and Functions @@ -53,10 +53,12 @@ #elif AVR_ATmega2561_FAMILY #include "fastio_1281.h" #else - #error "No FastIO definition for the selected AVR Board." + #error "Pins for this chip not defined in Arduino.h! If you have a working pins definition, please contribute!" #endif -#include "macros.h" +#ifndef _BV + #define _BV(PIN) (1UL << PIN) +#endif /** * Magic I/O routines @@ -66,50 +68,56 @@ * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html */ -#define _READ(IO) TEST(DIO ## IO ## _RPORT, DIO ## IO ## _PIN) +#define _READ(IO) ((bool)(DIO ## IO ## _RPORT & _BV(DIO ## IO ## _PIN))) -#define _WRITE_NC(IO,V) do{ \ - if (V) SBI(DIO ## IO ## _WPORT, DIO ## IO ## _PIN); \ - else CBI(DIO ## IO ## _WPORT, DIO ## IO ## _PIN); \ -}while(0) +// On some boards pins > 0x100 are used. These are not converted to atomic actions. A critical section is needed. -#define _WRITE_C(IO,V) do{ \ - uint8_t port_bits = DIO ## IO ## _WPORT; /* Get a mask from the current port bits */ \ - if (V) port_bits = ~port_bits; /* For setting bits, invert the mask */ \ - DIO ## IO ## _RPORT = port_bits & _BV(DIO ## IO ## _PIN); /* Atomically toggle the output port bits */ \ -}while(0) +#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); }; } while (0) -#define _WRITE(IO,V) do{ if (&(DIO ## IO ## _RPORT) < (uint8_t*)0x100) _WRITE_NC(IO,V); else _WRITE_C(IO,V); }while(0) +#define _WRITE_C(IO, v) do { if (v) { \ + CRITICAL_SECTION_START; \ + {DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); } \ + CRITICAL_SECTION_END; \ + } \ + else { \ + CRITICAL_SECTION_START; \ + {DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); } \ + CRITICAL_SECTION_END; \ + } \ + } \ + while (0) -#define _TOGGLE(IO) (DIO ## IO ## _RPORT = _BV(DIO ## IO ## _PIN)) +#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0) -#define _SET_INPUT(IO) CBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN) -#define _SET_OUTPUT(IO) SBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN) +#define _TOGGLE(IO) do {DIO ## IO ## _RPORT ^= _BV(DIO ## IO ## _PIN); } while (0) -#define _GET_INPUT(IO) !TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN) -#define _GET_OUTPUT(IO) TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN) -#define _GET_TIMER(IO) DIO ## IO ## _PWM +#define _SET_INPUT(IO) do {DIO ## IO ## _DDR &= ~_BV(DIO ## IO ## _PIN); } while (0) +#define _SET_OUTPUT(IO) do {DIO ## IO ## _DDR |= _BV(DIO ## IO ## _PIN); } while (0) -#define READ(IO) _READ(IO) -#define WRITE(IO,V) _WRITE(IO,V) -#define TOGGLE(IO) _TOGGLE(IO) +#define _GET_INPUT(IO) ((DIO ## IO ## _DDR & _BV(DIO ## IO ## _PIN)) == 0) +#define _GET_OUTPUT(IO) ((DIO ## IO ## _DDR & _BV(DIO ## IO ## _PIN)) != 0) +#define _GET_TIMER(IO) (DIO ## IO ## _PWM) -#define SET_INPUT(IO) _SET_INPUT(IO) -#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _WRITE(IO, HIGH); }while(0) -#define SET_OUTPUT(IO) _SET_OUTPUT(IO) +#define READ(IO) _READ(IO) +#define WRITE(IO,V) _WRITE(IO,V) +#define TOGGLE(IO) _TOGGLE(IO) -#define GET_INPUT(IO) _GET_INPUT(IO) -#define GET_OUTPUT(IO) _GET_OUTPUT(IO) -#define GET_TIMER(IO) _GET_TIMER(IO) +#define SET_INPUT(IO) _SET_INPUT(IO) +#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _WRITE(IO, HIGH); }while(0) +#define SET_OUTPUT(IO) _SET_OUTPUT(IO) -#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) +#define GET_INPUT(IO) _GET_INPUT(IO) +#define GET_OUTPUT(IO) _GET_OUTPUT(IO) +#define GET_TIMER(IO) _GET_TIMER(IO) + +#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0) /** * Timer and Interrupt Control */ // Waveform Generation Modes -enum WaveGenMode : char { +typedef enum { WGM_NORMAL, // 0 WGM_PWM_PC_8, // 1 WGM_PWM_PC_9, // 2 @@ -126,18 +134,18 @@ enum WaveGenMode : char { WGM_reserved, // 13 WGM_FAST_PWM_ICRn, // 14 COM OCnA WGM_FAST_PWM_OCRnA // 15 COM OCnA -}; +} WaveGenMode; // Compare Modes -enum CompareMode : char { +typedef enum { COM_NORMAL, // 0 COM_TOGGLE, // 1 Non-PWM: OCnx ... Both PWM (WGM 9,11,14,15): OCnA only ... else NORMAL COM_CLEAR_SET, // 2 Non-PWM: OCnx ... Fast PWM: OCnx/Bottom ... PF-FC: OCnx Up/Down COM_SET_CLEAR // 3 Non-PWM: OCnx ... Fast PWM: OCnx/Bottom ... PF-FC: OCnx Up/Down -}; +} CompareMode; // Clock Sources -enum ClockSource : char { +typedef enum { CS_NONE, // 0 CS_PRESCALER_1, // 1 CS_PRESCALER_8, // 2 @@ -146,10 +154,10 @@ enum ClockSource : char { CS_PRESCALER_1024, // 5 CS_EXT_FALLING, // 6 CS_EXT_RISING // 7 -}; +} ClockSource; // Clock Sources (Timer 2 only) -enum ClockSource2 : char { +typedef enum { CS2_NONE, // 0 CS2_PRESCALER_1, // 1 CS2_PRESCALER_8, // 2 @@ -158,10 +166,9 @@ enum ClockSource2 : char { CS2_PRESCALER_128, // 5 CS2_PRESCALER_256, // 6 CS2_PRESCALER_1024 // 7 -}; +} ClockSource2; // Get interrupt bits in an orderly way -// Ex: cs = GET_CS(0); coma1 = GET_COM(A,1); #define GET_WGM(T) (((TCCR##T##A >> WGM##T##0) & 0x3) | ((TCCR##T##B >> WGM##T##2 << 2) & 0xC)) #define GET_CS(T) ((TCCR##T##B >> CS##T##0) & 0x7) #define GET_COM(T,Q) ((TCCR##T##Q >> COM##T##Q##0) & 0x3) @@ -176,7 +183,6 @@ enum ClockSource2 : char { #define GET_FOCC(T) GET_FOC(T,C) // Set Wave Generation Mode bits -// Ex: SET_WGM(5,CTC_ICRn); #define _SET_WGM(T,V) do{ \ TCCR##T##A = (TCCR##T##A & ~(0x3 << WGM##T##0)) | (( int(V) & 0x3) << WGM##T##0); \ TCCR##T##B = (TCCR##T##B & ~(0x3 << WGM##T##2)) | (((int(V) >> 2) & 0x3) << WGM##T##2); \ @@ -184,7 +190,6 @@ enum ClockSource2 : char { #define SET_WGM(T,V) _SET_WGM(T,WGM_##V) // Set Clock Select bits -// Ex: SET_CS3(PRESCALER_64); #define _SET_CS(T,V) (TCCR##T##B = (TCCR##T##B & ~(0x7 << CS##T##0)) | ((int(V) & 0x7) << CS##T##0)) #define _SET_CS0(V) _SET_CS(0,V) #define _SET_CS1(V) _SET_CS(1,V) @@ -209,7 +214,6 @@ enum ClockSource2 : char { #define SET_CS(T,V) SET_CS##T(V) // Set Compare Mode bits -// Ex: SET_COMS(4,CLEAR_SET,CLEAR_SET,CLEAR_SET); #define _SET_COM(T,Q,V) (TCCR##T##Q = (TCCR##T##Q & ~(0x3 << COM##T##Q##0)) | (int(V) << COM##T##Q##0)) #define SET_COM(T,Q,V) _SET_COM(T,Q,COM_##V) #define SET_COMA(T,V) SET_COM(T,A,V) @@ -218,15 +222,12 @@ enum ClockSource2 : char { #define SET_COMS(T,V1,V2,V3) do{ SET_COMA(T,V1); SET_COMB(T,V2); SET_COMC(T,V3); }while(0) // Set Noise Canceler bit -// Ex: SET_ICNC(2,1) #define SET_ICNC(T,V) (TCCR##T##B = (V) ? TCCR##T##B | _BV(ICNC##T) : TCCR##T##B & ~_BV(ICNC##T)) // Set Input Capture Edge Select bit -// Ex: SET_ICES(5,0) #define SET_ICES(T,V) (TCCR##T##B = (V) ? TCCR##T##B | _BV(ICES##T) : TCCR##T##B & ~_BV(ICES##T)) // Set Force Output Compare bit -// Ex: SET_FOC(3,A,1) #define SET_FOC(T,Q,V) (TCCR##T##C = (V) ? TCCR##T##C | _BV(FOC##T##Q) : TCCR##T##C & ~_BV(FOC##T##Q)) #define SET_FOCA(T,V) SET_FOC(T,A,V) #define SET_FOCB(T,V) SET_FOC(T,B,V) @@ -237,11 +238,11 @@ enum ClockSource2 : char { * PWM availability macros */ -// Determine which harware PWMs are already in use +//find out which harware PWMs are already in use #if PIN_EXISTS(CONTROLLER_FAN) - #define PWM_CHK_FAN_B(p) (p == CONTROLLER_FAN_PIN || p == E0_AUTO_FAN_PIN || p == E1_AUTO_FAN_PIN || p == E2_AUTO_FAN_PIN || p == E3_AUTO_FAN_PIN || p == E4_AUTO_FAN_PIN || p == CHAMBER_AUTO_FAN_PIN) + #define PWM_CHK_FAN_B(p) (p == CONTROLLER_FAN_PIN || p == E0_AUTO_FAN_PIN || p == E1_AUTO_FAN_PIN || p == E2_AUTO_FAN_PIN || p == E3_AUTO_FAN_PIN || p == E4_AUTO_FAN_PIN) #else - #define PWM_CHK_FAN_B(p) (p == E0_AUTO_FAN_PIN || p == E1_AUTO_FAN_PIN || p == E2_AUTO_FAN_PIN || p == E3_AUTO_FAN_PIN || p == E4_AUTO_FAN_PIN || p == CHAMBER_AUTO_FAN_PIN) + #define PWM_CHK_FAN_B(p) (p == E0_AUTO_FAN_PIN || p == E1_AUTO_FAN_PIN || p == E2_AUTO_FAN_PIN || p == E3_AUTO_FAN_PIN || p == E4_AUTO_FAN_PIN) #endif #if PIN_EXISTS(FAN) || PIN_EXISTS(FAN1) || PIN_EXISTS(FAN2) @@ -250,7 +251,7 @@ enum ClockSource2 : char { #elif PIN_EXISTS(FAN1) #define PWM_CHK_FAN_A(p) (p == FAN_PIN || p == FAN1_PIN) #else - #define PWM_CHK_FAN_A(p) (p == FAN_PIN) + #define PWM_CHK_FAN_A(p) p == FAN_PIN #endif #else #define PWM_CHK_FAN_A(p) false @@ -268,15 +269,15 @@ enum ClockSource2 : char { #define PWM_CHK_MOTOR_CURRENT(p) false #endif -#ifdef NUM_SERVOS +#if defined(NUM_SERVOS) #if AVR_ATmega2560_FAMILY - #define PWM_CHK_SERVO(p) (p == 5 || (NUM_SERVOS > 12 && p == 6) || (NUM_SERVOS > 24 && p == 46)) // PWMS 3A, 4A & 5A + #define PWM_CHK_SERVO(p) ( p == 5 || NUM_SERVOS > 12 && p == 6 || NUM_SERVOS > 24 && p == 46) //PWMS 3A, 4A & 5A #elif AVR_ATmega2561_FAMILY - #define PWM_CHK_SERVO(p) (p == 5) // PWM3A + #define PWM_CHK_SERVO(p) p == 5 //PWM3A #elif AVR_ATmega1284_FAMILY #define PWM_CHK_SERVO(p) false #elif AVR_AT90USB1286_FAMILY - #define PWM_CHK_SERVO(p) (p == 16) // PWM3A + #define PWM_CHK_SERVO(p) p == 16 //PWM3A #elif AVR_ATmega328_FAMILY #define PWM_CHK_SERVO(p) false #endif @@ -300,15 +301,15 @@ enum ClockSource2 : char { // define which hardware PWMs are available for the current CPU // all timer 1 PWMS deleted from this list because they are never available #if AVR_ATmega2560_FAMILY - #define PWM_PINS(p) ((p >= 2 && p <= 10) || p == 13 || p == 44 || p == 45 || p == 46) + #define PWM_PINS(p) ((p >= 2 && p <= 10 ) || p == 13 || p == 44 || p == 45 || p == 46 ) #elif AVR_ATmega2561_FAMILY - #define PWM_PINS(p) ((p >= 2 && p <= 6) || p == 9) + #define PWM_PINS(p) ((p >= 2 && p <= 6 ) || p == 9) #elif AVR_ATmega1284_FAMILY - #define PWM_PINS(p) (p == 3 || p == 4 || p == 14 || p == 15) + #define PWM_PINS(p) (p == 3 || p == 4 || p == 14 || p == 15) #elif AVR_AT90USB1286_FAMILY - #define PWM_PINS(p) (p == 0 || p == 1 || p == 14 || p == 15 || p == 16 || p == 24) + #define PWM_PINS(p) (p == 0 || p == 1 || p == 14 || p == 15 || p == 16 || p == 24) #elif AVR_ATmega328_FAMILY - #define PWM_PINS(p) (p == 3 || p == 5 || p == 6 || p == 11) + #define PWM_PINS(p) (p == 3 || p == 5 || p == 6 || p == 11) #else #error "unknown CPU" #endif @@ -316,4 +317,4 @@ enum ClockSource2 : char { // finally - the macro that tells us if a pin is an available hardware PWM #define USEABLE_HARDWARE_PWM(p) (PWM_PINS(p) && !PWM_CHK(p)) -#endif // _FASTIO_ARDUINO_H_ +#endif // _FASTIO_ARDUINO_H diff --git a/Marlin/fastio_1280.h b/Marlin/fastio_1280.h index 09bac1f..f9f56c8 100644 --- a/Marlin/fastio_1280.h +++ b/Marlin/fastio_1280.h @@ -23,9 +23,9 @@ /** * Pin mapping for the 1280 and 2560 * - * Hardware Pin : 02 03 06 07 01 05 15 16 17 18 23 24 25 26 64 63 13 12 46 45 44 43 78 77 76 75 74 73 72 71 60 59 58 57 56 55 54 53 50 70 52 51 42 41 40 39 38 37 36 35 22 21 20 19 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 04 08 09 10 11 14 27 28 29 30 31 32 33 34 47 48 49 61 62 65 66 67 68 69 79 80 81 98 99 100 - * Port : E0 E1 E4 E5 G5 E3 H3 H4 H5 H6 B4 B5 B6 B7 J1 J0 H1 H0 D3 D2 D1 D0 A0 A1 A2 A3 A4 A5 A6 A7 C7 C6 C5 C4 C3 C2 C1 C0 D7 G2 G1 G0 L7 L6 L5 L4 L3 L2 L1 L0 B3 B2 B1 B0 F0 F1 F2 F3 F4 F5 F6 F7 K0 K1 K2 K3 K4 K5 K6 K7 E2 E6 E7 xx xx H2 H7 G3 G4 xx xx xx xx xx D4 D5 D6 xx xx J2 J3 J4 J5 J6 J7 xx xx xx xx xx - * Logical Pin : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx + * 1280 22 23 24 25 26 27 28 29 53 52 51 50 10 11 12 13 37 36 35 34 33 32 31 30 21 20 19 18 81 82 83 38 00 01 78 05 02 03 79 80 54 55 56 57 58 59 60 61 41 40 39 71 70 04 17 16 84 06 07 08 09 85 15 14 72 73 75 76 77 74 62 63 64 65 66 67 68 69 49 48 47 46 45 44 43 42 + * Port A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 G0 G1 G2 G3 G4 G5 H0 H1 H2 H3 H4 H5 H6 H7 J0 J1 J2 J3 J4 J5 J6 J7 K0 K1 K2 K3 K4 K5 K6 K7 L0 L1 L2 L3 L4 L5 L6 L7 + * Marlin 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 */ #ifndef _FASTIO_1280 diff --git a/Marlin/fastio_1281.h b/Marlin/fastio_1281.h index ab90a5f..85d2c4e 100644 --- a/Marlin/fastio_1281.h +++ b/Marlin/fastio_1281.h @@ -23,8 +23,9 @@ /** * Pin mapping for the 1281 and 2561 * - * Logical Pin: 38 39 40 41 42 43 44 45 16 10 11 12 06 07 08 09 30 31 32 33 34 35 36 37 17 18 19 20 21 22 23 24 00 01 13 05 02 03 14 15 46 47 48 49 50 51 52 53 25 26 27 28 29 04 - * Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 G0 G1 G2 G3 G4 G5 + * 1281 38 39 40 41 42 43 44 45 16 10 11 12 06 07 08 09 30 31 32 33 34 35 36 37 17 18 19 20 21 22 23 24 00 01 13 05 02 03 14 15 46 47 48 49 50 51 52 53 25 26 27 28 29 04 + * Port A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 G0 G1 G2 G3 G4 G5 + * Marlin 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 */ #ifndef _FASTIO_1281 diff --git a/Marlin/fastio_168.h b/Marlin/fastio_168.h index e624654..4ee67a3 100644 --- a/Marlin/fastio_168.h +++ b/Marlin/fastio_168.h @@ -23,8 +23,9 @@ /** * Pin mapping for the 168, 328, and 328P * - * Logical Pin: 08 09 10 11 12 13 14 15 16 17 18 19 20 21 00 01 02 03 04 05 06 07 - * Port: B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 + * 168 08 09 10 11 12 13 14 15 16 17 18 19 20 21 00 01 02 03 04 05 06 07 + * Port B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 + * Marlin 08 09 10 11 12 13 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 */ #ifndef _FASTIO_168 diff --git a/Marlin/fastio_644.h b/Marlin/fastio_644.h index 6a6e977..6465738 100644 --- a/Marlin/fastio_644.h +++ b/Marlin/fastio_644.h @@ -23,34 +23,9 @@ /** * Pin mapping for the 644, 644p, 644pa, and 1284p * - * Logical Pin: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 - * Port: B0 B1 B2 B3 B4 B5 B6 B7 D0 D1 D2 D3 D4 D5 D6 D7 C0 C1 C2 C3 C4 C5 C6 C7 A7 A6 A5 A4 A3 A2 A1 A0 - */ - -/** ATMega644 - * - * +---\/---+ - * (D 0) PB0 1| |40 PA0 (AI 0 / D31) - * (D 1) PB1 2| |39 PA1 (AI 1 / D30) - * INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29) - * PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28) - * PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27) - * MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26) - * MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25) - * SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24) - * RST 9| |32 AREF - * VCC 10| |31 GND - * GND 11| |30 AVCC - * XTAL2 12| |29 PC7 (D 23) - * XTAL1 13| |28 PC6 (D 22) - * RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI - * TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO - * INT0 RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS - * INT1 TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK - * PWM (D 12) PD4 18| |23 PC1 (D 17) SDA - * PWM (D 13) PD5 19| |22 PC0 (D 16) SCL - * PWM (D 14) PD6 20| |21 PD7 (D 15) PWM - * +--------+ + * 644p 31 30 29 28 27 26 25 24 00 01 02 03 04 05 06 07 16 17 18 19 20 21 22 23 08 09 10 11 12 13 14 15 + * Port A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 + * Marlin 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 */ #ifndef _FASTIO_644 diff --git a/Marlin/fastio_AT90USB.h b/Marlin/fastio_AT90USB.h index aee9ddc..68463e1 100644 --- a/Marlin/fastio_AT90USB.h +++ b/Marlin/fastio_AT90USB.h @@ -23,9 +23,10 @@ /** * Pin mapping (Teensy) for AT90USB646, 647, 1286, and 1287 * - * Logical Pin: 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45 - * Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 - * The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3 + * AT90USB 51 50 49 48 47 46 45 44 10 11 12 13 14 15 16 17 35 36 37 38 39 40 41 42 25 26 27 28 29 30 31 32 33 34 43 09 18 19 01 02 61 60 59 58 57 56 55 54 + * > Teensy 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45 + * Port A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 + * The pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3 */ #ifndef _FASTIO_AT90USB diff --git a/Marlin/gcode.cpp b/Marlin/gcode.cpp new file mode 100644 index 0000000..fd26aae --- /dev/null +++ b/Marlin/gcode.cpp @@ -0,0 +1,315 @@ +/** + * 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 . + * + */ + +/** + * gcode.cpp - Parser for a GCode line, providing a parameter interface. + */ + +#include "gcode.h" + +#include "Marlin.h" +#include "language.h" + +// Must be declared for allocation and to satisfy the linker +// Zero values need no initialization. + +bool GCodeParser::volumetric_enabled; + +#if ENABLED(INCH_MODE_SUPPORT) + float GCodeParser::linear_unit_factor, GCodeParser::volumetric_unit_factor; +#endif + +#if ENABLED(TEMPERATURE_UNITS_SUPPORT) + TempUnit GCodeParser::input_temp_units; +#endif + +char *GCodeParser::command_ptr, + *GCodeParser::string_arg, + *GCodeParser::value_ptr; +char GCodeParser::command_letter; +int GCodeParser::codenum; +#if USE_GCODE_SUBCODES + uint8_t GCodeParser::subcode; +#endif + +#if ENABLED(FASTER_GCODE_PARSER) + // Optimized Parameters + byte GCodeParser::codebits[4]; // found bits + uint8_t GCodeParser::param[26]; // parameter offsets from command_ptr +#else + char *GCodeParser::command_args; // start of parameters +#endif + +// Create a global instance of the GCode parser singleton +GCodeParser parser; + +/** + * Clear all code-seen (and value pointers) + * + * Since each param is set/cleared on seen codes, + * this may be optimized by commenting out ZERO(param) + */ +void GCodeParser::reset() { + string_arg = NULL; // No whole line argument + command_letter = '?'; // No command letter + codenum = 0; // No command code + #if USE_GCODE_SUBCODES + subcode = 0; // No command sub-code + #endif + #if ENABLED(FASTER_GCODE_PARSER) + ZERO(codebits); // No codes yet + //ZERO(param); // No parameters (should be safe to comment out this line) + #endif +} + +// Populate all fields by parsing a single line of GCode +// 58 bytes of SRAM are used to speed up seen/value +void GCodeParser::parse(char *p) { + + reset(); // No codes to report + + // Skip spaces + while (*p == ' ') ++p; + + // Skip N[-0-9] if included in the command line + if (*p == 'N' && NUMERIC_SIGNED(p[1])) { + #if ENABLED(FASTER_GCODE_PARSER) + //set('N', p + 1); // (optional) Set the 'N' parameter value + #endif + p += 2; // skip N[-0-9] + while (NUMERIC(*p)) ++p; // skip [0-9]* + while (*p == ' ') ++p; // skip [ ]* + } + + // *p now points to the current command, which should be G, M, or T + command_ptr = p; + + // Get the command letter, which must be G, M, or T + const char letter = *p++; + + // Nullify asterisk and trailing whitespace + char *starpos = strchr(p, '*'); + if (starpos) { + --starpos; // * + while (*starpos == ' ') --starpos; // spaces... + starpos[1] = '\0'; + } + + // Bail if the letter is not G, M, or T + switch (letter) { case 'G': case 'M': case 'T': break; default: return; } + + // Skip spaces to get the numeric part + while (*p == ' ') p++; + + // Bail if there's no command code number + if (!NUMERIC(*p)) return; + + // Save the command letter at this point + // A '?' signifies an unknown command + command_letter = letter; + + // Get the code number - integer digits only + codenum = 0; + do { + codenum *= 10, codenum += *p++ - '0'; + } while (NUMERIC(*p)); + + // Allow for decimal point in command + #if USE_GCODE_SUBCODES + if (*p == '.') { + p++; + while (NUMERIC(*p)) + subcode *= 10, subcode += *p++ - '0'; + } + #endif + + // Skip all spaces to get to the first argument, or nul + while (*p == ' ') p++; + + // The command parameters (if any) start here, for sure! + + #if DISABLED(FASTER_GCODE_PARSER) + command_args = p; // Scan for parameters in seen() + #endif + + // Only use string_arg for these M codes + if (letter == 'M') switch (codenum) { case 23: case 28: case 30: case 117: case 928: string_arg = p; return; default: break; } + + #if ENABLED(DEBUG_GCODE_PARSER) + const bool debug = codenum == 800; + #endif + + /** + * Find all parameters, set flags and pointers for fast parsing + * + * Most codes ignore 'string_arg', but those that want a string will get the right pointer. + * The following loop assigns the first "parameter" having no numeric value to 'string_arg'. + * This allows M0/M1 with expire time to work: "M0 S5 You Win!" + * For 'M118' you must use 'E1' and 'A1' rather than just 'E' or 'A' + */ + string_arg = NULL; + while (const char code = *p++) { // Get the next parameter. A NUL ends the loop + + // Special handling for M32 [P] !/path/to/file.g# + // The path must be the last parameter + if (code == '!' && letter == 'M' && codenum == 32) { + string_arg = p; // Name starts after '!' + char * const lb = strchr(p, '#'); // Already seen '#' as SD char (to pause buffering) + if (lb) *lb = '\0'; // Safe to mark the end of the filename + return; + } + + // Arguments MUST be uppercase for fast GCode parsing + #if ENABLED(FASTER_GCODE_PARSER) + #define PARAM_TEST WITHIN(code, 'A', 'Z') + #else + #define PARAM_TEST true + #endif + + if (PARAM_TEST) { + + while (*p == ' ') p++; // Skip spaces between parameters & values + + const bool has_num = NUMERIC(p[0]) // [0-9] + || (p[0] == '.' && NUMERIC(p[1])) // .[0-9] + || ( + (p[0] == '-' || p[0] == '+') && ( // [-+] + NUMERIC(p[1]) // [0-9] + || (p[1] == '.' && NUMERIC(p[2])) // .[0-9] + ) + ); + + #if ENABLED(DEBUG_GCODE_PARSER) + if (debug) { + SERIAL_ECHOPAIR("Got letter ", code); + SERIAL_ECHOPAIR(" at index ", (int)(p - command_ptr - 1)); + if (has_num) SERIAL_ECHOPGM(" (has_num)"); + } + #endif + + if (!has_num && !string_arg) { // No value? First time, keep as string_arg + string_arg = p - 1; + #if ENABLED(DEBUG_GCODE_PARSER) + if (debug) SERIAL_ECHOPAIR(" string_arg: ", hex_address((void*)string_arg)); // DEBUG + #endif + } + + #if ENABLED(DEBUG_GCODE_PARSER) + if (debug) SERIAL_EOL(); + #endif + + #if ENABLED(FASTER_GCODE_PARSER) + { + set(code, has_num ? p : NULL // Set parameter exists and pointer (NULL for no number) + #if ENABLED(DEBUG_GCODE_PARSER) + , debug + #endif + ); + } + #endif + } + else if (!string_arg) { // Not A-Z? First time, keep as the string_arg + string_arg = p - 1; + #if ENABLED(DEBUG_GCODE_PARSER) + if (debug) SERIAL_ECHOPAIR(" string_arg: ", hex_address((void*)string_arg)); // DEBUG + #endif + } + + if (!WITHIN(*p, 'A', 'Z')) { // Another parameter right away? + while (*p && DECIMAL_SIGNED(*p)) p++; // Skip over the value section of a parameter + while (*p == ' ') p++; // Skip over all spaces + } + } +} + +#if ENABLED(CNC_COORDINATE_SYSTEMS) + + // Parse the next parameter as a new command + bool GCodeParser::chain() { + #if ENABLED(FASTER_GCODE_PARSER) + char *next_command = command_ptr; + if (next_command) { + while (*next_command && *next_command != ' ') ++next_command; + while (*next_command == ' ') ++next_command; + if (!*next_command) next_command = NULL; + } + #else + const char *next_command = command_args; + #endif + if (next_command) parse(next_command); + return !!next_command; + } + +#endif // CNC_COORDINATE_SYSTEMS + +void GCodeParser::unknown_command_error() { + SERIAL_ECHO_START(); + SERIAL_ECHOPAIR(MSG_UNKNOWN_COMMAND, command_ptr); + SERIAL_CHAR('"'); + SERIAL_EOL(); +} + +#if ENABLED(DEBUG_GCODE_PARSER) + + void GCodeParser::debug() { + SERIAL_ECHOPAIR("Command: ", command_ptr); + SERIAL_ECHOPAIR(" (", command_letter); + SERIAL_ECHO(codenum); + SERIAL_ECHOLNPGM(")"); + #if ENABLED(FASTER_GCODE_PARSER) + SERIAL_ECHO(" args: \""); + for (char c = 'A'; c <= 'Z'; ++c) + if (seen(c)) { SERIAL_CHAR(c); SERIAL_CHAR(' '); } + #else + SERIAL_ECHOPAIR(" args: \"", command_args); + #endif + SERIAL_ECHOPGM("\""); + if (string_arg) { + SERIAL_ECHOPGM(" string: \""); + SERIAL_ECHO(string_arg); + SERIAL_CHAR('"'); + } + SERIAL_ECHOPGM("\n\n"); + for (char c = 'A'; c <= 'Z'; ++c) { + if (seen(c)) { + SERIAL_ECHOPAIR("Code '", c); SERIAL_ECHOPGM("':"); + if (has_value()) { + SERIAL_ECHOPAIR("\n float: ", value_float()); + SERIAL_ECHOPAIR("\n long: ", value_long()); + SERIAL_ECHOPAIR("\n ulong: ", value_ulong()); + SERIAL_ECHOPAIR("\n millis: ", value_millis()); + SERIAL_ECHOPAIR("\n sec-ms: ", value_millis_from_seconds()); + SERIAL_ECHOPAIR("\n int: ", value_int()); + SERIAL_ECHOPAIR("\n ushort: ", value_ushort()); + SERIAL_ECHOPAIR("\n byte: ", (int)value_byte()); + SERIAL_ECHOPAIR("\n bool: ", (int)value_bool()); + SERIAL_ECHOPAIR("\n linear: ", value_linear_units()); + SERIAL_ECHOPAIR("\n celsius: ", value_celsius()); + } + else + SERIAL_ECHOPGM(" (no value)"); + SERIAL_ECHOPGM("\n\n"); + } + } + } + +#endif // DEBUG_GCODE_PARSER diff --git a/Marlin/gcode.h b/Marlin/gcode.h new file mode 100644 index 0000000..3ad2113 --- /dev/null +++ b/Marlin/gcode.h @@ -0,0 +1,326 @@ +/** + * 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 . + * + */ + +/** + * gcode.h - Parser for a GCode line, providing a parameter interface. + * Codes like M149 control the way the GCode parser behaves, + * so settings for these codes are located in this class. + */ + +#ifndef GCODE_H +#define GCODE_H + +#include "enum.h" +#include "types.h" +#include "MarlinConfig.h" + +//#define DEBUG_GCODE_PARSER + +#if ENABLED(DEBUG_GCODE_PARSER) + #if ENABLED(AUTO_BED_LEVELING_UBL) + extern char* hex_address(const void * const w); + #else + #include "hex_print_routines.h" + #endif + #include "serial.h" +#endif + +/** + * GCode parser + * + * - Parse a single gcode line for its letter, code, subcode, and parameters + * - FASTER_GCODE_PARSER: + * - Flags existing params (1 bit each) + * - Stores value offsets (1 byte each) + * - Provide accessors for parameters: + * - Parameter exists + * - Parameter has value + * - Parameter value in different units and types + */ +class GCodeParser { + +private: + static char *value_ptr; // Set by seen, used to fetch the value + + #if ENABLED(FASTER_GCODE_PARSER) + static byte codebits[4]; // Parameters pre-scanned + static uint8_t param[26]; // For A-Z, offsets into command args + #else + static char *command_args; // Args start here, for slow scan + #endif + +public: + + // Global states for GCode-level units features + + static bool volumetric_enabled; + + #if ENABLED(INCH_MODE_SUPPORT) + static float linear_unit_factor, volumetric_unit_factor; + #endif + + #if ENABLED(TEMPERATURE_UNITS_SUPPORT) + static TempUnit input_temp_units; + #endif + + // Command line state + static char *command_ptr, // The command, so it can be echoed + *string_arg; // string of command line + + static char command_letter; // G, M, or T + static int codenum; // 123 + #if USE_GCODE_SUBCODES + static uint8_t subcode; // .1 + #endif + + #if ENABLED(DEBUG_GCODE_PARSER) + void debug(); + #endif + + // Reset is done before parsing + static void reset(); + + // Index so that 'X' falls on index 24 + #define PARAM_IND(N) ((N) >> 3) + #define PARAM_BIT(N) ((N) & 0x7) + #define LETTER_OFF(N) ((N) - 'A') + #define LETTER_IND(N) PARAM_IND(LETTER_OFF(N)) + #define LETTER_BIT(N) PARAM_BIT(LETTER_OFF(N)) + + #if ENABLED(FASTER_GCODE_PARSER) + + // Set the flag and pointer for a parameter + static void set(const char c, char * const ptr + #if ENABLED(DEBUG_GCODE_PARSER) + , const bool debug=false + #endif + ) { + const uint8_t ind = LETTER_OFF(c); + if (ind >= COUNT(param)) return; // Only A-Z + SBI(codebits[PARAM_IND(ind)], PARAM_BIT(ind)); // parameter exists + param[ind] = ptr ? ptr - command_ptr : 0; // parameter offset or 0 + #if ENABLED(DEBUG_GCODE_PARSER) + if (debug) { + SERIAL_ECHOPAIR("Set bit ", (int)PARAM_BIT(ind)); + SERIAL_ECHOPAIR(" of index ", (int)PARAM_IND(ind)); + SERIAL_ECHOLNPAIR(" | param = ", (int)param[ind]); + } + #endif + } + + // Code seen bit was set. If not found, value_ptr is unchanged. + // This allows "if (seen('A')||seen('B'))" to use the last-found value. + static bool seen(const char c) { + const uint8_t ind = LETTER_OFF(c); + if (ind >= COUNT(param)) return false; // Only A-Z + const bool b = TEST(codebits[PARAM_IND(ind)], PARAM_BIT(ind)); + if (b) value_ptr = param[ind] ? command_ptr + param[ind] : (char*)NULL; + return b; + } + + static bool seen_any() { return codebits[3] || codebits[2] || codebits[1] || codebits[0]; } + + #define SEEN_TEST(L) TEST(codebits[LETTER_IND(L)], LETTER_BIT(L)) + + #else // !FASTER_GCODE_PARSER + + // Code is found in the string. If not found, value_ptr is unchanged. + // This allows "if (seen('A')||seen('B'))" to use the last-found value. + static bool seen(const char c) { + const char *p = strchr(command_args, c); + const bool b = !!p; + if (b) value_ptr = DECIMAL_SIGNED(p[1]) ? &p[1] : (char*)NULL; + return b; + } + + static bool seen_any() { return *command_args == '\0'; } + + #define SEEN_TEST(L) !!strchr(command_args, L) + + #endif // !FASTER_GCODE_PARSER + + // Seen any axis parameter + static bool seen_axis() { + return SEEN_TEST('X') || SEEN_TEST('Y') || SEEN_TEST('Z') || SEEN_TEST('E'); + } + + // Populate all fields by parsing a single line of GCode + // This uses 54 bytes of SRAM to speed up seen/value + static void parse(char * p); + + #if ENABLED(CNC_COORDINATE_SYSTEMS) + // Parse the next parameter as a new command + static bool chain(); + #endif + + // The code value pointer was set + FORCE_INLINE static bool has_value() { return value_ptr != NULL; } + + // Seen a parameter with a value + inline static bool seenval(const char c) { return seen(c) && has_value(); } + + // Float removes 'E' to prevent scientific notation interpretation + inline static float value_float() { + if (value_ptr) { + char *e = value_ptr; + for (;;) { + const char c = *e; + if (c == '\0' || c == ' ') break; + if (c == 'E' || c == 'e') { + *e = '\0'; + const float ret = strtod(value_ptr, NULL); + *e = c; + return ret; + } + ++e; + } + return strtod(value_ptr, NULL); + } + return 0.0; + } + + // Code value as a long or ulong + inline static int32_t value_long() { return value_ptr ? strtol(value_ptr, NULL, 10) : 0L; } + inline static uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, NULL, 10) : 0UL; } + + // Code value for use as time + FORCE_INLINE static millis_t value_millis() { return value_ulong(); } + FORCE_INLINE static millis_t value_millis_from_seconds() { return value_float() * 1000UL; } + + // Reduce to fewer bits + FORCE_INLINE static int16_t value_int() { return (int16_t)value_long(); } + FORCE_INLINE static uint16_t value_ushort() { return (uint16_t)value_long(); } + inline static uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); } + + // Bool is true with no value or non-zero + inline static bool value_bool() { return !has_value() || value_byte(); } + + // Units modes: Inches, Fahrenheit, Kelvin + + #if ENABLED(INCH_MODE_SUPPORT) + + inline static void set_input_linear_units(const 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 static float axis_unit_factor(const AxisEnum axis) { + return (axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); + } + + inline static float value_linear_units() { return value_float() * linear_unit_factor; } + inline static float value_axis_units(const AxisEnum axis) { return value_float() * axis_unit_factor(axis); } + inline static float value_per_axis_unit(const AxisEnum axis) { return value_float() / axis_unit_factor(axis); } + + #else + + FORCE_INLINE static float value_linear_units() { return value_float(); } + FORCE_INLINE static float value_axis_units(const AxisEnum a) { UNUSED(a); return value_float(); } + FORCE_INLINE static float value_per_axis_unit(const AxisEnum a) { UNUSED(a); return value_float(); } + + #endif + + #if ENABLED(TEMPERATURE_UNITS_SUPPORT) + + inline static void set_input_temp_units(TempUnit units) { input_temp_units = units; } + + #if ENABLED(ULTIPANEL) && DISABLED(DISABLE_M503) + + FORCE_INLINE static char temp_units_code() { + return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C'; + } + FORCE_INLINE static char* temp_units_name() { + return input_temp_units == TEMPUNIT_K ? PSTR("Kelvin") : input_temp_units == TEMPUNIT_F ? PSTR("Fahrenheit") : PSTR("Celsius"); + } + inline static float to_temp_units(const float &f) { + switch (input_temp_units) { + case TEMPUNIT_F: + return f * 0.5555555556 + 32.0; + case TEMPUNIT_K: + return f + 273.15; + case TEMPUNIT_C: + default: + return f; + } + } + + #endif // ULTIPANEL && !DISABLE_M503 + + inline static float value_celsius() { + const float f = value_float(); + switch (input_temp_units) { + case TEMPUNIT_F: + return (f - 32.0) * 0.5555555556; + case TEMPUNIT_K: + return f - 273.15; + case TEMPUNIT_C: + default: + return f; + } + } + + inline static float value_celsius_diff() { + switch (input_temp_units) { + case TEMPUNIT_F: + return value_float() * 0.5555555556; + case TEMPUNIT_C: + case TEMPUNIT_K: + default: + return value_float(); + } + } + + #else // !TEMPERATURE_UNITS_SUPPORT + + FORCE_INLINE static float value_celsius() { return value_float(); } + FORCE_INLINE static float value_celsius_diff() { return value_float(); } + + #endif // !TEMPERATURE_UNITS_SUPPORT + + FORCE_INLINE static float value_feedrate() { return value_linear_units(); } + + void unknown_command_error(); + + // Provide simple value accessors with default option + FORCE_INLINE static float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; } + FORCE_INLINE static bool boolval(const char c) { return seenval(c) ? value_bool() : seen(c); } + FORCE_INLINE static uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; } + FORCE_INLINE static int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; } + FORCE_INLINE static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; } + FORCE_INLINE static int32_t longval(const char c, const int32_t dval=0) { return seenval(c) ? value_long() : dval; } + FORCE_INLINE static uint32_t ulongval(const char c, const uint32_t dval=0) { return seenval(c) ? value_ulong() : dval; } + FORCE_INLINE static float linearval(const char c, const float dval=0.0) { return seenval(c) ? value_linear_units() : dval; } + FORCE_INLINE static float celsiusval(const char c, const float dval=0.0) { return seenval(c) ? value_celsius() : dval; } + +}; + +extern GCodeParser parser; + +#endif // GCODE_H diff --git a/Marlin/hex_print_routines.cpp b/Marlin/hex_print_routines.cpp index e99a01a..65b97fc 100644 --- a/Marlin/hex_print_routines.cpp +++ b/Marlin/hex_print_routines.cpp @@ -19,13 +19,11 @@ * along with this program. If not, see . * */ - -#include "MarlinConfig.h" -#include "parser.h" +#include "Marlin.h" +#include "gcode.h" #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(M100_FREE_MEMORY_WATCHER) || ENABLED(DEBUG_GCODE_PARSER) -#include "Marlin.h" #include "hex_print_routines.h" static char _hex[7] = "0x0000"; diff --git a/Marlin/hex_print_routines.h b/Marlin/hex_print_routines.h index 05f1e79..1ca61e3 100644 --- a/Marlin/hex_print_routines.h +++ b/Marlin/hex_print_routines.h @@ -23,7 +23,10 @@ #ifndef HEX_PRINT_ROUTINES_H #define HEX_PRINT_ROUTINES_H -#include +#include "MarlinConfig.h" +#include "gcode.h" + +#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(M100_FREE_MEMORY_WATCHER) || ENABLED(DEBUG_GCODE_PARSER) // // Utility functions to create and print hex strings as nybble, byte, and word. @@ -41,4 +44,5 @@ void print_hex_byte(const uint8_t b); void print_hex_word(const uint16_t w); void print_hex_address(const void * const w); +#endif // AUTO_BED_LEVELING_UBL || M100_FREE_MEMORY_WATCHER || DEBUG_GCODE_PARSER #endif // HEX_PRINT_ROUTINES_H diff --git a/Marlin/language.h b/Marlin/language.h index d0eea74..351b9dc 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -58,7 +58,6 @@ // el-gr Greek (Greece) // en English // es Spanish -// es_utf8 Spanish (UTF8) // eu Basque-Euskera // fi Finnish // fr French @@ -149,23 +148,23 @@ #define MSG_RESEND "Resend: " #define MSG_UNKNOWN_COMMAND "Unknown command: \"" #define MSG_ACTIVE_EXTRUDER "Active Extruder: " -#define MSG_X_MIN "x_min" -#define MSG_X_MAX "x_max" -#define MSG_X2_MIN "x2_min" -#define MSG_X2_MAX "x2_max" -#define MSG_Y_MIN "y_min" -#define MSG_Y_MAX "y_max" -#define MSG_Y2_MIN "y2_min" -#define MSG_Y2_MAX "y2_max" -#define MSG_Z_MIN "z_min" -#define MSG_Z_MAX "z_max" -#define MSG_Z2_MIN "z2_min" -#define MSG_Z2_MAX "z2_max" -#define MSG_Z_PROBE "z_probe" -#define MSG_FILAMENT_RUNOUT_SENSOR "filament" +#define MSG_X_MIN "x_min: " +#define MSG_X_MAX "x_max: " +#define MSG_X2_MIN "x2_min: " +#define MSG_X2_MAX "x2_max: " +#define MSG_Y_MIN "y_min: " +#define MSG_Y_MAX "y_max: " +#define MSG_Y2_MIN "y2_min: " +#define MSG_Y2_MAX "y2_max: " +#define MSG_Z_MIN "z_min: " +#define MSG_Z_MAX "z_max: " +#define MSG_Z2_MIN "z2_min: " +#define MSG_Z2_MAX "z2_max: " +#define MSG_Z_PROBE "z_probe: " #define MSG_PROBE_Z_OFFSET "Probe Z Offset" #define MSG_SKEW_MIN "min_skew_factor: " #define MSG_SKEW_MAX "max_skew_factor: " +#define MSG_FILAMENT_RUNOUT_SENSOR "filament: " #define MSG_ERR_MATERIAL_INDEX "M145 S out of range (0-1)" #define MSG_ERR_M355_NONE "No case light" #define MSG_ERR_M421_PARAMETERS "M421 incorrect parameter usage" @@ -206,14 +205,8 @@ #define MSG_ENDSTOPS_HIT "endstops hit: " #define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented" #define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented" -#define MSG_HOTEND_TOO_COLD "Hotend too cold" - -#define MSG_FILAMENT_CHANGE_HEAT "Press button (or M108) to heat nozzle" -#define MSG_FILAMENT_CHANGE_INSERT "Insert filament and press button (or M108)" -#define MSG_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle" -#define MSG_FILAMENT_CHANGE_INSERT_LCD "Insert filament and press button" -#define MSG_FILAMENT_CHANGE_HEAT_M108 "Send M108 to heat nozzle" -#define MSG_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108" +#define MSG_TOO_COLD_FOR_M600 "M600 Hotend too cold to change filament" +#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Error in menu structure" #define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!" @@ -239,6 +232,8 @@ #define MSG_KP " Kp: " #define MSG_KI " Ki: " #define MSG_KD " Kd: " +#define MSG_B "B:" +#define MSG_T "T:" #define MSG_AT " @:" #define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h" #define MSG_PID_DEBUG " PID_DEBUG " @@ -279,15 +274,6 @@ #define MSG_Y "Y" #define MSG_Z "Z" #define MSG_E "E" -#if IS_KINEMATIC - #define MSG_A "A" - #define MSG_B "B" - #define MSG_C "C" -#else - #define MSG_A "X" - #define MSG_B "Y" - #define MSG_C "Z" -#endif #define MSG_H1 "1" #define MSG_H2 "2" #define MSG_H3 "3" diff --git a/Marlin/language_an.h b/Marlin/language_an.h index 679ed1c..3ab4d1d 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -44,7 +44,6 @@ #define MSG_AUTO_HOME_X _UxGT("Orichen X") #define MSG_AUTO_HOME_Y _UxGT("Orichen Y") #define MSG_AUTO_HOME_Z _UxGT("Orichen Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") #define MSG_LEVEL_BED_HOMING _UxGT("Orichen XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Encetar (pretar)") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Vinient punto") @@ -97,15 +96,9 @@ #define MSG_SELECT _UxGT("Trigar") #define MSG_ACC _UxGT("Aceleracion") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") #define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VMAX _UxGT("Vmax") #define MSG_VMIN _UxGT("Vmin") @@ -115,15 +108,9 @@ #define MSG_A_RETRACT _UxGT("Acel. retrac.") #define MSG_A_TRAVEL _UxGT("Acel. Viaje") #define MSG_STEPS_PER_MM _UxGT("Trangos/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A trangos/mm") - #define MSG_BSTEPS _UxGT("B trangos/mm") - #define MSG_CSTEPS _UxGT("C trangos/mm") -#else - #define MSG_ASTEPS _UxGT("X trangos/mm") - #define MSG_BSTEPS _UxGT("Y trangos/mm") - #define MSG_CSTEPS _UxGT("Z trangos/mm") -#endif +#define MSG_XSTEPS _UxGT("X trangos/mm") +#define MSG_YSTEPS _UxGT("Y trangos/mm") +#define MSG_ZSTEPS _UxGT("Z trangos/mm") #define MSG_ESTEPS _UxGT("E trangos/mm") #define MSG_E1STEPS _UxGT("E1 trangos/mm") #define MSG_E2STEPS _UxGT("E2 trangos/mm") @@ -150,6 +137,7 @@ #define MSG_NO_CARD _UxGT("No i hai tarcheta") #define MSG_DWELL _UxGT("Reposo...") #define MSG_USERWAIT _UxGT("Aguardand ordines") +#define MSG_RESUMING _UxGT("Contin. impresion") #define MSG_PRINT_ABORTED _UxGT("Impres. cancelada") #define MSG_NO_MOVE _UxGT("Sin movimiento") #define MSG_KILLED _UxGT("Aturada d'emerch.") @@ -182,14 +170,16 @@ #define MSG_ERR_MINTEMP _UxGT("Error: Temp Menima") #define MSG_ERR_MAXTEMP_BED _UxGT("Error: Temp Max base") #define MSG_ERR_MINTEMP_BED _UxGT("Error: Temp Min base") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z vedau") #define MSG_HALTED _UxGT("IMPRESORA ATURADA") #define MSG_PLEASE_RESET _UxGT("Per favor reinic.") #define MSG_SHORT_DAY _UxGT("d") #define MSG_SHORT_HOUR _UxGT("h") #define MSG_SHORT_MINUTE _UxGT("m") #define MSG_HEATING _UxGT("Calentando...") +#define MSG_HEATING_COMPLETE _UxGT("Calentamiento listo") #define MSG_BED_HEATING _UxGT("Calentando base...") +#define MSG_BED_DONE _UxGT("Base calient") #define MSG_DELTA_CALIBRATE _UxGT("Calibracion Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Calibrar X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrar Y") @@ -227,6 +217,9 @@ #define MSG_DRIVE_STRENGTH _UxGT("Fuerza d'o driver") #define MSG_DAC_PERCENT _UxGT("Driver %") #define MSG_DAC_EEPROM_WRITE _UxGT("Escri. DAC EEPROM") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extruir mas") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Resumir imp.") // @@ -253,6 +246,8 @@ #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("expulsar filament") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Aguardando a") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("cargar filamento") +#define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Aguardando a") +#define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("extruir filamento") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Aguardando impre.") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("pa continar") diff --git a/Marlin/language_bg.h b/Marlin/language_bg.h index 5920bac..d256af8 100644 --- a/Marlin/language_bg.h +++ b/Marlin/language_bg.h @@ -32,7 +32,6 @@ #define MAPPER_D0D1 // For Cyrillic #define DISPLAY_CHARSET_ISO10646_5 -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" Готов.") #define MSG_SD_INSERTED _UxGT("Картата е поставена") @@ -41,7 +40,6 @@ #define MSG_AUTOSTART _UxGT("Автостарт") #define MSG_DISABLE_STEPPERS _UxGT("Изкл. двигатели") #define MSG_AUTO_HOME _UxGT("Паркиране") -#define MSG_TMC_Z_CALIBRATION _UxGT("Калибровка Z") #define MSG_SET_HOME_OFFSETS _UxGT("Задай Начало") #define MSG_SET_ORIGIN _UxGT("Изходна точка") #define MSG_PREHEAT_1 _UxGT("Подгряване PLA") @@ -85,15 +83,9 @@ #define MSG_A_RETRACT _UxGT("A-откат") #define MSG_A_TRAVEL _UxGT("A-travel") #define MSG_STEPS_PER_MM _UxGT("Стъпки/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Aстъпки/mm") - #define MSG_BSTEPS _UxGT("Bстъпки/mm") - #define MSG_CSTEPS _UxGT("Cстъпки/mm") -#else - #define MSG_ASTEPS _UxGT("Xстъпки/mm") - #define MSG_BSTEPS _UxGT("Yстъпки/mm") - #define MSG_CSTEPS _UxGT("Zстъпки/mm") -#endif +#define MSG_XSTEPS _UxGT("X стъпки/mm") +#define MSG_YSTEPS _UxGT("Y стъпки/mm") +#define MSG_ZSTEPS _UxGT("Z стъпки/mm") #define MSG_ESTEPS _UxGT("E стъпки/mm") #define MSG_E1STEPS _UxGT("E1 стъпки/mm") #define MSG_E2STEPS _UxGT("E2 стъпки/mm") @@ -120,6 +112,7 @@ #define MSG_NO_CARD _UxGT("Няма карта") #define MSG_DWELL _UxGT("Почивка...") #define MSG_USERWAIT _UxGT("Изчакване") +#define MSG_RESUMING _UxGT("Продълж. печата") #define MSG_PRINT_ABORTED _UxGT("Печатът е прекъснат") #define MSG_NO_MOVE _UxGT("Няма движение") #define MSG_KILLED _UxGT("УБИТО.") diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index 8c8af7c..54137f7 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -32,7 +32,6 @@ #define MAPPER_C2C3 // because of "ó" #define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" preparada.") #define MSG_SD_INSERTED _UxGT("Targeta detectada.") @@ -47,7 +46,6 @@ #define MSG_AUTO_HOME_X _UxGT("X a origen") #define MSG_AUTO_HOME_Y _UxGT("Y a origen") #define MSG_AUTO_HOME_Z _UxGT("Z a origen") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibra Z") #define MSG_LEVEL_BED_HOMING _UxGT("Origen XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Premeu per iniciar") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Següent punt") @@ -102,15 +100,9 @@ #define MSG_SELECT _UxGT("Select") #define MSG_ACC _UxGT("Accel") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") #define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VMAX _UxGT("Vmax ") #define MSG_VMIN _UxGT("Vmin") @@ -119,15 +111,9 @@ #define MSG_A_RETRACT _UxGT("Accel. retracc") #define MSG_A_TRAVEL _UxGT("Accel. Viatge") #define MSG_STEPS_PER_MM _UxGT("Passos/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Apassos/mm") - #define MSG_BSTEPS _UxGT("Bpassos/mm") - #define MSG_CSTEPS _UxGT("Cpassos/mm") -#else - #define MSG_ASTEPS _UxGT("Xpassos/mm") - #define MSG_BSTEPS _UxGT("Ypassos/mm") - #define MSG_CSTEPS _UxGT("Zpassos/mm") -#endif +#define MSG_XSTEPS _UxGT("Xpassos/mm") +#define MSG_YSTEPS _UxGT("Ypassos/mm") +#define MSG_ZSTEPS _UxGT("Zpassos/mm") #define MSG_ESTEPS _UxGT("Epassos/mm") #define MSG_E1STEPS _UxGT("E1passos/mm") #define MSG_E2STEPS _UxGT("E2passos/mm") @@ -154,6 +140,7 @@ #define MSG_NO_CARD _UxGT("No hi ha targeta") #define MSG_DWELL _UxGT("En repos...") #define MSG_USERWAIT _UxGT("Esperant usuari..") +#define MSG_RESUMING _UxGT("Reprenent imp.") #define MSG_PRINT_ABORTED _UxGT("Imp. cancelada") #define MSG_NO_MOVE _UxGT("Sense moviment.") #define MSG_KILLED _UxGT("MATAT.") @@ -185,14 +172,16 @@ #define MSG_ERR_MINTEMP _UxGT("Err: TEMP MINIMA") #define MSG_ERR_MAXTEMP_BED _UxGT("Err: TEMPMAX LLIT") #define MSG_ERR_MINTEMP_BED _UxGT("Err: TEMPMIN LLIT") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z No permes") #define MSG_HALTED _UxGT("IMPRESSORA PARADA") #define MSG_PLEASE_RESET _UxGT("Reinicieu") #define MSG_SHORT_DAY _UxGT("d") // One character only #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("Escalfant...") -#define MSG_BED_HEATING _UxGT("Escalfant llit...") +#define MSG_HEATING_COMPLETE _UxGT("Escalfament fet.") +#define MSG_BED_HEATING _UxGT("Escalfant llit") +#define MSG_BED_DONE _UxGT("Llit fet.") #define MSG_DELTA_CALIBRATE _UxGT("Calibratge Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Calibra X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibra Y") @@ -230,7 +219,11 @@ #define MSG_DRIVE_STRENGTH _UxGT("Força motor") #define MSG_DAC_PERCENT _UxGT("Driver %") #define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Write") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extrudeix mes") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Repren impressió") +#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Temp minima es ") // // Filament Change screens show up to 3 lines on a 4-line display @@ -251,6 +244,8 @@ #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Espereu...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperant carrega") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("de filament") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Esperant per") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("extreure filament") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Esperant per") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("reprendre") #else // LCD_HEIGHT < 4 @@ -259,6 +254,7 @@ #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insereix i prem") #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Escalfant...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Carregant...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extrudint...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Reprenent...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_cn.h b/Marlin/language_cn.h index f02a23a..f6230a0 100644 --- a/Marlin/language_cn.h +++ b/Marlin/language_cn.h @@ -31,7 +31,6 @@ #define LANGUAGE_CN_H #define DISPLAY_CHARSET_ISO10646_CN -#define CHARSIZE 2 #define WELCOME_MSG "\xa4\xa5\xa6\xa7" #define MSG_SD_INSERTED "\xa8\xa9\xaa\xab" @@ -40,7 +39,6 @@ #define MSG_AUTOSTART "\xb1\xb2\xb3\xb4" #define MSG_DISABLE_STEPPERS "\xb5\xb6\xb7\xb8\xb9\xba" #define MSG_AUTO_HOME "\xbb\xbc\xbd" -#define MSG_TMC_Z_CALIBRATION "Calibrate Z" #define MSG_LEVEL_BED_HOMING "Homing XYZ" #define MSG_LEVEL_BED_WAITING "Click to Begin" #define MSG_LEVEL_BED_DONE "Leveling Done!" @@ -90,15 +88,9 @@ #define MSG_PID_C "PID-C" #define MSG_ACC "Accel" #define MSG_JERK "Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK "Va-jerk" - #define MSG_VB_JERK "Vb-jerk" - #define MSG_VC_JERK "Vc-jerk" -#else - #define MSG_VA_JERK "Vx-jerk" - #define MSG_VB_JERK "Vy-jerk" - #define MSG_VC_JERK "Vz-jerk" -#endif +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" +#define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " #define MSG_VMIN "Vmin" @@ -107,6 +99,9 @@ #define MSG_A_RETRACT "A-retract" #define MSG_A_TRAVEL "A-travel" #define MSG_STEPS_PER_MM "Steps/mm" +#define MSG_XSTEPS "Xsteps/mm" +#define MSG_YSTEPS "Ysteps/mm" +#define MSG_ZSTEPS "Zsteps/mm" #define MSG_ESTEPS "Esteps/mm" #define MSG_E1STEPS "E1steps/mm" #define MSG_E2STEPS "E2steps/mm" @@ -133,6 +128,7 @@ #define MSG_NO_CARD "\xf9\xa8" #define MSG_DWELL "Sleep..." #define MSG_USERWAIT "Wait for user..." +#define MSG_RESUMING "Resuming print" #define MSG_PRINT_ABORTED "Print aborted" #define MSG_NO_MOVE "No move." #define MSG_KILLED "KILLED. " diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index 950b58a..5fab5b1 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -50,7 +50,6 @@ #define MSG_AUTO_HOME_X _UxGT("Domu osa X") #define MSG_AUTO_HOME_Y _UxGT("Domu osa Y") #define MSG_AUTO_HOME_Z _UxGT("Domu osa Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrovat Z") #define MSG_LEVEL_BED_HOMING _UxGT("Mereni podlozky") #define MSG_LEVEL_BED_WAITING _UxGT("Kliknutim spustte") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Dalsi bod") @@ -147,17 +146,18 @@ #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupne") #define MSG_LED_CONTROL _UxGT("LED Nastaveni") -#define MSG_LEDS _UxGT("Svetla") +#define MSG_LEDS_ON _UxGT("Svetla Zap") +#define MSG_LEDS_OFF _UxGT("Svetla Vyp") #define MSG_LED_PRESETS _UxGT("Svetla Predvolby") -#define MSG_SET_LEDS_RED _UxGT("Cervena") -#define MSG_SET_LEDS_ORANGE _UxGT("Oranzova") -#define MSG_SET_LEDS_YELLOW _UxGT("Zluta") -#define MSG_SET_LEDS_GREEN _UxGT("Zelena") -#define MSG_SET_LEDS_BLUE _UxGT("Modra") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Fialova") -#define MSG_SET_LEDS_WHITE _UxGT("Bila") -#define MSG_SET_LEDS_DEFAULT _UxGT("Vychozi") +#define MSG_SET_LEDS_RED _UxGT("Svetla Cervena") +#define MSG_SET_LEDS_ORANGE _UxGT("Svetla Oranzova") +#define MSG_SET_LEDS_YELLOW _UxGT("Svetla Zluta") +#define MSG_SET_LEDS_GREEN _UxGT("Svetla Zelena") +#define MSG_SET_LEDS_BLUE _UxGT("Svetla Modra") +#define MSG_SET_LEDS_INDIGO _UxGT("Svetla Indigo") +#define MSG_SET_LEDS_VIOLET _UxGT("Svetla Fialova") +#define MSG_SET_LEDS_WHITE _UxGT("Svetla Bila") +#define MSG_SET_LEDS_DEFAULT _UxGT("Svetla Vychozi") #define MSG_CUSTOM_LEDS _UxGT("Vlastni svetla") #define MSG_INTENSITY_R _UxGT("Cervena intenzita") #define MSG_INTENSITY_G _UxGT("Zelena intezita") @@ -196,15 +196,9 @@ #define MSG_SELECT _UxGT("Vybrat") #define MSG_ACC _UxGT("Zrychl") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") #define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VELOCITY _UxGT("Rychlost") #define MSG_VMAX _UxGT("Vmax ") @@ -215,15 +209,9 @@ #define MSG_A_RETRACT _UxGT("A-retrakt") #define MSG_A_TRAVEL _UxGT("A-prejezd") #define MSG_STEPS_PER_MM _UxGT("Kroku/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Akroku/mm") - #define MSG_BSTEPS _UxGT("Bkroku/mm") - #define MSG_CSTEPS _UxGT("Ckroku/mm") -#else - #define MSG_ASTEPS _UxGT("Xkroku/mm") - #define MSG_BSTEPS _UxGT("Ykroku/mm") - #define MSG_CSTEPS _UxGT("Zkroku/mm") -#endif +#define MSG_XSTEPS _UxGT("Xkroku/mm") +#define MSG_YSTEPS _UxGT("Ykroku/mm") +#define MSG_ZSTEPS _UxGT("Zkroku/mm") #define MSG_ESTEPS _UxGT("Ekroku/mm") #define MSG_E1STEPS _UxGT("E1kroku/mm") #define MSG_E2STEPS _UxGT("E2kroku/mm") @@ -235,8 +223,6 @@ #define MSG_FILAMENT _UxGT("Filament") #define MSG_VOLUMETRIC_ENABLED _UxGT("E na mm3") #define MSG_FILAMENT_DIAM _UxGT("Fil. Prum.") -#define MSG_FILAMENT_UNLOAD _UxGT("Vysunout mm") -#define MSG_FILAMENT_LOAD _UxGT("Zavest mm") #define MSG_ADVANCE_K _UxGT("K pro posun") #define MSG_CONTRAST _UxGT("Kontrast LCD") #define MSG_STORE_EEPROM _UxGT("Ulozit nastaveni") @@ -255,6 +241,7 @@ #define MSG_DWELL _UxGT("Uspano...") #define MSG_USERWAIT _UxGT("Cekani na uziv...") #define MSG_PRINT_PAUSED _UxGT("Tisk pozastaven") +#define MSG_RESUMING _UxGT("Obnovovani tisku") #define MSG_PRINT_ABORTED _UxGT("Tisk zrusen") #define MSG_NO_MOVE _UxGT("Zadny pohyb.") #define MSG_KILLED _UxGT("PRERUSENO. ") @@ -269,10 +256,6 @@ #define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") #define MSG_AUTORETRACT _UxGT("AutoRetr.") #define MSG_FILAMENTCHANGE _UxGT("Vymenit filament") -#define MSG_FILAMENTLOAD _UxGT("Zavest filament") -#define MSG_FILAMENTUNLOAD _UxGT("Vysunout filament") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Vysunout vse") - #define MSG_INIT_SDCARD _UxGT("Nacist SD kartu") #define MSG_CNG_SDCARD _UxGT("Vymenit SD kartu") #define MSG_ZPROBE_OUT _UxGT("Sonda Z mimo podl") @@ -296,14 +279,16 @@ #define MSG_ERR_MINTEMP _UxGT("NIZKA TEPLOTA") #define MSG_ERR_MAXTEMP_BED _UxGT("VYS. TEPL. PODL.") #define MSG_ERR_MINTEMP_BED _UxGT("NIZ. TEPL. PODL.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z ZAKAZANO") #define MSG_HALTED _UxGT("TISK. ZASTAVENA") #define MSG_PLEASE_RESET _UxGT("Provedte reset") #define MSG_SHORT_DAY _UxGT("d") #define MSG_SHORT_HOUR _UxGT("h") #define MSG_SHORT_MINUTE _UxGT("m") #define MSG_HEATING _UxGT("Zahrivani...") -#define MSG_BED_HEATING _UxGT("Zahrivani podl...") +#define MSG_HEATING_COMPLETE _UxGT("Zahrati hotovo.") +#define MSG_BED_HEATING _UxGT("Zahrivani podl.") +#define MSG_BED_DONE _UxGT("Podlozka hotova.") #define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrace") #define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrovat X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrovat Y") @@ -351,16 +336,14 @@ #define MSG_DRIVE_STRENGTH _UxGT("Buzeni motoru") #define MSG_DAC_PERCENT _UxGT("Motor %") #define MSG_DAC_EEPROM_WRITE _UxGT("Ulozit do EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("TISK POZASTAVEN") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("ZAVEDENI FILAMENTU") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("VYSUNUTI FILAMENTU") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("MOZNOSTI OBNOVENI:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Vytlacit vic") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Jeste vytlacit") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Obnovit tisk") +#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Min. teplota je ") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Tryska: ") #define MSG_ERR_HOMING_FAILED _UxGT("Parkovani selhalo") #define MSG_ERR_PROBING_FAILED _UxGT("Kalibrace selhala") -#define MSG_M600_TOO_COLD _UxGT("M600: Moc studeny") #if LCD_HEIGHT >= 4 // Up to 3 lines allowed @@ -380,8 +363,9 @@ #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Cekejte prosim") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("na zavedeni") #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vyckejte na") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("vytlaceni") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Cekejte prosim") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("na vytlaceni") + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 _UxGT("filamentu") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Cekejte prosim") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("na pokracovani") #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("tisku") @@ -392,7 +376,7 @@ #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vlozte, kliknete") #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nahrivani...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Zavadeni...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vytlacovani...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Vytlacovani...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Pokracovani...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_cz_utf8.h b/Marlin/language_cz_utf8.h index e76c947..cad7d2a 100644 --- a/Marlin/language_cz_utf8.h +++ b/Marlin/language_cz_utf8.h @@ -37,14 +37,12 @@ #define MAPPER_C3C4C5_CZ #define DISPLAY_CHARSET_ISO10646_CZ -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" připraven.") #define MSG_BACK _UxGT("Zpět") #define MSG_SD_INSERTED _UxGT("Karta vložena") #define MSG_SD_REMOVED _UxGT("Karta vyjmuta") #define MSG_LCD_ENDSTOPS _UxGT("Endstopy") // max 8 znaku -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft Endstopy") #define MSG_MAIN _UxGT("Hlavní nabídka") #define MSG_AUTOSTART _UxGT("Autostart") #define MSG_DISABLE_STEPPERS _UxGT("Uvolnit motory") @@ -54,7 +52,6 @@ #define MSG_AUTO_HOME_X _UxGT("Domů osa X") #define MSG_AUTO_HOME_Y _UxGT("Domů osa Y") #define MSG_AUTO_HOME_Z _UxGT("Domů osa Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrovat Z") #define MSG_LEVEL_BED_HOMING _UxGT("Měření podložky") #define MSG_LEVEL_BED_WAITING _UxGT("Kliknutím spusťte") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Další bod") @@ -151,17 +148,18 @@ #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupně") #define MSG_LED_CONTROL _UxGT("LED Nastavení") -#define MSG_LEDS _UxGT("Světla") +#define MSG_LEDS_ON _UxGT("Světla Zap") +#define MSG_LEDS_OFF _UxGT("Světla Vyp") #define MSG_LED_PRESETS _UxGT("Světla Předvolby") -#define MSG_SET_LEDS_RED _UxGT("Červená") -#define MSG_SET_LEDS_ORANGE _UxGT("Oranžová") -#define MSG_SET_LEDS_YELLOW _UxGT("Žlutá") -#define MSG_SET_LEDS_GREEN _UxGT("Zelená") -#define MSG_SET_LEDS_BLUE _UxGT("Modrá") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Fialová") -#define MSG_SET_LEDS_WHITE _UxGT("Bílá") -#define MSG_SET_LEDS_DEFAULT _UxGT("Výchozí") +#define MSG_SET_LEDS_RED _UxGT("Světla Červená") +#define MSG_SET_LEDS_ORANGE _UxGT("Světla Oranžová") +#define MSG_SET_LEDS_YELLOW _UxGT("Světla Žlutá") +#define MSG_SET_LEDS_GREEN _UxGT("Světla Zelená") +#define MSG_SET_LEDS_BLUE _UxGT("Světla Modrá") +#define MSG_SET_LEDS_INDIGO _UxGT("Světla Indigo") +#define MSG_SET_LEDS_VIOLET _UxGT("Světla Fialová") +#define MSG_SET_LEDS_WHITE _UxGT("Světla Bílá") +#define MSG_SET_LEDS_DEFAULT _UxGT("Světla Výchozí") #define MSG_CUSTOM_LEDS _UxGT("Vlastní světla") #define MSG_INTENSITY_R _UxGT("Červená intenzita") #define MSG_INTENSITY_G _UxGT("Zelená intezita") @@ -200,15 +198,9 @@ #define MSG_SELECT _UxGT("Vybrat") #define MSG_ACC _UxGT("Zrychl") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") #define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VELOCITY _UxGT("Rychlost") #define MSG_VMAX _UxGT("Vmax ") @@ -219,15 +211,9 @@ #define MSG_A_RETRACT _UxGT("A-retrakt") #define MSG_A_TRAVEL _UxGT("A-přejezd") #define MSG_STEPS_PER_MM _UxGT("Kroků/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Akroků/mm") - #define MSG_BSTEPS _UxGT("Bkroků/mm") - #define MSG_CSTEPS _UxGT("Ckroků/mm") -#else - #define MSG_ASTEPS _UxGT("Xkroků/mm") - #define MSG_BSTEPS _UxGT("Ykroků/mm") - #define MSG_CSTEPS _UxGT("Zkroků/mm") -#endif +#define MSG_XSTEPS _UxGT("Xkroků/mm") +#define MSG_YSTEPS _UxGT("Ykroků/mm") +#define MSG_ZSTEPS _UxGT("Zkroků/mm") #define MSG_ESTEPS _UxGT("Ekroků/mm") #define MSG_E1STEPS _UxGT("E1kroků/mm") #define MSG_E2STEPS _UxGT("E2kroků/mm") @@ -239,8 +225,6 @@ #define MSG_FILAMENT _UxGT("Filament") #define MSG_VOLUMETRIC_ENABLED _UxGT("E na mm3") #define MSG_FILAMENT_DIAM _UxGT("Fil. Prum.") -#define MSG_FILAMENT_UNLOAD _UxGT("Vysunout mm") -#define MSG_FILAMENT_LOAD _UxGT("Zavést mm") #define MSG_ADVANCE_K _UxGT("K pro posun") #define MSG_CONTRAST _UxGT("Kontrast LCD") #define MSG_STORE_EEPROM _UxGT("Uložit nastavení") @@ -254,13 +238,12 @@ #define MSG_PAUSE_PRINT _UxGT("Pozastavit tisk") #define MSG_RESUME_PRINT _UxGT("Obnovit tisk") #define MSG_STOP_PRINT _UxGT("Zastavit tisk") -#define MSG_POWER_LOSS_RECOVERY _UxGT("Obnova vypadku") #define MSG_CARD_MENU _UxGT("Tisknout z SD") #define MSG_NO_CARD _UxGT("Žádná SD karta") #define MSG_DWELL _UxGT("Uspáno...") #define MSG_USERWAIT _UxGT("Čekání na uživ...") #define MSG_PRINT_PAUSED _UxGT("Tisk pozastaven") -#define MSG_PRINTING _UxGT("Tisknu...") +#define MSG_RESUMING _UxGT("Obnovování tisku") #define MSG_PRINT_ABORTED _UxGT("Tisk zrušen") #define MSG_NO_MOVE _UxGT("Žádný pohyb.") #define MSG_KILLED _UxGT("PŘERUSENO. ") @@ -275,10 +258,6 @@ #define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") #define MSG_AUTORETRACT _UxGT("AutoRetr.") #define MSG_FILAMENTCHANGE _UxGT("Vyměnit filament") -#define MSG_FILAMENTLOAD _UxGT("Zavést filament") -#define MSG_FILAMENTUNLOAD _UxGT("Vysunout filament") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Vysunout vše") - #define MSG_INIT_SDCARD _UxGT("Načíst SD kartu") #define MSG_CNG_SDCARD _UxGT("Vyměnit SD kartu") #define MSG_ZPROBE_OUT _UxGT("Sonda Z mimo podl") @@ -296,24 +275,22 @@ #define MSG_BABYSTEP_Z _UxGT("Babystep Z") #define MSG_ENDSTOP_ABORT _UxGT("Endstop abort") #define MSG_HEATING_FAILED_LCD _UxGT("Chyba zahřívání") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Chyba zahř. podl.") #define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEPLOTA") #define MSG_THERMAL_RUNAWAY _UxGT("TEPLOTNÍ SKOK") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("PODL. TEPL. SKOK") #define MSG_ERR_MAXTEMP _UxGT("VYSOKÁ TEPLOTA") #define MSG_ERR_MINTEMP _UxGT("NÍZKA TEPLOTA") #define MSG_ERR_MAXTEMP_BED _UxGT("VYS. TEPL. PODL.") #define MSG_ERR_MINTEMP_BED _UxGT("NÍZ. TEPL. PODL.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z ZAKÁZÁNO") #define MSG_HALTED _UxGT("TISK. ZASTAVENA") #define MSG_PLEASE_RESET _UxGT("Proveďte reset") #define MSG_SHORT_DAY _UxGT("d") #define MSG_SHORT_HOUR _UxGT("h") #define MSG_SHORT_MINUTE _UxGT("m") #define MSG_HEATING _UxGT("Zahřívání...") -#define MSG_COOLING _UxGT("Chlazení") -#define MSG_BED_HEATING _UxGT("Zahřívání podl...") -#define MSG_BED_COOLING _UxGT("Chlazení podl...") +#define MSG_HEATING_COMPLETE _UxGT("Zahřáti hotovo.") +#define MSG_BED_HEATING _UxGT("Zahřívání podl.") +#define MSG_BED_DONE _UxGT("Podložka hotova.") #define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrace") #define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrovat X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrovat Y") @@ -322,7 +299,6 @@ #define MSG_DELTA_SETTINGS _UxGT("Delta nastavení") #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Autokalibrace") #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Nast.výšku delty") -#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Nast. Z-ofset") #define MSG_DELTA_DIAG_ROD _UxGT("Diag rameno") #define MSG_DELTA_HEIGHT _UxGT("Výška") #define MSG_DELTA_RADIUS _UxGT("Poloměr") @@ -362,16 +338,14 @@ #define MSG_DRIVE_STRENGTH _UxGT("Buzení motorů") #define MSG_DAC_PERCENT _UxGT("Motor %") #define MSG_DAC_EEPROM_WRITE _UxGT("Uložit do EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("TISK POZASTAVEN") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("ZAVEDENÍ FILAMENTU") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("VYSUNUTÍ FILAMENTU") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("MOŽNOSTI OBNOVENÍ:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Vytlačit víc") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Ještě vytlačit") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Obnovit tisk") +#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Min. teplota je ") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Tryska: ") #define MSG_ERR_HOMING_FAILED _UxGT("Parkování selhalo") #define MSG_ERR_PROBING_FAILED _UxGT("Kalibrace selhala") -#define MSG_M600_TOO_COLD _UxGT("M600: Moc studený") #if LCD_HEIGHT >= 4 // Up to 3 lines allowed @@ -391,8 +365,9 @@ #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Čekejte prosím") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("na zavedení") #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vyčkejte na") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("vytlačení") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Čekejte prosím") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("na vytlačení") + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 _UxGT("filamentu") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Čekejte prosím") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("na pokračování") #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("tisku") @@ -403,7 +378,7 @@ #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte, klikněte") #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nahřívání...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Zavádění...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vytlačování...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Vytlačování...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Pokračování...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_da.h b/Marlin/language_da.h index e51f8d0..1a3fdd4 100644 --- a/Marlin/language_da.h +++ b/Marlin/language_da.h @@ -32,7 +32,6 @@ #define MAPPER_C2C3 #define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" er klar") #define MSG_SD_INSERTED _UxGT("Kort isat") @@ -45,7 +44,6 @@ #define MSG_AUTO_HOME_X _UxGT("Home X") #define MSG_AUTO_HOME_Y _UxGT("Home Y") #define MSG_AUTO_HOME_Z _UxGT("Home Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrer Z") #define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Klik når du er klar") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Næste punkt") @@ -99,15 +97,9 @@ #define MSG_SELECT _UxGT("Vælg") #define MSG_ACC _UxGT("Accel") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") #define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VMAX _UxGT("Vmax ") #define MSG_VMIN _UxGT("Vmin") @@ -116,15 +108,9 @@ #define MSG_A_RETRACT _UxGT("A-retract") #define MSG_A_TRAVEL _UxGT("A-rejse") #define MSG_STEPS_PER_MM _UxGT("Steps/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Asteps/mm") - #define MSG_BSTEPS _UxGT("Bsteps/mm") - #define MSG_CSTEPS _UxGT("Csteps/mm") -#else - #define MSG_ASTEPS _UxGT("Xsteps/mm") - #define MSG_BSTEPS _UxGT("Ysteps/mm") - #define MSG_CSTEPS _UxGT("Zsteps/mm") -#endif +#define MSG_XSTEPS _UxGT("Xsteps/mm") +#define MSG_YSTEPS _UxGT("Ysteps/mm") +#define MSG_ZSTEPS _UxGT("Zsteps/mm") #define MSG_ESTEPS _UxGT("Esteps/mm") #define MSG_E1STEPS _UxGT("E1steps/mm") #define MSG_E2STEPS _UxGT("E2steps/mm") @@ -151,6 +137,7 @@ #define MSG_NO_CARD _UxGT("Intet SD kort") #define MSG_DWELL _UxGT("Dvale...") #define MSG_USERWAIT _UxGT("Venter på bruger...") +#define MSG_RESUMING _UxGT("Forsætter printet") #define MSG_PRINT_ABORTED _UxGT("Print annulleret") #define MSG_NO_MOVE _UxGT("Ingen bevægelse.") #define MSG_KILLED _UxGT("DRÆBT. ") @@ -183,14 +170,16 @@ #define MSG_ERR_MINTEMP _UxGT("Fejl: Min temp") #define MSG_ERR_MAXTEMP_BED _UxGT("Fejl: Maks Plade temp") #define MSG_ERR_MINTEMP_BED _UxGT("Fejl: Min Plade temp") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z Forbudt") #define MSG_HALTED _UxGT("PRINTER STOPPET") #define MSG_PLEASE_RESET _UxGT("Reset Venligst") #define MSG_SHORT_DAY _UxGT("d") // Kun et bogstav #define MSG_SHORT_HOUR _UxGT("h") // Kun et bogstav #define MSG_SHORT_MINUTE _UxGT("m") // Kun et bogstav #define MSG_HEATING _UxGT("Opvarmer...") -#define MSG_BED_HEATING _UxGT("Opvarmer plade...") +#define MSG_HEATING_COMPLETE _UxGT("Opvarmet") +#define MSG_BED_HEATING _UxGT("Opvarmer plade") +#define MSG_BED_DONE _UxGT("Plade opvarmet") #define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrering") #define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrer X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrer Y") @@ -228,6 +217,9 @@ #define MSG_DAC_PERCENT _UxGT("Driv %") #define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Skriv") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extruder mere") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Forsæt print") #if LCD_HEIGHT >= 4 @@ -241,6 +233,8 @@ #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("for at fortsætte...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Vent på") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament indtag") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Vent på") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("filament extrudering") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Vent på at print") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("fortsætter") #else // LCD_HEIGHT < 4 @@ -248,6 +242,7 @@ #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Udskyder...") #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Indsæt og klik") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Indtager...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extrudere...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Fortsætter...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_de.h b/Marlin/language_de.h index 2a28c91..4036a0d 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -32,7 +32,6 @@ #define MAPPER_C2C3 #define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 #define THIS_LANGUAGES_SPECIAL_SYMBOLS _UxGT("ÄäÖöÜüß²³") @@ -44,14 +43,13 @@ #define MSG_MAIN _UxGT("Hauptmenü") #define MSG_AUTOSTART _UxGT("Autostart") #define MSG_DISABLE_STEPPERS _UxGT("Motoren deaktivieren") // M84 -#define MSG_DEBUG_MENU _UxGT("Debug Menü") +#define MSG_DEBUG_MENU _UxGT("Debug Menu") #define MSG_PROGRESS_BAR_TEST _UxGT("Fortschrittsb. Test") #define MSG_AUTO_HOME _UxGT("Home") // G28 #define MSG_AUTO_HOME_X _UxGT("Home X") #define MSG_AUTO_HOME_Y _UxGT("Home Y") #define MSG_AUTO_HOME_Z _UxGT("Home Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibriere Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Home XYZ") +#define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Klick für Start") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Nächste Koordinate") #define MSG_LEVEL_BED_DONE _UxGT("Fertig") @@ -97,7 +95,6 @@ #define MSG_NOZZLE _UxGT("Düse") #define MSG_BED _UxGT("Bett") #define MSG_FAN_SPEED _UxGT("Lüfter") -#define MSG_EXTRA_FAN_SPEED _UxGT("Extra Lüfter") #define MSG_FLOW _UxGT("Flussrate") #define MSG_CONTROL _UxGT("Einstellungen") #define MSG_MIN LCD_STR_THERMOMETER _UxGT(" min") @@ -113,15 +110,9 @@ #define MSG_SELECT _UxGT("Auswählen") #define MSG_ACC _UxGT("A") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("V A Jerk") - #define MSG_VB_JERK _UxGT("V B Jerk") - #define MSG_VC_JERK _UxGT("V C Jerk") -#else - #define MSG_VA_JERK _UxGT("V X Jerk") - #define MSG_VB_JERK _UxGT("V Y Jerk") - #define MSG_VC_JERK _UxGT("V Z Jerk") -#endif +#define MSG_VX_JERK _UxGT("V X Jerk") +#define MSG_VY_JERK _UxGT("V Y Jerk") +#define MSG_VZ_JERK _UxGT("V Z Jerk") #define MSG_VE_JERK _UxGT("V E Jerk") #define MSG_VELOCITY _UxGT("Geschwindigkeit") #define MSG_VMAX _UxGT("V max ") // space by purpose @@ -132,15 +123,9 @@ #define MSG_A_RETRACT _UxGT("A Retract") #define MSG_A_TRAVEL _UxGT("A Leerfahrt") #define MSG_STEPS_PER_MM _UxGT("Steps/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A Steps/mm") - #define MSG_BSTEPS _UxGT("B Steps/mm") - #define MSG_CSTEPS _UxGT("C Steps/mm") -#else - #define MSG_ASTEPS _UxGT("X Steps/mm") - #define MSG_BSTEPS _UxGT("Y Steps/mm") - #define MSG_CSTEPS _UxGT("Z Steps/mm") -#endif +#define MSG_XSTEPS _UxGT("X Steps/mm") +#define MSG_YSTEPS _UxGT("Y Steps/mm") +#define MSG_ZSTEPS _UxGT("Z Steps/mm") #define MSG_ESTEPS _UxGT("E Steps/mm") #define MSG_E1STEPS _UxGT("E1 Steps/mm") #define MSG_E2STEPS _UxGT("E2 Steps/mm") @@ -152,8 +137,6 @@ #define MSG_FILAMENT _UxGT("Filament") #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm³") #define MSG_FILAMENT_DIAM _UxGT("D Fil.") -#define MSG_FILAMENT_UNLOAD _UxGT("Entladen mm") -#define MSG_FILAMENT_LOAD _UxGT("Laden mm") #define MSG_ADVANCE_K _UxGT("Advance Faktor") #define MSG_CONTRAST _UxGT("LCD Kontrast") #define MSG_STORE_EEPROM _UxGT("Konfig. speichern") @@ -172,6 +155,7 @@ #define MSG_DWELL _UxGT("Warten...") #define MSG_USERWAIT _UxGT("Warte auf Nutzer") #define MSG_PRINT_PAUSED _UxGT("Druck pausiert") +#define MSG_RESUMING _UxGT("Druckfortsetzung") #define MSG_PRINT_ABORTED _UxGT("Druck abgebrochen") #define MSG_NO_MOVE _UxGT("Motoren eingeschaltet") #define MSG_KILLED _UxGT("ABGEBROCHEN") @@ -183,16 +167,11 @@ #define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Wechs. UnRet mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") #define MSG_AUTORETRACT _UxGT("Autom. Retract") #define MSG_FILAMENTCHANGE _UxGT("Filament wechseln") -#define MSG_FILAMENTLOAD _UxGT("Filament laden") -#define MSG_FILAMENTUNLOAD _UxGT("Filament entladen") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Alles entladen") #define MSG_INIT_SDCARD _UxGT("SD-Karte erkennen") // Manually initialize the SD-card via user interface #define MSG_CNG_SDCARD _UxGT("SD-Karte getauscht") // SD-card changed by user. For machines with no autocarddetect. Both send "M21" #define MSG_ZPROBE_OUT _UxGT("Sensor ausserhalb") -#define MSG_SKEW_FACTOR _UxGT("Skew Faktor") #define MSG_BLTOUCH _UxGT("BLTouch") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Test") #define MSG_BLTOUCH_RESET _UxGT("BLTouch Reset") @@ -208,19 +187,20 @@ #define MSG_HEATING_FAILED_LCD _UxGT("HEIZEN FEHLGESCHLAGEN") #define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEMPERATURABWEICHUNG") #define MSG_THERMAL_RUNAWAY LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("BETT") MSG_THERMAL_RUNAWAY #define MSG_ERR_MAXTEMP LCD_STR_THERMOMETER _UxGT(" ÜBERSCHRITTEN") #define MSG_ERR_MINTEMP LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN") #define MSG_ERR_MAXTEMP_BED _UxGT("BETT ") LCD_STR_THERMOMETER _UxGT(" ÜBERSCHRITTEN") #define MSG_ERR_MINTEMP_BED _UxGT("BETT ") LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z verboten") #define MSG_HALTED _UxGT("DRUCKER STOPP") #define MSG_PLEASE_RESET _UxGT("Bitte Resetten") #define MSG_SHORT_DAY _UxGT("t") // One character only #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("Extr. heizt...") +#define MSG_HEATING_COMPLETE _UxGT("Extr. aufgeheizt") #define MSG_BED_HEATING _UxGT("Bett heizt...") +#define MSG_BED_DONE _UxGT("Bett aufgeheizt") #define MSG_DELTA_CALIBRATE _UxGT("Delta kalibrieren") #define MSG_DELTA_CALIBRATE_X _UxGT("Kalibriere X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibriere Y") @@ -229,9 +209,7 @@ #define MSG_DELTA_SETTINGS _UxGT("Delta Einst. anzeig.") #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Autom. Kalibrierung") #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Delta Höhe setzen") -#define MSG_DELTA_DIAG_ROD _UxGT("Diag Rod") -#define MSG_DELTA_HEIGHT _UxGT("Höhe") -#define MSG_DELTA_RADIUS _UxGT("Radius") + #define MSG_INFO_MENU _UxGT("Über den Drucker") #define MSG_INFO_PRINTER_MENU _UxGT("Drucker Info") #define MSG_3POINT_LEVELING _UxGT("3-Punkt Nivellierung") @@ -250,7 +228,7 @@ #define MSG_UBL_DOING_G29 _UxGT("G29 UBL läuft!") #define MSG_UBL_UNHOMED _UxGT("Erst XYZ homen") -#define MSG_UBL_TOOLS _UxGT("UBL Werkzeuge") +#define MSG_UBL_TOOLS _UxGT("UBL Tools") #define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") #define MSG_UBL_MANUAL_MESH _UxGT("Netz manuell erst.") #define MSG_UBL_BC_INSERT _UxGT("Unterlegen & messen") @@ -273,7 +251,7 @@ #define MSG_UBL_BUILD_ABS_MESH _UxGT("Netz erstellen ABS") #define MSG_UBL_BUILD_COLD_MESH _UxGT("Netz erstellen kalt") #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Netz Höhe einst.") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Höhe") +#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Height Amount") #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Netz validieren") #define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Netz validieren PLA") #define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Netz validieren ABS") @@ -303,33 +281,11 @@ #define MSG_UBL_STORAGE_SLOT _UxGT("Memory Slot") #define MSG_UBL_LOAD_MESH _UxGT("Bett Netz laden") #define MSG_UBL_SAVE_MESH _UxGT("Bett Netz speichern") -#define MSG_MESH_LOADED _UxGT("Netz %i geladen") -#define MSG_MESH_SAVED _UxGT("Netz %i gespeichert") -#define MSG_NO_STORAGE _UxGT("Kein Speicher") #define MSG_UBL_SAVE_ERROR _UxGT("ERR:UBL speichern") #define MSG_UBL_RESTORE_ERROR _UxGT("ERR:UBL wiederherst.") #define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Versatz angehalten") #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Schrittweises UBL") -#define MSG_LED_CONTROL _UxGT("LED Kontrolle") -#define MSG_LEDS _UxGT("Licht") -#define MSG_LED_PRESETS _UxGT("Licht Einstellungen") -#define MSG_SET_LEDS_RED _UxGT("Rot") -#define MSG_SET_LEDS_ORANGE _UxGT("Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("Gelb") -#define MSG_SET_LEDS_GREEN _UxGT("Grün") -#define MSG_SET_LEDS_BLUE _UxGT("Blau") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Violett") -#define MSG_SET_LEDS_WHITE _UxGT("Weiß") -#define MSG_SET_LEDS_DEFAULT _UxGT("Standard") -#define MSG_CUSTOM_LEDS _UxGT("Benutzerdef.") -#define MSG_INTENSITY_R _UxGT("Intensität Rot") -#define MSG_INTENSITY_G _UxGT("Intensität Grün") -#define MSG_INTENSITY_B _UxGT("Intensität Blau") -#define MSG_INTENSITY_W _UxGT("Intensität Weiß") -#define MSG_LED_BRIGHTNESS _UxGT("Helligkeit") - #if LCD_WIDTH >= 20 #define MSG_INFO_PRINT_COUNT _UxGT("Gesamte Drucke") #define MSG_INFO_COMPLETED_PRINTS _UxGT("Beendete Drucke") @@ -346,21 +302,19 @@ #define MSG_INFO_MIN_TEMP _UxGT("Min Temp") #define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Netzteil") +#define MSG_INFO_PSU _UxGT("Stromversorgung") #define MSG_DRIVE_STRENGTH _UxGT("Motorströme") #define MSG_DAC_PERCENT _UxGT("Treiber %") #define MSG_DAC_EEPROM_WRITE _UxGT("Werte speichern") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("DRUCK PAUSIERT") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("FILAMENT LADEN") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("FILAMENT ENTLADEN") + +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("DRUCK PAUSIERT") #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("FORTS. OPTIONEN:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Mehr entleeren") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extrude mehr") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Drucke weiter") +#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Min. Temperatur ist ") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Düse: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Homing gescheitert") -#define MSG_ERR_PROBING_FAILED _UxGT("Probing gescheitert") -#define MSG_M600_TOO_COLD _UxGT("M600: Zu kalt") + #if LCD_HEIGHT >= 4 // Up to 3 lines allowed #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Warte auf den") @@ -379,9 +333,9 @@ #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Warte auf") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("Laden des") #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("Filaments") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Warte auf") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("Entleeren des") - #define MSG_FILAMENT_CHANGE_PURGE_3 _UxGT("Filaments") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Warte auf") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("Extrusion des") + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 _UxGT("Filaments") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Warte auf") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("Fortsetzung des") #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("Druckes...") @@ -392,7 +346,7 @@ #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Laden und Klick") #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heizen...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Laden...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Entleeren...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extrudieren...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Fortsetzen...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_el-gr.h b/Marlin/language_el-gr.h index 775242b..2ad323d 100644 --- a/Marlin/language_el-gr.h +++ b/Marlin/language_el-gr.h @@ -32,7 +32,6 @@ #define MAPPER_CECF #define DISPLAY_CHARSET_ISO10646_GREEK -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" έτοιμο.") #define MSG_SD_INSERTED _UxGT("Εισαγωγή κάρτας") @@ -45,7 +44,6 @@ #define MSG_AUTO_HOME_X _UxGT("Αρχικό σημείο X") #define MSG_AUTO_HOME_Y _UxGT("Αρχικό σημείο Y") #define MSG_AUTO_HOME_Z _UxGT("Αρχικό σημείο Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Βαθμονόμηση Z") #define MSG_LEVEL_BED_HOMING _UxGT("Επαναφορά στο αρχικό σημείο ΧΥΖ") #define MSG_LEVEL_BED_WAITING _UxGT("Κάντε κλικ για να ξεκινήσετε") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Επόμενο σημείο") @@ -97,16 +95,10 @@ #define MSG_PID_C _UxGT("PID-C") #define MSG_ACC _UxGT("Επιτάχυνση") #define MSG_JERK _UxGT("Vαντίδραση") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Vαντίδραση A") - #define MSG_VB_JERK _UxGT("Vαντίδραση B") - #define MSG_VC_JERK _UxGT("Vαντίδραση C") -#else - #define MSG_VA_JERK _UxGT("Vαντίδραση X") - #define MSG_VB_JERK _UxGT("Vαντίδραση Y") - #define MSG_VC_JERK _UxGT("Vαντίδραση Z") -#endif -#define MSG_VE_JERK _UxGT("Vαντίδραση E") +#define MSG_VX_JERK _UxGT("Vαντίδραση x") +#define MSG_VY_JERK _UxGT("Vαντίδραση y") +#define MSG_VZ_JERK _UxGT("Vαντίδραση z") +#define MSG_VE_JERK _UxGT("Vαντίδραση e") #define MSG_VMAX _UxGT("Vμεγ ") #define MSG_VMIN _UxGT("Vελαχ") #define MSG_VTRAV_MIN _UxGT("Vελάχ. μετατόπιση") @@ -115,15 +107,9 @@ #define MSG_A_RETRACT _UxGT("Α-ανάσυρση") #define MSG_A_TRAVEL _UxGT("Α-μετατόπιση") #define MSG_STEPS_PER_MM _UxGT("Bήματα ανά μμ") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Bήματα A ανά μμ") - #define MSG_BSTEPS _UxGT("Bήματα B ανά μμ") - #define MSG_CSTEPS _UxGT("Bήματα C ανά μμ") -#else - #define MSG_ASTEPS _UxGT("Bήματα X ανά μμ") - #define MSG_BSTEPS _UxGT("Bήματα Y ανά μμ") - #define MSG_CSTEPS _UxGT("Bήματα Z ανά μμ") -#endif +#define MSG_XSTEPS _UxGT("Bήματα X ανά μμ") +#define MSG_YSTEPS _UxGT("Bήματα Υ ανά μμ") +#define MSG_ZSTEPS _UxGT("Bήματα Ζ ανά μμ") #define MSG_ESTEPS _UxGT("Bήματα Ε ανά μμ") #define MSG_E1STEPS _UxGT("Bήματα Ε1 ανά μμ") #define MSG_E2STEPS _UxGT("Bήματα Ε2 ανά μμ") @@ -148,8 +134,9 @@ #define MSG_STOP_PRINT _UxGT("Διακοπή εκτύπωσης") #define MSG_CARD_MENU _UxGT("Εκτύπωση από SD") #define MSG_NO_CARD _UxGT("Δεν βρέθηκε SD") -#define MSG_DWELL _UxGT("Αναστολή λειτουργίας…") +#define MSG_DWELL _UxGT("Αναστολή λειτουργίας...") #define MSG_USERWAIT _UxGT("Αναμονή για χρήστη…") +#define MSG_RESUMING _UxGT("Συνεχίζεται η εκτύπωση") #define MSG_PRINT_ABORTED _UxGT("Διακόπτεται η εκτύπωση") #define MSG_NO_MOVE _UxGT("Καμία κίνηση.") #define MSG_KILLED _UxGT("ΤΕΡΜΑΤΙΣΜΟΣ. ") @@ -181,7 +168,9 @@ #define MSG_ERR_MAXTEMP_BED _UxGT("Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ") #define MSG_ERR_MINTEMP_BED _UxGT("Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ") #define MSG_HEATING _UxGT("Θερμαίνεται…") -#define MSG_BED_HEATING _UxGT("Θέρμανση κλίνης…") +#define MSG_HEATING_COMPLETE _UxGT("Η θέρμανση ολοκληρώθηκε.") +#define MSG_BED_HEATING _UxGT("Θέρμανση κλίνης.") +#define MSG_BED_DONE _UxGT("Η κλίνη ολοκληρώθηκε.") #define MSG_DELTA_CALIBRATE _UxGT("Βαθμονόμηση Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Βαθμονόμηση X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Βαθμονόμηση Y") diff --git a/Marlin/language_el.h b/Marlin/language_el.h index b4fe4d3..1ae2a5b 100644 --- a/Marlin/language_el.h +++ b/Marlin/language_el.h @@ -32,7 +32,6 @@ #define MAPPER_CECF #define DISPLAY_CHARSET_ISO10646_GREEK -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" έτοιμο.") #define MSG_SD_INSERTED _UxGT("Εισαγωγή κάρτας") @@ -45,7 +44,6 @@ #define MSG_AUTO_HOME_X _UxGT("Αρχικό σημείο X") #define MSG_AUTO_HOME_Y _UxGT("Αρχικό σημείο Y") #define MSG_AUTO_HOME_Z _UxGT("Αρχικό σημείο Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Βαθμονόμηση Z") #define MSG_LEVEL_BED_HOMING _UxGT("Επαναφορά Επ. Εκτύπωσης") //SHORTEN #define MSG_LEVEL_BED_WAITING _UxGT("Επιπεδοποίηση επ. Εκτύπωσης περιμενει") //SHORTEN #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Επόμενο σημείο") @@ -97,16 +95,10 @@ #define MSG_PID_C _UxGT("PID-C") #define MSG_ACC _UxGT("Επιτάχυνση") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Vαντίδραση A") - #define MSG_VB_JERK _UxGT("Vαντίδραση B") - #define MSG_VC_JERK _UxGT("Vαντίδραση C") -#else - #define MSG_VA_JERK _UxGT("Vαντίδραση X") - #define MSG_VB_JERK _UxGT("Vαντίδραση Y") - #define MSG_VC_JERK _UxGT("Vαντίδραση Z") -#endif -#define MSG_VE_JERK _UxGT("Vαντίδραση E") +#define MSG_VX_JERK _UxGT("Vαντίδραση x") +#define MSG_VY_JERK _UxGT("Vαντίδραση y") +#define MSG_VZ_JERK _UxGT("Vαντίδραση z") +#define MSG_VE_JERK _UxGT("Vαντίδραση e") #define MSG_VMAX _UxGT("V Μέγιστο") #define MSG_VMIN _UxGT("V Ελάχιστο") #define MSG_VTRAV_MIN _UxGT("Vελάχ. μετατόπιση") @@ -115,15 +107,9 @@ #define MSG_A_RETRACT _UxGT("Α-ανάσυρση") #define MSG_A_TRAVEL _UxGT("Α-μετατόπιση") #define MSG_STEPS_PER_MM _UxGT("Bήματα ανά μμ") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Bήματα A ανά μμ") - #define MSG_BSTEPS _UxGT("Bήματα B ανά μμ") - #define MSG_CSTEPS _UxGT("Bήματα C ανά μμ") -#else - #define MSG_ASTEPS _UxGT("Bήματα X ανά μμ") - #define MSG_BSTEPS _UxGT("Bήματα Y ανά μμ") - #define MSG_CSTEPS _UxGT("Bήματα Z ανά μμ") -#endif +#define MSG_XSTEPS _UxGT("Bήματα X ανά μμ") +#define MSG_YSTEPS _UxGT("Bήματα Υ ανά μμ") +#define MSG_ZSTEPS _UxGT("Bήματα Ζ ανά μμ") #define MSG_ESTEPS _UxGT("Bήματα Ε ανά μμ") #define MSG_E1STEPS _UxGT("Bήματα Ε1 ανά μμ") #define MSG_E2STEPS _UxGT("Bήματα Ε2 ανά μμ") @@ -150,6 +136,7 @@ #define MSG_NO_CARD _UxGT("Δεν βρέθηκε SD") #define MSG_DWELL _UxGT("Αναστολή λειτουργίας") #define MSG_USERWAIT _UxGT("Αναμονή για χρήστη") +#define MSG_RESUMING _UxGT("Συνεχίζεται η εκτύπωση") //SHORTEN #define MSG_PRINT_ABORTED _UxGT("Διακόπτεται η εκτύπωση") //SHORTEN #define MSG_NO_MOVE _UxGT("Καμία κίνηση.") #define MSG_KILLED _UxGT("ΤΕΡΜΑΤΙΣΜΟΣ. ") @@ -181,12 +168,67 @@ #define MSG_ERR_MAXTEMP_BED _UxGT("ΜΕΓΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ") //SHORTEN #define MSG_ERR_MINTEMP_BED _UxGT("ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ") //SHORTEN #define MSG_HALTED _UxGT("H εκτύπωση διακόπηκε") +#define MSG_PLEASE_RESET _UxGT("PLEASE RESET") //TRANSLATE #define MSG_HEATING _UxGT("Θερμαίνεται…") +#define MSG_HEATING_COMPLETE _UxGT("Η θέρμανση ολοκληρώθηκε.") //SHORTEN #define MSG_BED_HEATING _UxGT("Θέρμανση ΕΠ. Εκτύπωσης") //SHORTEN +#define MSG_BED_DONE _UxGT("Η Επ. Εκτύπωσης ολοκληρώθηκε") //SHORTEN #define MSG_DELTA_CALIBRATE _UxGT("Βαθμονόμηση Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Βαθμονόμηση X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Βαθμονόμηση Y") #define MSG_DELTA_CALIBRATE_Z _UxGT("Βαθμονόμηση Z") #define MSG_DELTA_CALIBRATE_CENTER _UxGT("Βαθμονόμηση κέντρου") +#define MSG_INFO_MENU _UxGT("About Printer") +#define MSG_INFO_PRINTER_MENU _UxGT("Printer Info") +#define MSG_INFO_STATS_MENU _UxGT("Printer Stats") +#define MSG_INFO_BOARD_MENU _UxGT("Board Info") +#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") +#define MSG_INFO_EXTRUDERS _UxGT("Extruders") +#define MSG_INFO_BAUDRATE _UxGT("Baud") +#define MSG_INFO_PROTOCOL _UxGT("Protocol") + +#if LCD_WIDTH >= 20 + #define MSG_INFO_PRINT_COUNT _UxGT("Print Count") + #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completed ") + #define MSG_INFO_PRINT_TIME _UxGT("Total Time ") +#else + #define MSG_INFO_PRINT_COUNT _UxGT("Prints ") + #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completed") + #define MSG_INFO_PRINT_TIME _UxGT("Duration ") +#endif +#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") +#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") +#define MSG_INFO_PSU _UxGT("PSU") + +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("CHANGE FILAMENT") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extrude more") +#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Resume print") + +#if LCD_HEIGHT >= 4 + // Up to 3 lines allowed + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wait for start") + #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("of the filament") + #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("change") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wait for") + #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament unload") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert filament") + #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("and press button") + #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("to continue...") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wait for") + #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Wait for") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("filament extrude") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print") + #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("to resume") +#else // LCD_HEIGHT < 4 + // Up to 2 lines allowed + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Please wait...") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejecting...") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert and Click") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Loading...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extruding...") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Resuming...") +#endif + #endif // LANGUAGE_EL_H diff --git a/Marlin/language_en.h b/Marlin/language_en.h index c23f463..879a6fa 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -36,12 +36,8 @@ #endif #undef en -#ifndef CHARSIZE - #define CHARSIZE 1 -#endif - #ifndef WELCOME_MSG - #define WELCOME_MSG MACHINE_NAME _UxGT(" Ready.") + #define WELCOME_MSG MACHINE_NAME _UxGT(" ready.") #endif #ifndef MSG_BACK #define MSG_BACK _UxGT("Back") @@ -55,9 +51,6 @@ #ifndef MSG_LCD_ENDSTOPS #define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters #endif -#ifndef MSG_LCD_SOFT_ENDSTOPS - #define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft Endstops") -#endif #ifndef MSG_MAIN #define MSG_MAIN _UxGT("Main") #endif @@ -85,9 +78,6 @@ #ifndef MSG_AUTO_HOME_Z #define MSG_AUTO_HOME_Z _UxGT("Home Z") #endif -#ifndef MSG_TMC_Z_CALIBRATION - #define MSG_TMC_Z_CALIBRATION _UxGT("Calibrate Z") -#endif #ifndef MSG_LEVEL_BED_HOMING #define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") #endif @@ -184,6 +174,7 @@ #ifndef MSG_USER_MENU #define MSG_USER_MENU _UxGT("Custom Commands") #endif + #ifndef MSG_UBL_DOING_G29 #define MSG_UBL_DOING_G29 _UxGT("Doing G29") #endif @@ -374,38 +365,41 @@ #ifndef MSG_LED_CONTROL #define MSG_LED_CONTROL _UxGT("LED Control") #endif -#ifndef MSG_LEDS - #define MSG_LEDS _UxGT("Lights") +#ifndef MSG_LEDS_ON + #define MSG_LEDS_ON _UxGT("Lights On") +#endif +#ifndef MSG_LEDS_OFF + #define MSG_LEDS_OFF _UxGT("Lights Off") #endif #ifndef MSG_LED_PRESETS #define MSG_LED_PRESETS _UxGT("Light Presets") #endif #ifndef MSG_SET_LEDS_RED - #define MSG_SET_LEDS_RED _UxGT("Red") + #define MSG_SET_LEDS_RED _UxGT("Lights Red") #endif #ifndef MSG_SET_LEDS_ORANGE - #define MSG_SET_LEDS_ORANGE _UxGT("Orange") + #define MSG_SET_LEDS_ORANGE _UxGT("Lights Orange") #endif #ifndef MSG_SET_LEDS_YELLOW - #define MSG_SET_LEDS_YELLOW _UxGT("Yellow") + #define MSG_SET_LEDS_YELLOW _UxGT("Lights Yellow") #endif #ifndef MSG_SET_LEDS_GREEN - #define MSG_SET_LEDS_GREEN _UxGT("Green") + #define MSG_SET_LEDS_GREEN _UxGT("Lights Green") #endif #ifndef MSG_SET_LEDS_BLUE - #define MSG_SET_LEDS_BLUE _UxGT("Blue") + #define MSG_SET_LEDS_BLUE _UxGT("Lights Blue") #endif #ifndef MSG_SET_LEDS_INDIGO - #define MSG_SET_LEDS_INDIGO _UxGT("Indigo") + #define MSG_SET_LEDS_INDIGO _UxGT("Lights Indigo") #endif #ifndef MSG_SET_LEDS_VIOLET - #define MSG_SET_LEDS_VIOLET _UxGT("Violet") + #define MSG_SET_LEDS_VIOLET _UxGT("Lights Violet") #endif #ifndef MSG_SET_LEDS_WHITE - #define MSG_SET_LEDS_WHITE _UxGT("White") + #define MSG_SET_LEDS_WHITE _UxGT("Lights White") #endif #ifndef MSG_SET_LEDS_DEFAULT - #define MSG_SET_LEDS_DEFAULT _UxGT("Default") + #define MSG_SET_LEDS_DEFAULT _UxGT("Lights Default") #endif #ifndef MSG_CUSTOM_LEDS #define MSG_CUSTOM_LEDS _UxGT("Custom Lights") @@ -516,33 +510,18 @@ #ifndef MSG_JERK #define MSG_JERK _UxGT("Jerk") #endif -#if IS_KINEMATIC - #ifndef MSG_VA_JERK - #define MSG_VA_JERK _UxGT("Va-jerk") - #endif - #ifndef MSG_VB_JERK - #define MSG_VB_JERK _UxGT("Vb-jerk") - #endif - #ifndef MSG_VC_JERK - #define MSG_VC_JERK _UxGT("Vc-jerk") - #endif -#else - #ifndef MSG_VA_JERK - #define MSG_VA_JERK _UxGT("Vx-jerk") - #endif - #ifndef MSG_VB_JERK - #define MSG_VB_JERK _UxGT("Vy-jerk") - #endif - #ifndef MSG_VC_JERK - #define MSG_VC_JERK _UxGT("Vz-jerk") - #endif +#ifndef MSG_VX_JERK + #define MSG_VX_JERK _UxGT("Vx-jerk") +#endif +#ifndef MSG_VY_JERK + #define MSG_VY_JERK _UxGT("Vy-jerk") +#endif +#ifndef MSG_VZ_JERK + #define MSG_VZ_JERK _UxGT("Vz-jerk") #endif #ifndef MSG_VE_JERK #define MSG_VE_JERK _UxGT("Ve-jerk") #endif -#ifndef MSG_JUNCTION_DEVIATION - #define MSG_JUNCTION_DEVIATION _UxGT("Junction Dev") -#endif #ifndef MSG_VELOCITY #define MSG_VELOCITY _UxGT("Velocity") #endif @@ -570,26 +549,14 @@ #ifndef MSG_STEPS_PER_MM #define MSG_STEPS_PER_MM _UxGT("Steps/mm") #endif -#if IS_KINEMATIC - #ifndef MSG_ASTEPS - #define MSG_ASTEPS _UxGT("Asteps/mm") - #endif - #ifndef MSG_BSTEPS - #define MSG_BSTEPS _UxGT("Bsteps/mm") - #endif - #ifndef MSG_CSTEPS - #define MSG_CSTEPS _UxGT("Csteps/mm") - #endif -#else - #ifndef MSG_ASTEPS - #define MSG_ASTEPS _UxGT("Xsteps/mm") - #endif - #ifndef MSG_BSTEPS - #define MSG_BSTEPS _UxGT("Ysteps/mm") - #endif - #ifndef MSG_CSTEPS - #define MSG_CSTEPS _UxGT("Zsteps/mm") - #endif +#ifndef MSG_XSTEPS + #define MSG_XSTEPS _UxGT("Xsteps/mm") +#endif +#ifndef MSG_YSTEPS + #define MSG_YSTEPS _UxGT("Ysteps/mm") +#endif +#ifndef MSG_ZSTEPS + #define MSG_ZSTEPS _UxGT("Zsteps/mm") #endif #ifndef MSG_ESTEPS #define MSG_ESTEPS _UxGT("Esteps/mm") @@ -624,12 +591,6 @@ #ifndef MSG_FILAMENT_DIAM #define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") #endif -#ifndef MSG_FILAMENT_UNLOAD - #define MSG_FILAMENT_UNLOAD _UxGT("Unload mm") -#endif -#ifndef MSG_FILAMENT_LOAD - #define MSG_FILAMENT_LOAD _UxGT("Load mm") -#endif #ifndef MSG_ADVANCE_K #define MSG_ADVANCE_K _UxGT("Advance K") #endif @@ -669,9 +630,6 @@ #ifndef MSG_STOP_PRINT #define MSG_STOP_PRINT _UxGT("Stop print") #endif -#ifndef MSG_POWER_LOSS_RECOVERY - #define MSG_POWER_LOSS_RECOVERY _UxGT("Power-Loss Recovery") -#endif #ifndef MSG_CARD_MENU #define MSG_CARD_MENU _UxGT("Print from SD") #endif @@ -687,8 +645,8 @@ #ifndef MSG_PRINT_PAUSED #define MSG_PRINT_PAUSED _UxGT("Print paused") #endif -#ifndef MSG_PRINTING - #define MSG_PRINTING _UxGT("Printing...") +#ifndef MSG_RESUMING + #define MSG_RESUMING _UxGT("Resuming print") #endif #ifndef MSG_PRINT_ABORTED #define MSG_PRINT_ABORTED _UxGT("Print aborted") @@ -732,15 +690,6 @@ #ifndef MSG_FILAMENTCHANGE #define MSG_FILAMENTCHANGE _UxGT("Change filament") #endif -#ifndef MSG_FILAMENTLOAD - #define MSG_FILAMENTLOAD _UxGT("Load filament") -#endif -#ifndef MSG_FILAMENTUNLOAD - #define MSG_FILAMENTUNLOAD _UxGT("Unload filament") -#endif -#ifndef MSG_FILAMENTUNLOAD_ALL - #define MSG_FILAMENTUNLOAD_ALL _UxGT("Unload All") -#endif #ifndef MSG_INIT_SDCARD #define MSG_INIT_SDCARD _UxGT("Init. SD card") #endif @@ -748,7 +697,7 @@ #define MSG_CNG_SDCARD _UxGT("Change SD card") #endif #ifndef MSG_ZPROBE_OUT - #define MSG_ZPROBE_OUT _UxGT("Z Probe past bed") + #define MSG_ZPROBE_OUT _UxGT("Z probe out. bed") #endif #ifndef MSG_SKEW_FACTOR #define MSG_SKEW_FACTOR _UxGT("Skew Factor") @@ -775,7 +724,7 @@ #define MSG_FIRST _UxGT("first") #endif #ifndef MSG_ZPROBE_ZOFFSET - #define MSG_ZPROBE_ZOFFSET _UxGT("Probe Z Offset") + #define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") #endif #ifndef MSG_BABYSTEP_X #define MSG_BABYSTEP_X _UxGT("Babystep X") @@ -792,18 +741,12 @@ #ifndef MSG_HEATING_FAILED_LCD #define MSG_HEATING_FAILED_LCD _UxGT("Heating failed") #endif -#ifndef MSG_HEATING_FAILED_LCD_BED - #define MSG_HEATING_FAILED_LCD_BED _UxGT("Bed heating failed") -#endif #ifndef MSG_ERR_REDUNDANT_TEMP #define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: REDUNDANT TEMP") #endif #ifndef MSG_THERMAL_RUNAWAY #define MSG_THERMAL_RUNAWAY _UxGT("THERMAL RUNAWAY") #endif -#ifndef MSG_THERMAL_RUNAWAY_BED - #define MSG_THERMAL_RUNAWAY_BED _UxGT("BED THERMAL RUNAWAY") -#endif #ifndef MSG_ERR_MAXTEMP #define MSG_ERR_MAXTEMP _UxGT("Err: MAXTEMP") #endif @@ -817,7 +760,7 @@ #define MSG_ERR_MINTEMP_BED _UxGT("Err: MINTEMP BED") #endif #ifndef MSG_ERR_Z_HOMING - #define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST + #define MSG_ERR_Z_HOMING _UxGT("G28 Z Forbidden") #endif #ifndef MSG_HALTED #define MSG_HALTED _UxGT("PRINTER HALTED") @@ -837,14 +780,14 @@ #ifndef MSG_HEATING #define MSG_HEATING _UxGT("Heating...") #endif -#ifndef MSG_COOLING - #define MSG_COOLING _UxGT("Cooling...") +#ifndef MSG_HEATING_COMPLETE + #define MSG_HEATING_COMPLETE _UxGT("Heating done.") #endif #ifndef MSG_BED_HEATING - #define MSG_BED_HEATING _UxGT("Bed heating...") + #define MSG_BED_HEATING _UxGT("Bed Heating.") #endif -#ifndef MSG_BED_COOLING - #define MSG_BED_COOLING _UxGT("Bed cooling...") +#ifndef MSG_BED_DONE + #define MSG_BED_DONE _UxGT("Bed done.") #endif #ifndef MSG_DELTA_CALIBRATE #define MSG_DELTA_CALIBRATE _UxGT("Delta Calibration") @@ -870,9 +813,6 @@ #ifndef MSG_DELTA_HEIGHT_CALIBRATE #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Set Delta Height") #endif -#ifndef MSG_DELTA_Z_OFFSET_CALIBRATE - #define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Probe Z-offset") -#endif #ifndef MSG_DELTA_DIAG_ROD #define MSG_DELTA_DIAG_ROD _UxGT("Diag Rod") #endif @@ -960,6 +900,7 @@ #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruded") #endif #endif + #ifndef MSG_INFO_MIN_TEMP #define MSG_INFO_MIN_TEMP _UxGT("Min Temp") #endif @@ -978,23 +919,20 @@ #ifndef MSG_DAC_EEPROM_WRITE #define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Write") #endif -#ifndef MSG_FILAMENT_CHANGE_HEADER_PAUSE - #define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("PRINT PAUSED") -#endif -#ifndef MSG_FILAMENT_CHANGE_HEADER_LOAD - #define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("LOAD FILAMENT") -#endif -#ifndef MSG_FILAMENT_CHANGE_HEADER_UNLOAD - #define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("UNLOAD FILAMENT") +#ifndef MSG_FILAMENT_CHANGE_HEADER + #define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") #endif #ifndef MSG_FILAMENT_CHANGE_OPTION_HEADER #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") #endif -#ifndef MSG_FILAMENT_CHANGE_OPTION_PURGE - #define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purge more") +#ifndef MSG_FILAMENT_CHANGE_OPTION_EXTRUDE + #define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extrude more") #endif #ifndef MSG_FILAMENT_CHANGE_OPTION_RESUME - #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Continue") + #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Resume print") +#endif +#ifndef MSG_FILAMENT_CHANGE_MINTEMP + #define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Minimum Temp is ") #endif #ifndef MSG_FILAMENT_CHANGE_NOZZLE #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ") @@ -1005,9 +943,6 @@ #ifndef MSG_ERR_PROBING_FAILED #define MSG_ERR_PROBING_FAILED _UxGT("Probing failed") #endif -#ifndef MSG_M600_TOO_COLD - #define MSG_M600_TOO_COLD _UxGT("M600: Too cold") -#endif // // Filament Change screens show up to 3 lines on a 4-line display @@ -1040,9 +975,9 @@ #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wait for") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load") #endif - #ifndef MSG_FILAMENT_CHANGE_PURGE_1 - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Wait for") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("filament purge") + #ifndef MSG_FILAMENT_CHANGE_EXTRUDE_1 + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Wait for") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("filament extrude") #endif #ifndef MSG_FILAMENT_CHANGE_RESUME_1 #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print") @@ -1058,17 +993,14 @@ #ifndef MSG_FILAMENT_CHANGE_INSERT_1 #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert and Click") #endif - #ifndef MSG_FILAMENT_CHANGE_HEAT_1 - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Click to heat") - #endif #ifndef MSG_FILAMENT_CHANGE_HEATING_1 #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating...") #endif #ifndef MSG_FILAMENT_CHANGE_LOAD_1 #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Loading...") #endif - #ifndef MSG_FILAMENT_CHANGE_PURGE_1 - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Purging...") + #ifndef MSG_FILAMENT_CHANGE_EXTRUDE_1 + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extruding...") #endif #ifndef MSG_FILAMENT_CHANGE_RESUME_1 #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Resuming...") diff --git a/Marlin/language_es.h b/Marlin/language_es.h index a4267af..248ecb1 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -32,7 +32,6 @@ #define DISPLAY_CHARSET_ISO10646_1 #define NOT_EXTENDED_ISO10646_1_5X7 -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" lista.") #define MSG_BACK _UxGT("Atras") @@ -48,7 +47,6 @@ #define MSG_AUTO_HOME_X _UxGT("Origen X") #define MSG_AUTO_HOME_Y _UxGT("Origen Y") #define MSG_AUTO_HOME_Z _UxGT("Origen Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") #define MSG_LEVEL_BED_HOMING _UxGT("Origen XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Iniciar (Presione)") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Siguiente punto") @@ -105,19 +103,9 @@ #define MSG_SELECT _UxGT("Seleccionar") #define MSG_ACC _UxGT("Aceleracion") #define MSG_JERK _UxGT("Jerk") -#if IS_SCARA - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#elif IS_DELTA - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") #define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VMAX _UxGT("Vmax") #define MSG_VMIN _UxGT("Vmin") @@ -127,19 +115,9 @@ #define MSG_A_RETRACT _UxGT("Acel. retrac.") #define MSG_A_TRAVEL _UxGT("Acel. Viaje") #define MSG_STEPS_PER_MM _UxGT("Pasos/mm") -#if IS_SCARA - #define MSG_ASTEPS _UxGT("A pasos/deg") - #define MSG_BSTEPS _UxGT("B pasos/deg") - #define MSG_CSTEPS _UxGT("C pasos/mm") -#elif IS_DELTA - #define MSG_ASTEPS _UxGT("A pasos/mm") - #define MSG_BSTEPS _UxGT("B pasos/mm") - #define MSG_CSTEPS _UxGT("C pasos/mm") -#else - #define MSG_ASTEPS _UxGT("X pasos/mm") - #define MSG_BSTEPS _UxGT("Y pasos/mm") - #define MSG_CSTEPS _UxGT("Z pasos/mm") -#endif +#define MSG_XSTEPS _UxGT("X pasos/mm") +#define MSG_YSTEPS _UxGT("Y pasos/mm") +#define MSG_ZSTEPS _UxGT("Z pasos/mm") #define MSG_ESTEPS _UxGT("E pasos/mm") #define MSG_E1STEPS _UxGT("E1 pasos/mm") #define MSG_E2STEPS _UxGT("E2 pasos/mm") @@ -167,6 +145,7 @@ #define MSG_NO_CARD _UxGT("No hay tarjeta SD") #define MSG_DWELL _UxGT("Reposo...") #define MSG_USERWAIT _UxGT("Esperando ordenes") +#define MSG_RESUMING _UxGT("Resumiendo impre.") #define MSG_PRINT_ABORTED _UxGT("Impresion cancelada") #define MSG_NO_MOVE _UxGT("Sin movimiento") #define MSG_KILLED _UxGT("Parada de emergencia") @@ -199,14 +178,16 @@ #define MSG_ERR_MINTEMP _UxGT("Error: Temp Minima") #define MSG_ERR_MAXTEMP_BED _UxGT("Error: Temp Max Plat") #define MSG_ERR_MINTEMP_BED _UxGT("Error: Temp Min Plat") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z Prohibido") #define MSG_HALTED _UxGT("IMPRESORA PARADA") #define MSG_PLEASE_RESET _UxGT("Por favor, reinicie") #define MSG_SHORT_DAY _UxGT("d") // One character only #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("Calentando...") +#define MSG_HEATING_COMPLETE _UxGT("Calentamiento listo") #define MSG_BED_HEATING _UxGT("Calentando Plat...") +#define MSG_BED_DONE _UxGT("Plataforma Caliente") #define MSG_DELTA_CALIBRATE _UxGT("Calibracion Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Calibrar X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrar Y") @@ -245,10 +226,12 @@ #define MSG_DAC_PERCENT _UxGT("Driver %") #define MSG_DAC_EEPROM_WRITE _UxGT("Escribe DAC EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("IMPR. PAUSADA") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("IMPR. PAUSADA") #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("OPC. REINICIO:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extruir mas") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Resumir imp.") +#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Temp Minima es ") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Boquilla: ") #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando iniciar") @@ -271,6 +254,8 @@ #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filamento expulsado") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperado por") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("Cargar filamento") +#define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Esperado por") +#define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("Extruir filamento") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Esperando imp.") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("para resumir") #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Oprima boton para") diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index 999855e..5be54c5 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -44,15 +44,13 @@ #define MSG_DEBUG_MENU _UxGT("Arazketa Menua") #define MSG_PROGRESS_BAR_TEST _UxGT("Prog. Barra Proba") #define MSG_AUTO_HOME _UxGT("Hasierara joan") -#define MSG_AUTO_HOME_X _UxGT("X jatorrira") -#define MSG_AUTO_HOME_Y _UxGT("Y jatorrira") -#define MSG_AUTO_HOME_Z _UxGT("Z jatorrira") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibratu Z") +#define MSG_AUTO_HOME_X _UxGT("X jatorria") +#define MSG_AUTO_HOME_Y _UxGT("Y jatorria") +#define MSG_AUTO_HOME_Z _UxGT("Z jatorria") #define MSG_LEVEL_BED_HOMING _UxGT("XYZ hasieraratzen") #define MSG_LEVEL_BED_WAITING _UxGT("Klik egin hasteko") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Hurrengo Puntua") #define MSG_LEVEL_BED_DONE _UxGT("Berdintzea eginda") -//#define MSG_Z_FADE_HEIGHT _UxGT("Fade Height") #define MSG_SET_HOME_OFFSETS _UxGT("Etxe. offset eza.") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsetak ezarrita") #define MSG_SET_ORIGIN _UxGT("Hasiera ipini") @@ -61,105 +59,21 @@ #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Guztia") #define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Amaia") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Ohea") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Ezarp.") +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" konf.") #define MSG_PREHEAT_2 _UxGT("Berotu ABS") #define MSG_PREHEAT_2_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_1 _UxGT(" Guztia") #define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Amaia") #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_1 _UxGT(" Ohea") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_1 _UxGT(" Ezarp.") +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_1 _UxGT(" konf.") #define MSG_COOLDOWN _UxGT("Hoztu") #define MSG_SWITCH_PS_ON _UxGT("Energia piztu") #define MSG_SWITCH_PS_OFF _UxGT("Energia itzali") #define MSG_EXTRUDE _UxGT("Estruitu") #define MSG_RETRACT _UxGT("Atzera eragin") #define MSG_MOVE_AXIS _UxGT("Ardatzak mugitu") -#define MSG_BED_LEVELING _UxGT("Ohe berdinketa") -#define MSG_LEVEL_BED _UxGT("Ohea berdindu") -#define MSG_LEVEL_CORNERS _UxGT("Ertzak berdindu") -#define MSG_NEXT_CORNER _UxGT("Hurrengo ertza") -//#define MSG_EDITING_STOPPED _UxGT("Mesh Editing Stopped") -//#define MSG_USER_MENU _UxGT("Custom Commands") -#define MSG_UBL_DOING_G29 _UxGT("G29 exekutatzen") -#define MSG_UBL_UNHOMED _UxGT("XYZ etxeratu lehenengo") -#define MSG_UBL_TOOLS _UxGT("UBL Tresnak") -#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#define MSG_UBL_MANUAL_MESH _UxGT("Sarea eskuz sortu") -//#define MSG_UBL_BC_INSERT _UxGT("Place shim & measure") -#define MSG_UBL_BC_INSERT2 _UxGT("Neurtu") -//#define MSG_UBL_BC_REMOVE _UxGT("Remove & measure bed") -//#define MSG_UBL_MOVING_TO_NEXT _UxGT("Moving to next") -#define MSG_UBL_ACTIVATE_MESH _UxGT("UBL aktibatu") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("UBL desaktibatu") -#define MSG_UBL_SET_BED_TEMP _UxGT("Ohearen tenperatura") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Mutur beroaren tenp.") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Sarea editatu") -//#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Edit Custom Mesh") -//#define MSG_UBL_FINE_TUNE_MESH _UxGT("Fine Tuning Mesh") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Sarea editatzea eginda") -//#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Build Custom Mesh") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Sarea sortu") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("PLA sarea sortu") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("ABS sarea sortu") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Sare hotza sortu") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Sarearen altuera doitu") -//#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Height Amount") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Sarea balioetsi") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("PLA sarea balioetsi") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("ABS sarea balioetsi") -//#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validate Custom Mesh") -#define MSG_UBL_CONTINUE_MESH _UxGT("Ohe sarea balioetsi") -#define MSG_UBL_MESH_LEVELING _UxGT("Sare berdinketa") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3 puntuko berdinketa") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Lauki-sare berdinketa") -#define MSG_UBL_MESH_LEVEL _UxGT("Sarea berdindu") -//#define MSG_UBL_SIDE_POINTS _UxGT("Side Points") -#define MSG_UBL_MAP_TYPE _UxGT("Mapa mota") -//#define MSG_UBL_OUTPUT_MAP _UxGT("Output Mesh Map") -//#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Output for Host") -//#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Output for CSV") -//#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Off Printer Backup") -//#define MSG_UBL_INFO_UBL _UxGT("Output UBL Info") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Sarea editatu") -//#define MSG_UBL_FILLIN_AMOUNT _UxGT("Fill-in Amount") -//#define MSG_UBL_MANUAL_FILLIN _UxGT("Manual Fill-in") -//#define MSG_UBL_SMART_FILLIN _UxGT("Smart Fill-in") -//#define MSG_UBL_FILLIN_MESH _UxGT("Fill-in Mesh") -//#define MSG_UBL_INVALIDATE_ALL _UxGT("Invalidate All") -//#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalidate Closest") -//#define MSG_UBL_FINE_TUNE_ALL _UxGT("Fine Tune All") -//#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Fine Tune Closest") -//#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Mesh Storage") -//#define MSG_UBL_STORAGE_SLOT _UxGT("Memory Slot") -//#define MSG_UBL_LOAD_MESH _UxGT("Load Bed Mesh") -//#define MSG_UBL_SAVE_MESH _UxGT("Save Bed Mesh") -//#define MSG_MESH_LOADED _UxGT("Mesh %i loaded") -//#define MSG_MESH_SAVED _UxGT("Mesh %i saved") -//#define MSG_NO_STORAGE _UxGT("No storage") -//#define MSG_UBL_SAVE_ERROR _UxGT("Err: UBL Save") -//#define MSG_UBL_RESTORE_ERROR _UxGT("Err: UBL Restore") -//#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Stopped") -//#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Step-By-Step UBL") -#define MSG_LED_CONTROL _UxGT("LED ezarpenak") -#define MSG_LEDS _UxGT("Argiak") -#define MSG_LED_PRESETS _UxGT("Argi aurrehautaketak") -#define MSG_SET_LEDS_RED _UxGT("Gorria") -#define MSG_SET_LEDS_ORANGE _UxGT("Laranja") -#define MSG_SET_LEDS_YELLOW _UxGT("Horia") -#define MSG_SET_LEDS_GREEN _UxGT("Berdea") -#define MSG_SET_LEDS_BLUE _UxGT("Urdina") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Bioleta") -#define MSG_SET_LEDS_WHITE _UxGT("Zuria") -#define MSG_SET_LEDS_DEFAULT _UxGT("Lehenetsia") -#define MSG_CUSTOM_LEDS _UxGT("Argi pertsonalizatuak") -#define MSG_INTENSITY_R _UxGT("Intentsitate gorria") -#define MSG_INTENSITY_G _UxGT("Intentsitate berdea") -#define MSG_INTENSITY_B _UxGT("Intentsitate urdina") -#define MSG_INTENSITY_W _UxGT("Intentsitate zuria") -#define MSG_LED_BRIGHTNESS _UxGT("Distira") +#define MSG_BED_LEVELING _UxGT("Ohea Berdindu") +#define MSG_LEVEL_BED _UxGT("Ohea Berdindu") #define MSG_MOVING _UxGT("Mugitzen...") #define MSG_FREE_XY _UxGT("Askatu XY") #define MSG_MOVE_X _UxGT("Mugitu X") @@ -173,8 +87,7 @@ #define MSG_BED_Z _UxGT("Z Ohea") #define MSG_NOZZLE _UxGT("Pita") #define MSG_BED _UxGT("Ohea") -#define MSG_FAN_SPEED _UxGT("Haizagailu abiadura") -#define MSG_EXTRA_FAN_SPEED _UxGT("Haiz.gehig. abiadura") +#define MSG_FAN_SPEED _UxGT("Haizagailu abiada") #define MSG_FLOW _UxGT("Fluxua") #define MSG_CONTROL _UxGT("Kontrola") #define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") @@ -190,17 +103,10 @@ #define MSG_SELECT _UxGT("Aukeratu") #define MSG_ACC _UxGT("Azelerazioa") #define MSG_JERK _UxGT("Astindua") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-astindua") - #define MSG_VB_JERK _UxGT("Vb-astindua") - #define MSG_VC_JERK _UxGT("Vc-astindua") -#else - #define MSG_VA_JERK _UxGT("Vx-astindua") - #define MSG_VB_JERK _UxGT("Vy-astindua") - #define MSG_VC_JERK _UxGT("Vz-astindua") -#endif +#define MSG_VX_JERK _UxGT("Vx-astindua") +#define MSG_VY_JERK _UxGT("Vy-astindua") +#define MSG_VZ_JERK _UxGT("Vz-astindua") #define MSG_VE_JERK _UxGT("Ve-astindua") -//#define MSG_VELOCITY _UxGT("Velocity") #define MSG_VMAX _UxGT("Vmax ") #define MSG_VMIN _UxGT("Vmin") #define MSG_VTRAV_MIN _UxGT("VBidaia min") @@ -209,15 +115,9 @@ #define MSG_A_RETRACT _UxGT("A-retrakt") #define MSG_A_TRAVEL _UxGT("A-bidaia") #define MSG_STEPS_PER_MM _UxGT("Pausoak/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A pausoak/mm") - #define MSG_BSTEPS _UxGT("B pausoak/mm") - #define MSG_CSTEPS _UxGT("C pausoak/mm") -#else - #define MSG_ASTEPS _UxGT("X pausoak/mm") - #define MSG_BSTEPS _UxGT("Y pausoak/mm") - #define MSG_CSTEPS _UxGT("Z pausoak/mm") -#endif +#define MSG_XSTEPS _UxGT("X pausoak/mm") +#define MSG_YSTEPS _UxGT("Y pausoak/mm") +#define MSG_ZSTEPS _UxGT("Z pausoak/mm") #define MSG_ESTEPS _UxGT("E pausoak/mm") #define MSG_E1STEPS _UxGT("E1 pausoak/mm") #define MSG_E2STEPS _UxGT("E2 pausoak/mm") @@ -229,14 +129,11 @@ #define MSG_FILAMENT _UxGT("Harizpia") #define MSG_VOLUMETRIC_ENABLED _UxGT("E mm3-tan") #define MSG_FILAMENT_DIAM _UxGT("Hariz. Dia.") -#define MSG_FILAMENT_UNLOAD _UxGT("Deskargatu mm") -#define MSG_FILAMENT_LOAD _UxGT("Kargatu mm") #define MSG_ADVANCE_K _UxGT("K Aurrerapena") #define MSG_CONTRAST _UxGT("LCD kontrastea") #define MSG_STORE_EEPROM _UxGT("Gorde memoria") #define MSG_LOAD_EEPROM _UxGT("Kargatu memoria") #define MSG_RESTORE_FAILSAFE _UxGT("Larri. berriz.") -#define MSG_INIT_EEPROM _UxGT("EEPROM-a hasieratu") #define MSG_REFRESH _UxGT("Berriz kargatu") #define MSG_WATCH _UxGT("Pantaila info") #define MSG_PREPARE _UxGT("Prestatu") @@ -248,7 +145,7 @@ #define MSG_NO_CARD _UxGT("Ez dago SD-rik") #define MSG_DWELL _UxGT("Lo egin...") #define MSG_USERWAIT _UxGT("Aginduak zain...") -#define MSG_PRINT_PAUSED _UxGT("Inprim. geldi.") +#define MSG_RESUMING _UxGT("Jarraitzen inpri.") #define MSG_PRINT_ABORTED _UxGT("Inprim. deusezta.") #define MSG_NO_MOVE _UxGT("Mugimendu gabe.") #define MSG_KILLED _UxGT("AKABATUTA. ") @@ -260,21 +157,13 @@ #define MSG_CONTROL_RETRACT_RECOVER _UxGT("Atzera egin mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Swap Atzera mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Atzera egin V") -//#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") #define MSG_AUTORETRACT _UxGT("Atzera egin") #define MSG_FILAMENTCHANGE _UxGT("Aldatu harizpia") -#define MSG_FILAMENTLOAD _UxGT("Harizpia kargatu") -#define MSG_FILAMENTUNLOAD _UxGT("Harizpia deskargatu") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Erabat deskargatu") #define MSG_INIT_SDCARD _UxGT("Hasieratu SD-a") #define MSG_CNG_SDCARD _UxGT("Aldatu txartela") #define MSG_ZPROBE_OUT _UxGT("Z zunda kanpora") -#define MSG_SKEW_FACTOR _UxGT("Okertze faktorea") -#define MSG_BLTOUCH _UxGT("BLTouch") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch AutoProba") #define MSG_BLTOUCH_RESET _UxGT("BLTouch berrabia.") -#define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch jaitsi/luzatu") -#define MSG_BLTOUCH_STOW _UxGT("BLTouch igo/jaso") #define MSG_HOME _UxGT("Etxera") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST #define MSG_FIRST _UxGT("lehenengo") #define MSG_ZPROBE_ZOFFSET _UxGT("Z Konpentsatu") @@ -289,32 +178,25 @@ #define MSG_ERR_MINTEMP _UxGT("Err: Tenp Minimoa") #define MSG_ERR_MAXTEMP_BED _UxGT("Err: Ohe Tenp Max") #define MSG_ERR_MINTEMP_BED _UxGT("Err: Ohe Tenp Min") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z Debekatua") #define MSG_HALTED _UxGT("INPRIMA. GELDIRIK") #define MSG_PLEASE_RESET _UxGT("Berrabia. Mesedez") #define MSG_SHORT_DAY _UxGT("d") // One character only #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("Berotzen...") -#define MSG_BED_HEATING _UxGT("Ohea Berotzen...") +#define MSG_HEATING_COMPLETE _UxGT("Berotzea prest.") +#define MSG_BED_HEATING _UxGT("Ohea Berotzen.") +#define MSG_BED_DONE _UxGT("Ohea Berotuta.") #define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibraketa") #define MSG_DELTA_CALIBRATE_X _UxGT("Kalibratu X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibratu Y") #define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibratu Z") #define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibratu Zentrua") -#define MSG_DELTA_SETTINGS _UxGT("Delta ezarpenak") #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto Kalibraketa") #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Delta Alt. Ezar.") -#define MSG_DELTA_DIAG_ROD _UxGT("Barra diagonala") -#define MSG_DELTA_HEIGHT _UxGT("Altuera") -#define MSG_DELTA_RADIUS _UxGT("Erradioa") #define MSG_INFO_MENU _UxGT("Inprimagailu Inf.") #define MSG_INFO_PRINTER_MENU _UxGT("Inprimagailu Inf.") -#define MSG_3POINT_LEVELING _UxGT("3 puntuko berdinketa") -#define MSG_LINEAR_LEVELING _UxGT("Berdinketa lineala") -#define MSG_BILINEAR_LEVELING _UxGT("Berdinketa bilinearra") -#define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Sare berdinketa") #define MSG_INFO_STATS_MENU _UxGT("Inprima. estatis.") #define MSG_INFO_BOARD_MENU _UxGT("Txartelaren Info.") #define MSG_INFO_THERMISTOR_MENU _UxGT("Termistoreak") @@ -322,8 +204,8 @@ #define MSG_INFO_BAUDRATE _UxGT("Baudioak") #define MSG_INFO_PROTOCOL _UxGT("Protokoloa") #define MSG_CASE_LIGHT _UxGT("Kabina Argia") -//#define MSG_CASE_LIGHT_BRIGHTNESS -#if LCD_WIDTH >= 20 + +#if LCD_WIDTH > 19 #define MSG_INFO_PRINT_COUNT _UxGT("Inprim. Zenbaketa") #define MSG_INFO_COMPLETED_PRINTS _UxGT("Burututa") #define MSG_INFO_PRINT_TIME _UxGT("Inprim. denbora") @@ -338,51 +220,17 @@ #endif #define MSG_INFO_MIN_TEMP _UxGT("Tenp. Minimoa") #define MSG_INFO_MAX_TEMP _UxGT("Tenp. Maximoa") -#define MSG_INFO_PSU _UxGT("Elikadura-iturria") -#define MSG_DRIVE_STRENGTH _UxGT("Driver-aren potentzia") +#define MSG_INFO_PSU _UxGT("Elikadura Iturria") +#define MSG_DRIVE_STRENGTH _UxGT("Driver Potentzia") #define MSG_DAC_PERCENT _UxGT("Driver %") #define MSG_DAC_EEPROM_WRITE _UxGT("Idatzi DAC EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("HARIZPIA ALDATU") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("HARIZPIA KARGATU") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("HARIZPIA DESKARGATU") + +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("HARIZPIA ALDATU") #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ALDAKETA AUKERAK:") -//#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purge more") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Gehiago estruitu") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Inprima. jarraitu") + +#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Tenp Minimoa ") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Pita: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Hasi. huts egin du") -#define MSG_ERR_PROBING_FAILED _UxGT("Neurketak huts egin du") -#define MSG_M600_TOO_COLD _UxGT("M600: hotzegi") -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#if LCD_HEIGHT >= 4 -// #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wait for start") -// #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("of the filament") -// #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("change") -// #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wait for") -// #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament unload") -// #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert filament") -// #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("and press button") -// #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("to continue...") -// #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Press button to") -// #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("heat nozzle.") -// #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating nozzle") -// #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Please wait...") -// #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wait for") -// #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load") -// #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Wait for") -// #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("filament purge") -// #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print") -// #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("to resume") -#else // LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Mesedez, itxaron...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Deskargatzen...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Sartu eta click egin") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Berotzen...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Kargatzen...") -// #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Purging...") -// #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Resuming...") -#endif // LCD_HEIGHT < 4 #endif // LANGUAGE_EU_H diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index 4e26bdb..f04b050 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -32,7 +32,6 @@ #define MAPPER_C2C3 #define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" valmis.") #define MSG_SD_INSERTED _UxGT("Kortti asetettu") @@ -41,7 +40,6 @@ #define MSG_AUTOSTART _UxGT("Automaatti") #define MSG_DISABLE_STEPPERS _UxGT("Vapauta moottorit") #define MSG_AUTO_HOME _UxGT("Aja referenssiin") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibroi Z") #define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Click to Begin") #define MSG_LEVEL_BED_DONE _UxGT("Leveling Done!") @@ -89,15 +87,9 @@ #define MSG_PID_C _UxGT("PID-C") #define MSG_ACC _UxGT("Kiihtyv") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") #define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VMAX _UxGT("Vmax ") #define MSG_VMIN _UxGT("Vmin") @@ -106,15 +98,9 @@ #define MSG_AMAX _UxGT("Amax ") #define MSG_A_RETRACT _UxGT("A-peruuta") #define MSG_STEPS_PER_MM _UxGT("Steps/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Asteps/mm") - #define MSG_BSTEPS _UxGT("Bsteps/mm") - #define MSG_CSTEPS _UxGT("Csteps/mm") -#else - #define MSG_ASTEPS _UxGT("Xsteps/mm") - #define MSG_BSTEPS _UxGT("Ysteps/mm") - #define MSG_CSTEPS _UxGT("Zsteps/mm") -#endif +#define MSG_XSTEPS _UxGT("Xsteps/mm") +#define MSG_YSTEPS _UxGT("Ysteps/mm") +#define MSG_ZSTEPS _UxGT("Zsteps/mm") #define MSG_ESTEPS _UxGT("Esteps/mm") #define MSG_E1STEPS _UxGT("E1steps/mm") #define MSG_E2STEPS _UxGT("E2steps/mm") @@ -141,6 +127,7 @@ #define MSG_NO_CARD _UxGT("Ei korttia") #define MSG_DWELL _UxGT("Nukkumassa...") #define MSG_USERWAIT _UxGT("Odotet. valintaa") +#define MSG_RESUMING _UxGT("Jatke. tulostusta") #define MSG_PRINT_ABORTED _UxGT("Print aborted") #define MSG_NO_MOVE _UxGT("Ei liiketta.") #define MSG_KILLED _UxGT("KILLED. ") diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index 1990800..e89abcd 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -47,37 +47,34 @@ #define MSG_AUTO_HOME_X _UxGT("Origine X Auto.") #define MSG_AUTO_HOME_Y _UxGT("Origine Y Auto.") #define MSG_AUTO_HOME_Z _UxGT("Origine Z Auto.") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrer Z") #define MSG_LEVEL_BED_HOMING _UxGT("Origine XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Clic pour commencer") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Point suivant") #define MSG_LEVEL_BED_DONE _UxGT("Mise a niveau OK!") -#define MSG_Z_FADE_HEIGHT _UxGT("Hauteur lissee") +#define MSG_Z_FADE_HEIGHT _UxGT("Adoucir hauteur") #define MSG_SET_HOME_OFFSETS _UxGT("Regl. decal. origine") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Decalages appliques") #define MSG_SET_ORIGIN _UxGT("Regler origine") #define MSG_PREHEAT_1 _UxGT("Prechauffage PLA") #define MSG_PREHEAT_1_N _UxGT("Prechauff. PLA ") #define MSG_PREHEAT_1_ALL _UxGT("Prech. PLA Tout") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" buse") +#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" fini") #define MSG_PREHEAT_1_BEDONLY _UxGT("Prech. PLA lit") #define MSG_PREHEAT_1_SETTINGS _UxGT("Regl. prech. PLA") #define MSG_PREHEAT_2 _UxGT("Prechauffage ABS") #define MSG_PREHEAT_2_N _UxGT("Prechauff. ABS ") #define MSG_PREHEAT_2_ALL _UxGT("Prech. ABS Tout") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" buse") +#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" fini") #define MSG_PREHEAT_2_BEDONLY _UxGT("Prech. ABS lit") #define MSG_PREHEAT_2_SETTINGS _UxGT("Regl. prech. ABS") #define MSG_COOLDOWN _UxGT("Refroidir") #define MSG_SWITCH_PS_ON _UxGT("Allumer alim.") -#define MSG_SWITCH_PS_OFF _UxGT("Eteindre alim.") -#define MSG_EXTRUDE _UxGT("Extrusion") +#define MSG_SWITCH_PS_OFF _UxGT("eteindre alim.") +#define MSG_EXTRUDE _UxGT("extrusion") #define MSG_RETRACT _UxGT("Retraction") #define MSG_MOVE_AXIS _UxGT("Deplacer un axe") #define MSG_BED_LEVELING _UxGT("Regl. Niv. lit") #define MSG_LEVEL_BED _UxGT("Regl. Niv. lit") -#define MSG_LEVEL_CORNERS _UxGT("Niveau coins") -#define MSG_NEXT_CORNER _UxGT("Coin suivant") #define MSG_EDITING_STOPPED _UxGT("Arret edit. maillage") #define MSG_USER_MENU _UxGT("Commandes perso") @@ -88,7 +85,7 @@ #define MSG_UBL_MANUAL_MESH _UxGT("Maillage manuel") #define MSG_UBL_BC_INSERT _UxGT("Poser cale & mesurer") #define MSG_UBL_BC_INSERT2 _UxGT("Mesure") -#define MSG_UBL_BC_REMOVE _UxGT("Oter et mesurer lit") +#define MSG_UBL_BC_REMOVE _UxGT("oter et mesurer lit") #define MSG_UBL_MOVING_TO_NEXT _UxGT("Aller au suivant") #define MSG_UBL_ACTIVATE_MESH _UxGT("Activer l'UBL") #define MSG_UBL_DEACTIVATE_MESH _UxGT("Desactiver l'UBL") @@ -96,10 +93,9 @@ #define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP #define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temperature buse") #define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Editer maille") #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editer maille perso") #define MSG_UBL_FINE_TUNE_MESH _UxGT("Reglage fin maille") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Terminer maille") +#define MSG_UBL_DONE_EDITING_MESH _UxGT("Termier maille") #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Creer maille perso") #define MSG_UBL_BUILD_MESH_MENU _UxGT("Creer maille") #define MSG_UBL_BUILD_PLA_MESH _UxGT("Creer maille PLA") @@ -113,22 +109,22 @@ #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Valider maille perso") #define MSG_UBL_CONTINUE_MESH _UxGT("Continuer maille") #define MSG_UBL_MESH_LEVELING _UxGT("Niveau par maille") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Niveau en 3 points") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Niveau par grille") +#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Niveau a 3 points") +#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Niveau grille") #define MSG_UBL_MESH_LEVEL _UxGT("Maille de niveau") -#define MSG_UBL_SIDE_POINTS _UxGT("Points lateraux") +#define MSG_UBL_SIDE_POINTS _UxGT("Point lateral") #define MSG_UBL_MAP_TYPE _UxGT("Type de carte") #define MSG_UBL_OUTPUT_MAP _UxGT("Voir maille") #define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Voir pour hote") #define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Voir pour CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Voir pour sauveg.") +#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Off Printer Backup") #define MSG_UBL_INFO_UBL _UxGT("Voir info UBL") #define MSG_UBL_EDIT_MESH_MENU _UxGT("Modifier maille") #define MSG_UBL_FILLIN_AMOUNT _UxGT("Taux de remplissage") #define MSG_UBL_MANUAL_FILLIN _UxGT("Remplissage manuel") #define MSG_UBL_SMART_FILLIN _UxGT("Remplissage auto") #define MSG_UBL_FILLIN_MESH _UxGT("Maille remplissage") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Tout annuler") +#define MSG_UBL_INVALIDATE_ALL _UxGT("Annuler tout") #define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Annuler le plus pres") #define MSG_UBL_FINE_TUNE_ALL _UxGT("Reglage fin (tous)") #define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Reglage fin (proche)") @@ -136,49 +132,25 @@ #define MSG_UBL_STORAGE_SLOT _UxGT("Slot memoire") #define MSG_UBL_LOAD_MESH _UxGT("Charger maille") #define MSG_UBL_SAVE_MESH _UxGT("Sauver maille") -#define MSG_MESH_LOADED _UxGT("Maille %i charg.") -#define MSG_MESH_SAVED _UxGT("Maille %i enreg.") -#define MSG_NO_STORAGE _UxGT("Pas de memoire") #define MSG_UBL_SAVE_ERROR _UxGT("Err: Enreg. UBL") #define MSG_UBL_RESTORE_ERROR _UxGT("Err: Ouvrir UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Decal. Z arrete") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Pas a pas") +#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Offset Z arrete") -#define MSG_LED_CONTROL _UxGT("Controle LED") -#define MSG_LEDS _UxGT("Lumiere") -#define MSG_LED_PRESETS _UxGT("Preregl. LED") -#define MSG_SET_LEDS_RED _UxGT("Rouge") -#define MSG_SET_LEDS_ORANGE _UxGT("Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("Jaune") -#define MSG_SET_LEDS_GREEN _UxGT("Vert") -#define MSG_SET_LEDS_BLUE _UxGT("Bleu") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Violet") -#define MSG_SET_LEDS_WHITE _UxGT("Blanc") -#define MSG_SET_LEDS_DEFAULT _UxGT("Defaut") -#define MSG_CUSTOM_LEDS _UxGT("Lum. perso.") -#define MSG_INTENSITY_R _UxGT("Intensite rouge") -#define MSG_INTENSITY_G _UxGT("Intensite vert") -#define MSG_INTENSITY_B _UxGT("Intensite bleu") -#define MSG_INTENSITY_W _UxGT("Intensite blanc") -#define MSG_LED_BRIGHTNESS _UxGT("Luminosite") #define MSG_MOVING _UxGT("Deplacement...") #define MSG_FREE_XY _UxGT("Debloquer XY") #define MSG_MOVE_X _UxGT("Depl. X") #define MSG_MOVE_Y _UxGT("Depl. Y") #define MSG_MOVE_Z _UxGT("Depl. Z") -#define MSG_MOVE_E _UxGT("Extrudeur") +#define MSG_MOVE_E _UxGT("Extruder") #define MSG_MOVE_01MM _UxGT("Depl. 0.1mm") #define MSG_MOVE_1MM _UxGT("Depl. 1mm") #define MSG_MOVE_10MM _UxGT("Depl. 10mm") -#define MSG_SPEED _UxGT("Vitesse") +#define MSG_SPEED _UxGT(" Vitesse") #define MSG_BED_Z _UxGT("Lit Z") #define MSG_NOZZLE _UxGT("Buse") #define MSG_BED _UxGT("Lit") #define MSG_FAN_SPEED _UxGT("Vitesse ventil.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Extra V ventil.") - #define MSG_FLOW _UxGT("Flux") #define MSG_CONTROL _UxGT("Controler") #define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") @@ -194,87 +166,69 @@ #define MSG_SELECT _UxGT("Selectionner") #define MSG_ACC _UxGT("Acceleration") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va jerk") - #define MSG_VB_JERK _UxGT("Vb jerk") - #define MSG_VC_JERK _UxGT("Vc jerk") -#else - #define MSG_VA_JERK _UxGT("Vx jerk") - #define MSG_VB_JERK _UxGT("Vy jerk") - #define MSG_VC_JERK _UxGT("Vz jerk") -#endif -#define MSG_VE_JERK _UxGT("Ve jerk") +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") +#define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VELOCITY _UxGT("Velocite") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin ") -#define MSG_VTRAV_MIN _UxGT("V depl. min") +#define MSG_VMAX _UxGT("Vmax") +#define MSG_VMIN _UxGT("Vmin") +#define MSG_VTRAV_MIN _UxGT("Vdepl min") #define MSG_ACCELERATION _UxGT("Acceleration") #define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A retrait") -#define MSG_A_TRAVEL _UxGT("A Depl.") +#define MSG_A_RETRACT _UxGT("A-retract") +#define MSG_A_TRAVEL _UxGT("A-Depl.") #define MSG_STEPS_PER_MM _UxGT("Pas/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A pas/mm") - #define MSG_BSTEPS _UxGT("B pas/mm") - #define MSG_CSTEPS _UxGT("C pas/mm") -#else - #define MSG_ASTEPS _UxGT("X pas/mm") - #define MSG_BSTEPS _UxGT("Y pas/mm") - #define MSG_CSTEPS _UxGT("Z pas/mm") -#endif -#define MSG_ESTEPS _UxGT("E pas/mm") -#define MSG_E1STEPS _UxGT("E1 pas/mm") -#define MSG_E2STEPS _UxGT("E2 pas/mm") -#define MSG_E3STEPS _UxGT("E3 pas/mm") -#define MSG_E4STEPS _UxGT("E4 pas/mm") -#define MSG_E5STEPS _UxGT("E5 pas/mm") +#define MSG_XSTEPS _UxGT("Xpas/mm") +#define MSG_YSTEPS _UxGT("Ypas/mm") +#define MSG_ZSTEPS _UxGT("Zpas/mm") +#define MSG_ESTEPS _UxGT("Epas/mm") +#define MSG_E1STEPS _UxGT("E1pas/mm") +#define MSG_E2STEPS _UxGT("E2pas/mm") +#define MSG_E3STEPS _UxGT("E3pas/mm") +#define MSG_E4STEPS _UxGT("E4pas/mm") +#define MSG_E5STEPS _UxGT("E5pas/mm") #define MSG_TEMPERATURE _UxGT("Temperature") #define MSG_MOTION _UxGT("Mouvement") #define MSG_FILAMENT _UxGT("Filament") #define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diam. fil.") -#define MSG_FILAMENT_UNLOAD _UxGT("Decharger mm") -#define MSG_FILAMENT_LOAD _UxGT("Charger mm") -#define MSG_ADVANCE_K _UxGT("Avance K") +#define MSG_FILAMENT_DIAM _UxGT("Diam. Fil.") +#define MSG_ADVANCE_K _UxGT("Advance K") #define MSG_CONTRAST _UxGT("Contraste LCD") #define MSG_STORE_EEPROM _UxGT("Sauver config") #define MSG_LOAD_EEPROM _UxGT("Lire config") #define MSG_RESTORE_FAILSAFE _UxGT("Restaurer defauts") #define MSG_INIT_EEPROM _UxGT("Initialiser EEPROM") #define MSG_REFRESH _UxGT("Actualiser") -#define MSG_WATCH _UxGT("Infos") +#define MSG_WATCH _UxGT("Surveiller") #define MSG_PREPARE _UxGT("Preparer") #define MSG_TUNE _UxGT("Regler") #define MSG_PAUSE_PRINT _UxGT("Interrompre impr.") #define MSG_RESUME_PRINT _UxGT("Reprendre impr.") #define MSG_STOP_PRINT _UxGT("Arreter impr.") -#define MSG_POWER_LOSS_RECOVERY _UxGT("Recup. coupure elec.") #define MSG_CARD_MENU _UxGT("Impr. depuis SD") #define MSG_NO_CARD _UxGT("Pas de carte") -#define MSG_DWELL _UxGT("Veille...") -#define MSG_USERWAIT _UxGT("Clic pour reprendre") +#define MSG_DWELL _UxGT("Repos...") +#define MSG_USERWAIT _UxGT("Atten. de l'util.") #define MSG_PRINT_PAUSED _UxGT("Impr. en pause") -#define MSG_PRINT_ABORTED _UxGT("Impr. annulee") +#define MSG_RESUMING _UxGT("Repri. de l'impr.") +#define MSG_PRINT_ABORTED _UxGT("Impr. Annulee") #define MSG_NO_MOVE _UxGT("Moteurs bloques.") #define MSG_KILLED _UxGT("MORT.") -#define MSG_STOPPED _UxGT("STOPPE.") -#define MSG_CONTROL_RETRACT _UxGT("Retrait mm") +#define MSG_STOPPED _UxGT("STOPPe.") +#define MSG_CONTROL_RETRACT _UxGT("Retraction mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Ech. Retr. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retrait V") +#define MSG_CONTROL_RETRACTF _UxGT("Retraction V") #define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saut Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Rappel mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Ech. Rapp. mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Rappel V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("Ech. Rappel V") -#define MSG_AUTORETRACT _UxGT("Retrait. Auto.") +#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") +#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Ech. UnRet mm") +#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") +#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("Ech. UnRet V") +#define MSG_AUTORETRACT _UxGT("Retract. Auto.") #define MSG_FILAMENTCHANGE _UxGT("Changer filament") -#define MSG_FILAMENTLOAD _UxGT("Charger fil.") -#define MSG_FILAMENTUNLOAD _UxGT("Decharger fil.") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Decharger tout") #define MSG_INIT_SDCARD _UxGT("Init. la carte SD") #define MSG_CNG_SDCARD _UxGT("Changer de carte") -#define MSG_ZPROBE_OUT _UxGT("Sonde Z hors lit") -#define MSG_SKEW_FACTOR _UxGT("Facteur derive") +#define MSG_ZPROBE_OUT _UxGT("Z sonde exte. lit") #define MSG_BLTOUCH _UxGT("BLTouch") #define MSG_BLTOUCH_SELFTEST _UxGT("Autotest BLTouch") #define MSG_BLTOUCH_RESET _UxGT("RaZ BLTouch") @@ -288,43 +242,42 @@ #define MSG_BABYSTEP_Z _UxGT("Babystep Z") #define MSG_ENDSTOP_ABORT _UxGT("Butee abandon") #define MSG_HEATING_FAILED_LCD _UxGT("Erreur de chauffe") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP. REDONDANTE") +#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP. REDONDANT") #define MSG_THERMAL_RUNAWAY _UxGT("EMBALLEMENT THERM.") #define MSG_ERR_MAXTEMP _UxGT("Err: TEMP. MAX") #define MSG_ERR_MINTEMP _UxGT("Err: TEMP. MIN") #define MSG_ERR_MAXTEMP_BED _UxGT("Err: TEMP. MAX LIT") #define MSG_ERR_MINTEMP_BED _UxGT("Err: TEMP. MIN LIT") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("IMPR. STOPPEE") +#define MSG_ERR_Z_HOMING _UxGT("G28 Z interdit") + +#define MSG_HALTED _UxGT("IMPR. STOPPeE") #define MSG_PLEASE_RESET _UxGT("RaZ. SVP") #define MSG_SHORT_DAY _UxGT("j") // One character only #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("En chauffe...") -#define MSG_BED_HEATING _UxGT("Lit en chauffe...") +#define MSG_HEATING_COMPLETE _UxGT("Chauffe terminee") +#define MSG_BED_HEATING _UxGT("Lit en chauffe..") +#define MSG_BED_DONE _UxGT("Chauffe lit terminee") #define MSG_DELTA_CALIBRATE _UxGT("Calibration Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Calibrer X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrer Y") #define MSG_DELTA_CALIBRATE_Z _UxGT("Calibrer Z") #define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrer centre") -#define MSG_DELTA_SETTINGS _UxGT("Reglages Delta") #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Calibration Auto") #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Hauteur Delta") -#define MSG_DELTA_DIAG_ROD _UxGT("Diagonale") -#define MSG_DELTA_HEIGHT _UxGT("Hauteur") -#define MSG_DELTA_RADIUS _UxGT("Rayon") -#define MSG_INFO_MENU _UxGT("A propos impr.") +#define MSG_INFO_MENU _UxGT("Infos imprimante") #define MSG_INFO_PRINTER_MENU _UxGT("Infos imprimante") -#define MSG_3POINT_LEVELING _UxGT("Niveau en 3 points") +#define MSG_3POINT_LEVELING _UxGT("Niveau a 3 points") #define MSG_LINEAR_LEVELING _UxGT("Niveau lineaire") #define MSG_BILINEAR_LEVELING _UxGT("Niveau bilineaire") #define MSG_UBL_LEVELING _UxGT("Niveau lit unifie") #define MSG_MESH_LEVELING _UxGT("Niveau maillage") #define MSG_INFO_STATS_MENU _UxGT("Stats. imprimante") #define MSG_INFO_BOARD_MENU _UxGT("Infos carte") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermocouples") +#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") #define MSG_INFO_EXTRUDERS _UxGT("Extrudeurs") #define MSG_INFO_BAUDRATE _UxGT("Baud") #define MSG_INFO_PROTOCOL _UxGT("Protocole") @@ -350,38 +303,34 @@ #define MSG_INFO_PSU _UxGT("Alimentation") #define MSG_DRIVE_STRENGTH _UxGT("Puiss. moteur ") #define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Sauv. DAC EEPROM") +#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM sauv.") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("IMPR. PAUSE") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("CHARGER FIL") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("DECHARGER FIL") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("OPTIONS REPRISE:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purger plus") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("+ extrusion") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Reprendre impr.") +#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("La temp. minimum est ") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Buse: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Echec origine") -#define MSG_ERR_PROBING_FAILED _UxGT("Echec sonde") -#define MSG_M600_TOO_COLD _UxGT("M600: Trop froid") #if LCD_HEIGHT >= 4 // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attente demarrage") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("du changement") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("de filament") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Attente de") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attente Demarrage") + #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("du filament") + #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("changer") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("attente de") #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("decharger filament") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserer filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("et clic bouton") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("inserer filament") + #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("et app. bouton") #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("pour continuer...") #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Presser le bouton...") #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("Pr chauffer la buse") #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Buse en chauffe") #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Patientez SVP...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Attente de") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("attente de") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("chargement filament") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Attente") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("Purger filament") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Attente impression") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("attente de") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("extrusion filament") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("attente impression") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("pour reprendre") #else // LCD_HEIGHT < 4 // Up to 2 lines allowed @@ -389,6 +338,7 @@ #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejection...") #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserer et clic") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Chargement...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extrusion...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Reprise...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_fr_utf8.h b/Marlin/language_fr_utf8.h index 12e841b..ab32895 100644 --- a/Marlin/language_fr_utf8.h +++ b/Marlin/language_fr_utf8.h @@ -32,7 +32,6 @@ #define MAPPER_C2C3 #define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" prête.") #define MSG_BACK _UxGT("Retour") @@ -40,7 +39,7 @@ #define MSG_SD_REMOVED _UxGT("Carte retirée") #define MSG_LCD_ENDSTOPS _UxGT("Butées") // Max length 8 characters #define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Démarrage auto") +#define MSG_AUTOSTART _UxGT("Demarrage auto") #define MSG_DISABLE_STEPPERS _UxGT("Arrêter moteurs") #define MSG_DEBUG_MENU _UxGT("Menu debug") #define MSG_PROGRESS_BAR_TEST _UxGT("Test barre progress.") @@ -48,38 +47,35 @@ #define MSG_AUTO_HOME_X _UxGT("Origine X Auto.") #define MSG_AUTO_HOME_Y _UxGT("Origine Y Auto.") #define MSG_AUTO_HOME_Z _UxGT("Origine Z Auto.") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrer Z") #define MSG_LEVEL_BED_HOMING _UxGT("Origine XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Clic pour commencer") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Point suivant") #define MSG_LEVEL_BED_DONE _UxGT("Mise à niveau OK!") -#define MSG_Z_FADE_HEIGHT _UxGT("Hauteur lissée") -#define MSG_SET_HOME_OFFSETS _UxGT("Régl. décal. origine") +#define MSG_Z_FADE_HEIGHT _UxGT("Adoucir hauteur") +#define MSG_SET_HOME_OFFSETS _UxGT("Regl. décal. origine") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Décalages appliqués") #define MSG_SET_ORIGIN _UxGT("Régler origine") #define MSG_PREHEAT_1 _UxGT("Préchauffage PLA") #define MSG_PREHEAT_1_N _UxGT("Préchauff. PLA ") #define MSG_PREHEAT_1_ALL _UxGT("Préch. PLA Tout") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" buse") +#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" fini") #define MSG_PREHEAT_1_BEDONLY _UxGT("Préch. PLA lit") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Régl. prech. PLA") +#define MSG_PREHEAT_1_SETTINGS _UxGT("Regl. prech. PLA") #define MSG_PREHEAT_2 _UxGT("Préchauffage ABS") #define MSG_PREHEAT_2_N _UxGT("Préchauff. ABS ") #define MSG_PREHEAT_2_ALL _UxGT("Préch. ABS Tout") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" buse") +#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" fini") #define MSG_PREHEAT_2_BEDONLY _UxGT("Préch. ABS lit") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Régl. prech. ABS") +#define MSG_PREHEAT_2_SETTINGS _UxGT("Regl. prech. ABS") #define MSG_COOLDOWN _UxGT("Refroidir") #define MSG_SWITCH_PS_ON _UxGT("Allumer alim.") #define MSG_SWITCH_PS_OFF _UxGT("Éteindre alim.") -#define MSG_EXTRUDE _UxGT("Extrusion") -#define MSG_RETRACT _UxGT("Retrait") +#define MSG_EXTRUDE _UxGT("Éxtrusion") +#define MSG_RETRACT _UxGT("Rétraction") #define MSG_MOVE_AXIS _UxGT("Déplacer un axe") -#define MSG_BED_LEVELING _UxGT("Régl. Niv. lit") -#define MSG_LEVEL_BED _UxGT("Régl. Niv. lit") -#define MSG_LEVEL_CORNERS _UxGT("Niveau coins") -#define MSG_NEXT_CORNER _UxGT("Coin suivant") -#define MSG_EDITING_STOPPED _UxGT("Arrêt édit. maillage") +#define MSG_BED_LEVELING _UxGT("Règl. Niv. lit") +#define MSG_LEVEL_BED _UxGT("Règl. Niv. lit") +#define MSG_EDITING_STOPPED _UxGT("Arrêt edit. maillage") #define MSG_USER_MENU _UxGT("Commandes perso") #define MSG_UBL_DOING_G29 _UxGT("G29 en cours") @@ -87,9 +83,9 @@ #define MSG_UBL_TOOLS _UxGT("Outils UBL") #define MSG_UBL_LEVEL_BED _UxGT("Niveau lit unifié") #define MSG_UBL_MANUAL_MESH _UxGT("Maillage manuel") -#define MSG_UBL_BC_INSERT _UxGT("Poser cale & mesurer") +#define MSG_UBL_BC_INSERT _UxGT("Poser câle & mesurer") #define MSG_UBL_BC_INSERT2 _UxGT("Mesure") -#define MSG_UBL_BC_REMOVE _UxGT("Ôter et mesurer lit") +#define MSG_UBL_BC_REMOVE _UxGT("ôter et mesurer lit") #define MSG_UBL_MOVING_TO_NEXT _UxGT("Aller au suivant") #define MSG_UBL_ACTIVATE_MESH _UxGT("Activer l'UBL") #define MSG_UBL_DEACTIVATE_MESH _UxGT("Désactiver l'UBL") @@ -97,10 +93,9 @@ #define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP #define MSG_UBL_SET_HOTEND_TEMP _UxGT("Température buse") #define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Éditer maille") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Éditer maille perso") +#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editer maille perso") #define MSG_UBL_FINE_TUNE_MESH _UxGT("Réglage fin maille") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Terminer maille") +#define MSG_UBL_DONE_EDITING_MESH _UxGT("Termier maille") #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Créer maille perso") #define MSG_UBL_BUILD_MESH_MENU _UxGT("Créer maille") #define MSG_UBL_BUILD_PLA_MESH _UxGT("Créer maille PLA") @@ -122,14 +117,14 @@ #define MSG_UBL_OUTPUT_MAP _UxGT("Voir maille") #define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Voir pour hôte") #define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Voir pour CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Voir pour sauveg.") +#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Off Printer Backup") #define MSG_UBL_INFO_UBL _UxGT("Voir info UBL") #define MSG_UBL_EDIT_MESH_MENU _UxGT("Modifier maille") #define MSG_UBL_FILLIN_AMOUNT _UxGT("Taux de remplissage") #define MSG_UBL_MANUAL_FILLIN _UxGT("Remplissage manuel") #define MSG_UBL_SMART_FILLIN _UxGT("Remplissage auto") #define MSG_UBL_FILLIN_MESH _UxGT("Maille remplissage") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Tout annuler") +#define MSG_UBL_INVALIDATE_ALL _UxGT("Annuler tout") #define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Annuler le plus près") #define MSG_UBL_FINE_TUNE_ALL _UxGT("Réglage fin (tous)") #define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Réglage fin (proche)") @@ -137,49 +132,25 @@ #define MSG_UBL_STORAGE_SLOT _UxGT("Slot mémoire") #define MSG_UBL_LOAD_MESH _UxGT("Charger maille") #define MSG_UBL_SAVE_MESH _UxGT("Sauver maille") -#define MSG_MESH_LOADED _UxGT("Maille %i charg.") -#define MSG_MESH_SAVED _UxGT("Maille %i enreg.") -#define MSG_NO_STORAGE _UxGT("Pas de mémoire") #define MSG_UBL_SAVE_ERROR _UxGT("Err: Enreg. UBL") #define MSG_UBL_RESTORE_ERROR _UxGT("Err: Ouvrir UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Décal. Z arrêté") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Pas à pas") +#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Offset Z arrêté") -#define MSG_LED_CONTROL _UxGT("Contrôle LED") -#define MSG_LEDS _UxGT("Lumière") -#define MSG_LED_PRESETS _UxGT("Préregl. LED") -#define MSG_SET_LEDS_RED _UxGT("Rouge") -#define MSG_SET_LEDS_ORANGE _UxGT("Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("Jaune") -#define MSG_SET_LEDS_GREEN _UxGT("Vert") -#define MSG_SET_LEDS_BLUE _UxGT("Bleu") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Violet") -#define MSG_SET_LEDS_WHITE _UxGT("Blanc") -#define MSG_SET_LEDS_DEFAULT _UxGT("Défaut") -#define MSG_CUSTOM_LEDS _UxGT("Lum. perso.") -#define MSG_INTENSITY_R _UxGT("Intensité rouge") -#define MSG_INTENSITY_G _UxGT("Intensité vert") -#define MSG_INTENSITY_B _UxGT("Intensité bleu") -#define MSG_INTENSITY_W _UxGT("Intensité blanc") -#define MSG_LED_BRIGHTNESS _UxGT("Luminosité") #define MSG_MOVING _UxGT("Déplacement...") #define MSG_FREE_XY _UxGT("Débloquer XY") #define MSG_MOVE_X _UxGT("Dépl. X") #define MSG_MOVE_Y _UxGT("Dépl. Y") #define MSG_MOVE_Z _UxGT("Dépl. Z") -#define MSG_MOVE_E _UxGT("Extrudeur") +#define MSG_MOVE_E _UxGT("Extruder") #define MSG_MOVE_01MM _UxGT("Dépl. 0.1mm") #define MSG_MOVE_1MM _UxGT("Dépl. 1mm") #define MSG_MOVE_10MM _UxGT("Dépl. 10mm") -#define MSG_SPEED _UxGT("Vitesse") +#define MSG_SPEED _UxGT(" Vitesse") #define MSG_BED_Z _UxGT("Lit Z") #define MSG_NOZZLE _UxGT("Buse") #define MSG_BED _UxGT("Lit") #define MSG_FAN_SPEED _UxGT("Vitesse ventil.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Extra V ventil.") - #define MSG_FLOW _UxGT("Flux") #define MSG_CONTROL _UxGT("Contrôler") #define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") @@ -195,48 +166,34 @@ #define MSG_SELECT _UxGT("Sélectionner") #define MSG_ACC _UxGT("Accélération") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va jerk") - #define MSG_VB_JERK _UxGT("Vb jerk") - #define MSG_VC_JERK _UxGT("Vc jerk") -#else - #define MSG_VA_JERK _UxGT("Vx jerk") - #define MSG_VB_JERK _UxGT("Vy jerk") - #define MSG_VC_JERK _UxGT("Vz jerk") -#endif -#define MSG_VE_JERK _UxGT("Ve jerk") +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") +#define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VELOCITY _UxGT("Vélocité") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin ") -#define MSG_VTRAV_MIN _UxGT("V dépl. min") +#define MSG_VMAX _UxGT("Vmax") +#define MSG_VMIN _UxGT("Vmin") +#define MSG_VTRAV_MIN _UxGT("Vdepl min") #define MSG_ACCELERATION _UxGT("Accélération") #define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A retrait") -#define MSG_A_TRAVEL _UxGT("A dépl.") +#define MSG_A_RETRACT _UxGT("A-retract") +#define MSG_A_TRAVEL _UxGT("A-Dépl.") #define MSG_STEPS_PER_MM _UxGT("Pas/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A pas/mm") - #define MSG_BSTEPS _UxGT("B pas/mm") - #define MSG_CSTEPS _UxGT("C pas/mm") -#else - #define MSG_ASTEPS _UxGT("X pas/mm") - #define MSG_BSTEPS _UxGT("Y pas/mm") - #define MSG_CSTEPS _UxGT("Z pas/mm") -#endif -#define MSG_ESTEPS _UxGT("E pas/mm") -#define MSG_E1STEPS _UxGT("E1 pas/mm") -#define MSG_E2STEPS _UxGT("E2 pas/mm") -#define MSG_E3STEPS _UxGT("E3 pas/mm") -#define MSG_E4STEPS _UxGT("E4 pas/mm") -#define MSG_E5STEPS _UxGT("E5 pas/mm") +#define MSG_XSTEPS _UxGT("Xpas/mm") +#define MSG_YSTEPS _UxGT("Ypas/mm") +#define MSG_ZSTEPS _UxGT("Zpas/mm") +#define MSG_ESTEPS _UxGT("Epas/mm") +#define MSG_E1STEPS _UxGT("E1pas/mm") +#define MSG_E2STEPS _UxGT("E2pas/mm") +#define MSG_E3STEPS _UxGT("E3pas/mm") +#define MSG_E4STEPS _UxGT("E4pas/mm") +#define MSG_E5STEPS _UxGT("E5pas/mm") #define MSG_TEMPERATURE _UxGT("Température") #define MSG_MOTION _UxGT("Mouvement") #define MSG_FILAMENT _UxGT("Filament") #define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") #define MSG_FILAMENT_DIAM _UxGT("Diam. Fil.") -#define MSG_FILAMENT_UNLOAD _UxGT("Décharger mm") -#define MSG_FILAMENT_LOAD _UxGT("Charger mm") -#define MSG_ADVANCE_K _UxGT("Avance K") +#define MSG_ADVANCE_K _UxGT("Advance K") #define MSG_CONTRAST _UxGT("Contraste LCD") #define MSG_STORE_EEPROM _UxGT("Sauver config") #define MSG_LOAD_EEPROM _UxGT("Lire config") @@ -254,27 +211,23 @@ #define MSG_DWELL _UxGT("Repos...") #define MSG_USERWAIT _UxGT("Atten. de l'util.") #define MSG_PRINT_PAUSED _UxGT("Impr. en pause") +#define MSG_RESUMING _UxGT("Repri. de l'impr.") #define MSG_PRINT_ABORTED _UxGT("Impr. Annulée") #define MSG_NO_MOVE _UxGT("Moteurs bloqués.") #define MSG_KILLED _UxGT("MORT.") #define MSG_STOPPED _UxGT("STOPPÉ.") -#define MSG_CONTROL_RETRACT _UxGT("Retrait mm") +#define MSG_CONTROL_RETRACT _UxGT("Retraction mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Ech. Retr. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retrait V") +#define MSG_CONTROL_RETRACTF _UxGT("Rétraction V") #define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saut Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Rappel mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Ech. Rappel mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Rappel V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("Ech. Rappel V") -#define MSG_AUTORETRACT _UxGT("Retrait. Auto.") +#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") +#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Ech. UnRet mm") +#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") +#define MSG_AUTORETRACT _UxGT("Rétract. Auto.") #define MSG_FILAMENTCHANGE _UxGT("Changer filament") -#define MSG_FILAMENTLOAD _UxGT("Charger fil.") -#define MSG_FILAMENTUNLOAD _UxGT("Décharger fil.") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Décharger tout") #define MSG_INIT_SDCARD _UxGT("Init. la carte SD") #define MSG_CNG_SDCARD _UxGT("Changer de carte") -#define MSG_ZPROBE_OUT _UxGT("Z sonde hors lit") -#define MSG_SKEW_FACTOR _UxGT("Facteur écart") +#define MSG_ZPROBE_OUT _UxGT("Z sonde extè. lit") #define MSG_BLTOUCH _UxGT("BLTouch") #define MSG_BLTOUCH_SELFTEST _UxGT("Autotest BLTouch") #define MSG_BLTOUCH_RESET _UxGT("RaZ BLTouch") @@ -288,32 +241,31 @@ #define MSG_BABYSTEP_Z _UxGT("Babystep Z") #define MSG_ENDSTOP_ABORT _UxGT("Butée abandon") #define MSG_HEATING_FAILED_LCD _UxGT("Erreur de chauffe") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP. REDONDANTE") +#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP. REDONDANT") #define MSG_THERMAL_RUNAWAY _UxGT("EMBALLEMENT THERM.") #define MSG_ERR_MAXTEMP _UxGT("Err: TEMP. MAX") #define MSG_ERR_MINTEMP _UxGT("Err: TEMP. MIN") #define MSG_ERR_MAXTEMP_BED _UxGT("Err: TEMP. MAX LIT") #define MSG_ERR_MINTEMP_BED _UxGT("Err: TEMP. MIN LIT") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z interdit") + #define MSG_HALTED _UxGT("IMPR. STOPPÉE") -#define MSG_PLEASE_RESET _UxGT("RàZ. SVP") +#define MSG_PLEASE_RESET _UxGT("RaZ. SVP") #define MSG_SHORT_DAY _UxGT("j") // One character only #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("En chauffe...") -#define MSG_BED_HEATING _UxGT("Lit en chauffe...") +#define MSG_HEATING_COMPLETE _UxGT("Chauffe terminée") +#define MSG_BED_HEATING _UxGT("Lit en chauffe..") +#define MSG_BED_DONE _UxGT("Chauffe lit terminée") #define MSG_DELTA_CALIBRATE _UxGT("Calibration Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Calibrer X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrer Y") #define MSG_DELTA_CALIBRATE_Z _UxGT("Calibrer Z") #define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrer centre") -#define MSG_DELTA_SETTINGS _UxGT("Réglages Delta") #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Calibration Auto") #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Hauteur Delta") -#define MSG_DELTA_DIAG_ROD _UxGT("Diagonale") -#define MSG_DELTA_HEIGHT _UxGT("Hauteur") -#define MSG_DELTA_RADIUS _UxGT("Rayon") #define MSG_INFO_MENU _UxGT("Infos imprimante") #define MSG_INFO_PRINTER_MENU _UxGT("Infos imprimante") @@ -352,36 +304,32 @@ #define MSG_DAC_PERCENT _UxGT("Driver %") #define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM sauv.") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("IMPR. PAUSE") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("CHARGER FIL") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("DECHARGER FIL") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("OPTIONS REPRISE:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purger encore") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("+ extrusion") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Reprendre impr.") +#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("La temp. minimum est ") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Buse: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Echec origine") -#define MSG_ERR_PROBING_FAILED _UxGT("Echec sonde") -#define MSG_M600_TOO_COLD _UxGT("M600: Trop froid") #if LCD_HEIGHT >= 4 // Up to 3 lines allowed #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attente Démarrage") #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("du filament") #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("changer") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Attente de") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("attente de") #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("décharger filament") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insérer filament") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("insérer filament") #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("et app. bouton") #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("pour continuer...") #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Presser le bouton...") #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("Pr chauffer la buse") #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Buse en chauffe") #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Patientez SVP...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Attente de") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("Chargement filament") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Attente") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("Purger filament") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Attente impression") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("attente de") + #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("chargement filament") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("attente de") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("extrusion filament") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("attente impression") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("pour reprendre") #else // LCD_HEIGHT < 4 // Up to 2 lines allowed @@ -389,6 +337,7 @@ #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejection...") #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insérer et clic") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Chargement...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extrusion...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Reprise...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_gl.h b/Marlin/language_gl.h index e0524d8..f8d5003 100644 --- a/Marlin/language_gl.h +++ b/Marlin/language_gl.h @@ -45,7 +45,6 @@ #define MSG_AUTO_HOME_X _UxGT("Ir orixe X") #define MSG_AUTO_HOME_Y _UxGT("Ir orixe Y") #define MSG_AUTO_HOME_Z _UxGT("Ir orixe Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") #define MSG_LEVEL_BED_HOMING _UxGT("Ir orixes XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Prema pulsador") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Seguinte punto") @@ -98,15 +97,9 @@ #define MSG_SELECT _UxGT("Escolla") #define MSG_ACC _UxGT("Acel") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") #define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VMAX _UxGT("Vmax ") #define MSG_VMIN _UxGT("Vmin") @@ -115,21 +108,15 @@ #define MSG_A_RETRACT _UxGT("A-retract") #define MSG_A_TRAVEL _UxGT("A-travel") #define MSG_STEPS_PER_MM _UxGT("Pasos/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A pasos/mm") - #define MSG_BSTEPS _UxGT("B pasos/mm") - #define MSG_CSTEPS _UxGT("C pasos/mm") -#else - #define MSG_ASTEPS _UxGT("X pasos/mm") - #define MSG_BSTEPS _UxGT("Y pasos/mm") - #define MSG_CSTEPS _UxGT("Z pasos/mm") -#endif -#define MSG_ESTEPS _UxGT("E pasos/mm") -#define MSG_E1STEPS _UxGT("E1 pasos/mm") -#define MSG_E2STEPS _UxGT("E2 pasos/mm") -#define MSG_E3STEPS _UxGT("E3 pasos/mm") -#define MSG_E4STEPS _UxGT("E4 pasos/mm") -#define MSG_E5STEPS _UxGT("E5 pasos/mm") +#define MSG_XSTEPS _UxGT("Xpasos/mm") +#define MSG_YSTEPS _UxGT("Ypasos/mm") +#define MSG_ZSTEPS _UxGT("Zpasos/mm") +#define MSG_ESTEPS _UxGT("Epasos/mm") +#define MSG_E1STEPS _UxGT("E1pasos/mm") +#define MSG_E2STEPS _UxGT("E2pasos/mm") +#define MSG_E3STEPS _UxGT("E3pasos/mm") +#define MSG_E4STEPS _UxGT("E4pasos/mm") +#define MSG_E5STEPS _UxGT("E5pasos/mm") #define MSG_TEMPERATURE _UxGT("Temperatura") #define MSG_MOTION _UxGT("Movemento") #define MSG_FILAMENT _UxGT("Filamento") @@ -150,6 +137,7 @@ #define MSG_NO_CARD _UxGT("Sen tarxeta SD") #define MSG_DWELL _UxGT("En repouso...") #define MSG_USERWAIT _UxGT("A espera...") +#define MSG_RESUMING _UxGT("Imprimindo...") #define MSG_PRINT_ABORTED _UxGT("Impre. cancelada") #define MSG_NO_MOVE _UxGT("Sen movemento.") #define MSG_KILLED _UxGT("PROGRAMA MORTO") @@ -182,14 +170,16 @@ #define MSG_ERR_MINTEMP _UxGT("Err: temp. min.") #define MSG_ERR_MAXTEMP_BED _UxGT("Err: MAXTEMP BED") #define MSG_ERR_MINTEMP_BED _UxGT("Err: MINTEMP BED") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z impedido") #define MSG_HALTED _UxGT("SISTEMA MORTO") #define MSG_PLEASE_RESET _UxGT("Debe reiniciar!") #define MSG_SHORT_DAY _UxGT("d") // One character only #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("Quentando...") -#define MSG_BED_HEATING _UxGT("Quentando cama...") +#define MSG_HEATING_COMPLETE _UxGT("Xa esta quente") +#define MSG_BED_HEATING _UxGT("Quentando cama") +#define MSG_BED_DONE _UxGT("Cama esta quente") #define MSG_DELTA_CALIBRATE _UxGT("Calibracion Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Calibrar X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrar Y") @@ -224,6 +214,9 @@ #define MSG_DAC_PERCENT _UxGT("Motor %") #define MSG_DAC_EEPROM_WRITE _UxGT("Garda DAC EEPROM") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extruir mais") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Segue traballo") #if LCD_HEIGHT >= 4 @@ -240,6 +233,9 @@ #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Agarde pola") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("carga do") #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamento") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Agarde pola") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("extrusion do") + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 _UxGT("filamento") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Agarde para") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("seguir co") #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("traballo") @@ -249,7 +245,9 @@ #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Descargando...") #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Introduza e click") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Cargando...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extruindo...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Seguindo...") #endif // LCD_HEIGHT < 4 #endif // LANGUAGE_GL_H + diff --git a/Marlin/language_hr.h b/Marlin/language_hr.h index efdeae8..64de749 100644 --- a/Marlin/language_hr.h +++ b/Marlin/language_hr.h @@ -31,7 +31,6 @@ #define LANGUAGE_HR_H #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" spreman.") #define MSG_SD_INSERTED _UxGT("SD kartica umetnuta") @@ -44,7 +43,6 @@ #define MSG_AUTO_HOME_X _UxGT("Home-aj X") #define MSG_AUTO_HOME_Y _UxGT("Home-aj Y") #define MSG_AUTO_HOME_Z _UxGT("Home-aj Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibriraj Z") #define MSG_LEVEL_BED_HOMING _UxGT("Home-aj XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Klikni za početak") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Sljedeća točka") @@ -97,15 +95,9 @@ #define MSG_SELECT _UxGT("Odaberi") #define MSG_ACC _UxGT("Accel") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") #define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VMAX _UxGT("Vmax ") #define MSG_VMIN _UxGT("Vmin") @@ -114,15 +106,9 @@ #define MSG_A_RETRACT _UxGT("A-retract") #define MSG_A_TRAVEL _UxGT("A-travel") #define MSG_STEPS_PER_MM _UxGT("Steps/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Asteps/mm") - #define MSG_BSTEPS _UxGT("Bsteps/mm") - #define MSG_CSTEPS _UxGT("Csteps/mm") -#else - #define MSG_ASTEPS _UxGT("Xsteps/mm") - #define MSG_BSTEPS _UxGT("Ysteps/mm") - #define MSG_CSTEPS _UxGT("Zsteps/mm") -#endif +#define MSG_XSTEPS _UxGT("Xsteps/mm") +#define MSG_YSTEPS _UxGT("Ysteps/mm") +#define MSG_ZSTEPS _UxGT("Zsteps/mm") #define MSG_ESTEPS _UxGT("Esteps/mm") #define MSG_E1STEPS _UxGT("E1steps/mm") #define MSG_E2STEPS _UxGT("E2steps/mm") @@ -149,6 +135,7 @@ #define MSG_NO_CARD _UxGT("Nema SD kartice") #define MSG_DWELL _UxGT("Sleep...") #define MSG_USERWAIT _UxGT("Čekaj korisnika...") +#define MSG_RESUMING _UxGT("Nastavljam print") #define MSG_PRINT_ABORTED _UxGT("Print otkazan") #define MSG_NO_MOVE _UxGT("No move.") #define MSG_KILLED _UxGT("KILLED. ") @@ -181,14 +168,16 @@ #define MSG_ERR_MINTEMP _UxGT("Err: MINTEMP") #define MSG_ERR_MAXTEMP_BED _UxGT("Err: MAXTEMP BED") #define MSG_ERR_MINTEMP_BED _UxGT("Err: MINTEMP BED") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z Forbidden") #define MSG_HALTED _UxGT("PRINTER HALTED") #define MSG_PLEASE_RESET _UxGT("Please reset") #define MSG_SHORT_DAY _UxGT("d") // One character only #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("Grijanje...") -#define MSG_BED_HEATING _UxGT("Grijanje Bed-a...") +#define MSG_HEATING_COMPLETE _UxGT("Grijanje gotovo.") +#define MSG_BED_HEATING _UxGT("Grijanje Bed-a.") +#define MSG_BED_DONE _UxGT("Bed gotov.") #define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibracija") #define MSG_DELTA_CALIBRATE_X _UxGT("Kalibriraj X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibriraj Y") @@ -225,6 +214,9 @@ #define MSG_DAC_PERCENT _UxGT("Driver %") #define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Write") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extrudiraj više") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Nastavi print") #if LCD_HEIGHT >= 4 @@ -239,6 +231,8 @@ #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("za nastavak...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Pričekaj") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Pričekaj") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("filament extrude") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("to resume") #else // LCD_HEIGHT < 4 @@ -247,6 +241,7 @@ #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejecting...") #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert and Click") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Loading...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extrudiranje...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Nastavljam...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 306faa3..fae438c 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -47,7 +47,6 @@ #define MSG_AUTO_HOME_X _UxGT("Home asse X") #define MSG_AUTO_HOME_Y _UxGT("Home asse Y") #define MSG_AUTO_HOME_Z _UxGT("Home asse Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibra Z") #define MSG_LEVEL_BED_HOMING _UxGT("Home assi XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Premi per iniziare") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Punto successivo") @@ -57,13 +56,13 @@ #define MSG_HOME_OFFSETS_APPLIED _UxGT("Offset applicato") #define MSG_SET_ORIGIN _UxGT("Imposta Origine") #define MSG_PREHEAT_1 _UxGT("Preriscalda PLA") -#define MSG_PREHEAT_1_N _UxGT("Preris.PLA ") +#define MSG_PREHEAT_1_N _UxGT("Prerisc.PLA ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1_N _UxGT("Tutto") #define MSG_PREHEAT_1_END MSG_PREHEAT_1_N _UxGT("Ugello") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1_N _UxGT("Piatto") #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1_N _UxGT("conf") #define MSG_PREHEAT_2 _UxGT("Preriscalda ABS") -#define MSG_PREHEAT_2_N _UxGT("Preris.ABS ") +#define MSG_PREHEAT_2_N _UxGT("Prerisc.ABS ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2_N _UxGT("Tutto") #define MSG_PREHEAT_2_END MSG_PREHEAT_2_N _UxGT("Ugello") #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2_N _UxGT("Piatto") @@ -76,8 +75,6 @@ #define MSG_MOVE_AXIS _UxGT("Muovi Asse") #define MSG_BED_LEVELING _UxGT("Livella piano") #define MSG_LEVEL_BED _UxGT("Livella piano") -#define MSG_LEVEL_CORNERS _UxGT("Livella spigoli") -#define MSG_NEXT_CORNER _UxGT("Prossimo spigolo") #define MSG_EDITING_STOPPED _UxGT("Modifica Mesh Fermata") #define MSG_USER_MENU _UxGT("Comandi Utente") @@ -88,7 +85,7 @@ #define MSG_UBL_MANUAL_MESH _UxGT("Mesh Manuale") #define MSG_UBL_BC_INSERT _UxGT("Metti spessore & misura") #define MSG_UBL_BC_INSERT2 _UxGT("Misura") -#define MSG_UBL_BC_REMOVE _UxGT("Rimuovi e misura piatto") +#define MSG_UBL_BC_REMOVE _UxGT("Rimuovi & misura piatto") #define MSG_UBL_MOVING_TO_NEXT _UxGT("Spostamento sucessivo") #define MSG_UBL_ACTIVATE_MESH _UxGT("Attiva UBL") #define MSG_UBL_DEACTIVATE_MESH _UxGT("Disattiva UBL") @@ -96,7 +93,6 @@ #define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP #define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temp Ugello") #define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Modifica Mesh") #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Modif Custom Mesh") #define MSG_UBL_FINE_TUNE_MESH _UxGT("Ritocca Mesh") #define MSG_UBL_DONE_EDITING_MESH _UxGT("Done Editing Mesh") @@ -136,33 +132,11 @@ #define MSG_UBL_STORAGE_SLOT _UxGT("Slot di memoria") #define MSG_UBL_LOAD_MESH _UxGT("Carica Mesh Piatto") #define MSG_UBL_SAVE_MESH _UxGT("Salva Mesh Piatto") -#define MSG_MESH_LOADED _UxGT("Mesh %i caricata") -#define MSG_MESH_SAVED _UxGT("Mesh %i salvata") -#define MSG_NO_STORAGE _UxGT("Nessuna memoria") #define MSG_UBL_SAVE_ERROR _UxGT("Err: Salvataggio UBL") #define MSG_UBL_RESTORE_ERROR _UxGT("Err: Ripristino UBL") #define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Fermato") #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo passo") -#define MSG_LED_CONTROL _UxGT("Controllo LED") -#define MSG_LEDS _UxGT("Luci") -#define MSG_LED_PRESETS _UxGT("Preset luci") -#define MSG_SET_LEDS_RED _UxGT("Rosso") -#define MSG_SET_LEDS_ORANGE _UxGT("Arancione") -#define MSG_SET_LEDS_YELLOW _UxGT("Giallo") -#define MSG_SET_LEDS_GREEN _UxGT("Verde") -#define MSG_SET_LEDS_BLUE _UxGT("Blu") -#define MSG_SET_LEDS_INDIGO _UxGT("Indaco") -#define MSG_SET_LEDS_VIOLET _UxGT("Viola") -#define MSG_SET_LEDS_WHITE _UxGT("Bianco") -#define MSG_SET_LEDS_DEFAULT _UxGT("Predefinito") -#define MSG_CUSTOM_LEDS _UxGT("Luci personalizzate") -#define MSG_INTENSITY_R _UxGT("Intensita rosso") -#define MSG_INTENSITY_G _UxGT("Intensita verde") -#define MSG_INTENSITY_B _UxGT("Intensita blu") -#define MSG_INTENSITY_W _UxGT("Intensita bianco") -#define MSG_LED_BRIGHTNESS _UxGT("Luminosita") - #define MSG_MOVING _UxGT("In movimento...") #define MSG_FREE_XY _UxGT("XY liberi") #define MSG_MOVE_X _UxGT("Muovi X") @@ -176,8 +150,7 @@ #define MSG_BED_Z _UxGT("piatto Z") #define MSG_NOZZLE _UxGT("Ugello") #define MSG_BED _UxGT("Piatto") -#define MSG_FAN_SPEED _UxGT("Velocita ventola") -#define MSG_EXTRA_FAN_SPEED _UxGT("Magg vel ventola") +#define MSG_FAN_SPEED _UxGT("Velocità ventola") #define MSG_FLOW _UxGT("Flusso") #define MSG_CONTROL _UxGT("Controllo") #define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") @@ -193,15 +166,9 @@ #define MSG_SELECT _UxGT("Seleziona") #define MSG_ACC _UxGT("Accel") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") #define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VELOCITY _UxGT("Velocità") #define MSG_VMAX _UxGT("Vmax ") @@ -212,15 +179,9 @@ #define MSG_A_RETRACT _UxGT("A-retract") #define MSG_A_TRAVEL _UxGT("A-Spostamento") #define MSG_STEPS_PER_MM _UxGT("Passi/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Apassi/mm") - #define MSG_BSTEPS _UxGT("Bpassi/mm") - #define MSG_CSTEPS _UxGT("Cpassi/mm") -#else - #define MSG_ASTEPS _UxGT("Xpassi/mm") - #define MSG_BSTEPS _UxGT("Ypassi/mm") - #define MSG_CSTEPS _UxGT("Zpassi/mm") -#endif +#define MSG_XSTEPS _UxGT("Xpassi/mm") +#define MSG_YSTEPS _UxGT("Ypassi/mm") +#define MSG_ZSTEPS _UxGT("Zpassi/mm") #define MSG_ESTEPS _UxGT("Epassi/mm") #define MSG_E1STEPS _UxGT("E1passi/mm") #define MSG_E2STEPS _UxGT("E2passi/mm") @@ -232,8 +193,6 @@ #define MSG_FILAMENT _UxGT("Filamento") #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") #define MSG_FILAMENT_DIAM _UxGT("Diam. filo") -#define MSG_FILAMENT_UNLOAD _UxGT("Rimuovi mm") -#define MSG_FILAMENT_LOAD _UxGT("Carica mm") #define MSG_ADVANCE_K _UxGT("K Avanzamento") #define MSG_CONTRAST _UxGT("Contrasto LCD") #define MSG_STORE_EEPROM _UxGT("Salva in memoria") @@ -252,6 +211,7 @@ #define MSG_DWELL _UxGT("Sospensione...") #define MSG_USERWAIT _UxGT("Premi tasto..") #define MSG_PRINT_PAUSED _UxGT("Stampa sospesa") +#define MSG_RESUMING _UxGT("Riprendi Stampa") #define MSG_PRINT_ABORTED _UxGT("Stampa annullata") #define MSG_NO_MOVE _UxGT("Nessun Movimento") #define MSG_KILLED _UxGT("UCCISO. ") @@ -263,16 +223,11 @@ #define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Scamb. UnRet mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") #define MSG_AUTORETRACT _UxGT("AutoRitrai") #define MSG_FILAMENTCHANGE _UxGT("Cambia filamento") -#define MSG_FILAMENTLOAD _UxGT("Carica filamento") -#define MSG_FILAMENTUNLOAD _UxGT("Rimuovi filamento") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Rimuovi tutto") #define MSG_INIT_SDCARD _UxGT("Iniz. SD-Card") #define MSG_CNG_SDCARD _UxGT("Cambia SD-Card") #define MSG_ZPROBE_OUT _UxGT("Z probe out. bed") -#define MSG_SKEW_FACTOR _UxGT("Fattore distorsione") #define MSG_BLTOUCH _UxGT("BLTouch") #define MSG_BLTOUCH_SELFTEST _UxGT("Autotest BLTouch") #define MSG_BLTOUCH_RESET _UxGT("Resetta BLTouch") @@ -286,34 +241,29 @@ #define MSG_BABYSTEP_Z _UxGT("Babystep Z") #define MSG_ENDSTOP_ABORT _UxGT("Finecorsa abort") #define MSG_HEATING_FAILED_LCD _UxGT("Riscald. Fallito") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Risc. piatto fallito") #define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP RIDONDANTI") #define MSG_THERMAL_RUNAWAY _UxGT("TEMP FUORI CONTROLLO") #define MSG_ERR_MAXTEMP _UxGT("Err: TEMP MASSIMA") #define MSG_ERR_MINTEMP _UxGT("Err: TEMP MINIMA") #define MSG_ERR_MAXTEMP_BED _UxGT("Err: TEMP MASSIMA PIATTO") #define MSG_ERR_MINTEMP_BED _UxGT("Err: TEMP MINIMA PIATTO") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z Vietato") #define MSG_HALTED _UxGT("STAMPANTE FERMATA") #define MSG_PLEASE_RESET _UxGT("Riavviare prego") #define MSG_SHORT_DAY _UxGT("g") // One character only #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only -#define MSG_HEATING _UxGT("Riscaldamento...") -#define MSG_COOLING _UxGT("Raffreddamento..") -#define MSG_BED_HEATING _UxGT("Risc. piatto...") -#define MSG_BED_COOLING _UxGT("Raffr. piatto...") +#define MSG_HEATING _UxGT("Riscaldamento..") +#define MSG_HEATING_COMPLETE _UxGT("Risc. completato") +#define MSG_BED_HEATING _UxGT("Risc. Piatto..") +#define MSG_BED_DONE _UxGT("Piatto Pronto") #define MSG_DELTA_CALIBRATE _UxGT("Calibraz. Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Calibra X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibra Y") #define MSG_DELTA_CALIBRATE_Z _UxGT("Calibra Z") #define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibra Center") -#define MSG_DELTA_SETTINGS _UxGT("Impostaz. Delta") #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto calibrazione") #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Imp. altezza Delta") -#define MSG_DELTA_DIAG_ROD _UxGT("Barra Diagonale") -#define MSG_DELTA_HEIGHT _UxGT("Altezza") -#define MSG_DELTA_RADIUS _UxGT("Raggio") #define MSG_INFO_MENU _UxGT("Riguardo stampante") #define MSG_INFO_PRINTER_MENU _UxGT("Info. stampante") #define MSG_3POINT_LEVELING _UxGT("Livel. a 3 punti") @@ -351,16 +301,12 @@ #define MSG_DAC_PERCENT _UxGT("Driver %") #define MSG_DAC_EEPROM_WRITE _UxGT("Scrivi DAC EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("STAMPA IN PAUSA") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("CARICA FILAMENTO") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("RIMUOVI FILAMENTO") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("STAMPA IN PAUSA") #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("OPZIONI:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Libera di piu") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Estrudi ancora") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Riprendi stampa") +#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Temp minima è ") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Ugello: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Home fallito") -#define MSG_ERR_PROBING_FAILED _UxGT("Probing fallito") -#define MSG_M600_TOO_COLD _UxGT("M600:Troppo freddo") #if LCD_HEIGHT >= 4 // Up to 3 lines allowed @@ -380,9 +326,9 @@ #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Attendere") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("il caricamento") #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("del filamento") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Attendere") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("lo spurgo") - #define MSG_FILAMENT_CHANGE_PURGE_3 _UxGT("del filamento") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Attendere") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("l'estrusione") + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 _UxGT("del filamento") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Attendere") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("la ripresa") #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("della stampa") @@ -391,10 +337,9 @@ #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attendere...") #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Espulsione...") #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserisci e premi") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Riscalda ugello") #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Riscaldamento...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Caricamento...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Spurgo filamento") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Estrusione...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Ripresa...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index e75be4c..200aed4 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -34,7 +34,6 @@ // 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 -#define CHARSIZE 2 // 片仮名表示定義 #define WELCOME_MSG MACHINE_NAME " ready." @@ -50,7 +49,6 @@ #define MSG_AUTO_HOME_X "X\xbc\xde\xb8\x20\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7" // "Xジク ゲンテンフッキ" ("Home X") #define MSG_AUTO_HOME_Y "Y\xbc\xde\xb8\x20\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7" // "Yジク ゲンテンフッキ" ("Home Y") #define MSG_AUTO_HOME_Z "Z\xbc\xde\xb8\x20\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7" // "Zジク ゲンテンフッキ" ("Home Z") -#define MSG_TMC_Z_CALIBRATION "Z\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Zジク コウセイ" ("Calibrate Z") #define MSG_LEVEL_BED_HOMING "\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7\xc1\xad\xb3" // "ゲンテンフッキチュウ" ("Homing XYZ") #define MSG_LEVEL_BED_WAITING "\xda\xcd\xde\xd8\xdd\xb8\xde\xb6\xb2\xbc" // "レベリングカイシ" ("Click to Begin") #define MSG_LEVEL_BED_NEXT_POINT "\xc2\xb7\xde\xc9\xbf\xb8\xc3\xb2\xc3\xdd\xcd" // "ツギノソクテイテンヘ" ("Next Point") @@ -107,18 +105,11 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_SELECT "\xbe\xdd\xc0\xb8" // "センタク" ("Select") -#define MSG_JERK "\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // ヤクド mm/s ("Jerk") #if LCD_WIDTH >= 20 #define MSG_ACC "\xb6\xbf\xb8\xc4\xde mm/s2" // "カソクド mm/s2" ("Accel") - #if IS_KINEMATIC - #define MSG_VA_JERK "A\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Aジク ヤクド mm/s" ("Va-jerk") - #define MSG_VB_JERK "B\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Bジク ヤクド mm/s" ("Vb-jerk") - #define MSG_VC_JERK "C\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Cジク ヤクド mm/s" ("Vc-jerk") - #else - #define MSG_VA_JERK "X\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Xジク ヤクド mm/s" ("Vx-jerk") - #define MSG_VB_JERK "Y\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Yジク ヤクド mm/s" ("Vy-jerk") - #define MSG_VC_JERK "Z\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Zジク ヤクド mm/s" ("Vz-jerk") - #endif + #define MSG_VX_JERK "X\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Xジク ヤクド mm/s" ("Vx-jerk") + #define MSG_VY_JERK "Y\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Yジク ヤクド mm/s" ("Vy-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 ") #define MSG_VMIN "\xbb\xb2\xbc\xae\xb3\xb5\xb8\xd8\xbf\xb8\xc4\xde" // "サイショウオクリソクド" ("Vmin") @@ -126,15 +117,9 @@ #define MSG_AMAX "\xbb\xb2\xc0\xde\xb2\xb6\xbf\xb8\xc4\xde " // "サイダイカソクド " ("Amax ") #else #define MSG_ACC "\xb6\xbf\xb8\xc4\xde" // "カソクド" ("Accel") - #if IS_KINEMATIC - #define MSG_VA_JERK "A\x20\xd4\xb8\xc4\xde" // "Aジク ヤクド" ("Va-jerk") - #define MSG_VB_JERK "B\x20\xd4\xb8\xc4\xde" // "Bジク ヤクド" ("Vb-jerk") - #define MSG_VC_JERK "C\x20\xd4\xb8\xc4\xde" // "Cジク ヤクド" ("Vc-jerk") - #else - #define MSG_VA_JERK "X\x20\xd4\xb8\xc4\xde" // "Xジク ヤクド" ("Vx-jerk") - #define MSG_VB_JERK "Y\x20\xd4\xb8\xc4\xde" // "Yジク ヤクド" ("Vy-jerk") - #define MSG_VC_JERK "Z\x20\xd4\xb8\xc4\xde" // "Zジク ヤクド" ("Vz-jerk") - #endif + #define MSG_VX_JERK "X\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "XYジク ヤクド" ("Vx-jerk") + #define MSG_VY_JERK "Y\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "XYジク ヤクド" ("Vy-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 ") #define MSG_VMIN "min\xb5\xb8\xd8\xbf\xb8\xc4\xde" // "minオクリソクド" ("Vmin") @@ -144,39 +129,27 @@ #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") #if LCD_WIDTH >= 20 - #define MSG_STEPS_PER_MM "Steps/mm" - #if IS_KINEMATIC - #define MSG_ASTEPS "Asteps/mm" - #define MSG_BSTEPS "Bsteps/mm" - #define MSG_CSTEPS "Csteps/mm" - #else - #define MSG_ASTEPS "Xsteps/mm" - #define MSG_BSTEPS "Ysteps/mm" - #define MSG_CSTEPS "Zsteps/mm" - #endif - #define MSG_ESTEPS "Esteps/mm" - #define MSG_E1STEPS "E1steps/mm" - #define MSG_E2STEPS "E2steps/mm" - #define MSG_E3STEPS "E3steps/mm" - #define MSG_E4STEPS "E4steps/mm" - #define MSG_E5STEPS "E5steps/mm" + #define MSG_STEPS_PER_MM "Steps/mm" + #define MSG_XSTEPS "Xsteps/mm" + #define MSG_YSTEPS "Ysteps/mm" + #define MSG_ZSTEPS "Zsteps/mm" + #define MSG_ESTEPS "Esteps/mm" + #define MSG_E1STEPS "E1steps/mm" + #define MSG_E2STEPS "E2steps/mm" + #define MSG_E3STEPS "E3steps/mm" + #define MSG_E4STEPS "E4steps/mm" + #define MSG_E5STEPS "E5steps/mm" #else - #define MSG_STEPS_PER_MM "Steps" - #if IS_KINEMATIC - #define MSG_ASTEPS "Asteps" - #define MSG_BSTEPS "Bsteps" - #define MSG_CSTEPS "Csteps" - #else - #define MSG_ASTEPS "Xsteps" - #define MSG_BSTEPS "Ysteps" - #define MSG_CSTEPS "Zsteps" - #endif - #define MSG_ESTEPS "Esteps" - #define MSG_E1STEPS "E1steps" - #define MSG_E2STEPS "E2steps" - #define MSG_E3STEPS "E3steps" - #define MSG_E4STEPS "E4steps" - #define MSG_E5STEPS "E5steps" + #define MSG_STEPS_PER_MM "Steps" + #define MSG_XSTEPS "Xsteps" + #define MSG_YSTEPS "Ysteps" + #define MSG_ZSTEPS "Zsteps" + #define MSG_ESTEPS "Esteps" + #define MSG_E1STEPS "E1steps" + #define MSG_E2STEPS "E2steps" + #define MSG_E3STEPS "E3steps" + #define MSG_E4STEPS "E4steps" + #define MSG_E5STEPS "E5steps" #endif #define MSG_TEMPERATURE "\xb5\xdd\xc4\xde" // "オンド" ("Temperature") #define MSG_MOTION "\xb3\xba\xde\xb7\xbe\xaf\xc3\xb2" // "ウゴキセッテイ" ("Motion") @@ -202,6 +175,7 @@ #define MSG_NO_CARD "SD\xb6\xb0\xc4\xde\xb6\xde\xb1\xd8\xcf\xbe\xdd" // "SDカードガアリマセン" ("No SD card") #define MSG_DWELL "\xb7\xad\xb3\xbc" // "キュウシ" ("Sleep...") #define MSG_USERWAIT "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("Wait for user...") +#define MSG_RESUMING "\xcc\xdf\xd8\xdd\xc4\xbb\xb2\xb6\xb2" // "プリントサイカイ" ("Resuming print") #define MSG_PRINT_ABORTED "\xcc\xdf\xd8\xdd\xc4\xb6\xde\xc1\xad\xb3\xbc\xbb\xda\xcf\xbc\xc0" // "プリントガチュウシサレマシタ" ("Print aborted") #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. ") @@ -272,7 +246,9 @@ #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_BED_HEATING "\xcd\xde\xaf\xc4\xde\x20\xb6\xc8\xc2\xc1\xad\xb3" // "ベッド カネツチュウ" ("Bed 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") @@ -309,7 +285,10 @@ #else #define MSG_DAC_PERCENT "DAC\xbc\xad\xc2\xd8\xae\xb8" // "DACシュツリョク" ("Driver %") #endif -#define MSG_DAC_EEPROM_WRITE MSG_STORE_EEPROM // "メモリヘカクノウ" ("DAC EEPROM Write") +#define MSG_DAC_EEPROM_WRITE MSG_STORE_EPROM // "メモリヘカクノウ" ("DAC EEPROM Write") +#define MSG_FILAMENT_CHANGE_HEADER "PRINT PAUSED" +#define MSG_FILAMENT_CHANGE_OPTION_HEADER "RESUME 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 @@ -322,6 +301,8 @@ #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_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_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_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") #else // LCD_HEIGHT < 4 @@ -334,6 +315,7 @@ #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 diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index 050f327..b07aa40 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -34,7 +34,6 @@ #define MAPPER_E382E383 #define DISPLAY_CHARSET_ISO10646_KANA -#define CHARSIZE 3 // This just to show the potential benefit of unicode. // This translation can be improved by using the full charset of unicode codeblock U+30A0 to U+30FF. @@ -53,7 +52,6 @@ #define MSG_AUTO_HOME_X _UxGT("Xジク ゲンテンフッキ") // "Home X" #define MSG_AUTO_HOME_Y _UxGT("Yジク ゲンテンフッキ") // "Home Y" #define MSG_AUTO_HOME_Z _UxGT("Zジク ゲンテンフッキ") // "Home Z" -#define MSG_TMC_Z_CALIBRATION _UxGT("Zジク コウセイ") // "Calibrate Z" #define MSG_LEVEL_BED_HOMING _UxGT("ゲンテンフッキチュウ") // "Homing XYZ" #define MSG_LEVEL_BED_WAITING _UxGT("レベリングカイシ") // "Click to Begin" #define MSG_LEVEL_BED_NEXT_POINT _UxGT("ツギノソクテイテンヘ") // "Next Point" @@ -79,7 +77,7 @@ #define MSG_MOVE_AXIS _UxGT("ジクイドウ") // "Move axis" #define MSG_BED_LEVELING _UxGT("ベッドレベリング") // "Bed leveling" #define MSG_LEVEL_BED _UxGT("ベッドレベリング") // "Level bed" -#define MSG_MOVING _UxGT("イドウチュウ...") // "Moving..." +#define MSG_MOVING _UxGT("イドウチュウ") // "Moving..." #define MSG_FREE_XY _UxGT("XYジク カイホウ") // "Free XY" #define MSG_MOVE_X _UxGT("Xジク イドウ") // "Move X" #define MSG_MOVE_Y _UxGT("Yジク イドウ") // "Move Y" @@ -108,15 +106,9 @@ #define MSG_SELECT _UxGT("センタク") // "Select" #define MSG_ACC _UxGT("カソクド mm/s2") // "Accel" #define MSG_JERK _UxGT("ヤクド mm/s") // "Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Aジク ヤクド mm/s") // "Va-jerk" - #define MSG_VB_JERK _UxGT("Bジク ヤクド mm/s") // "Vb-jerk" - #define MSG_VC_JERK _UxGT("Cジク ヤクド mm/s") // "Vc-jerk" -#else - #define MSG_VA_JERK _UxGT("Xジク ヤクド mm/s") // "Vx-jerk" - #define MSG_VB_JERK _UxGT("Yジク ヤクド mm/s") // "Vy-jerk" - #define MSG_VC_JERK _UxGT("Zジク ヤクド mm/s") // "Vz-jerk" -#endif +#define MSG_VX_JERK _UxGT("Xジク ヤクド mm/s") // "Vx-jerk" +#define MSG_VY_JERK _UxGT("Yジク ヤクド mm/s") // "Vy-jerk" +#define MSG_VZ_JERK _UxGT("Zジク ヤクド mm/s") // "Vz-jerk" #define MSG_VE_JERK _UxGT("エクストルーダー ヤクド") // "Ve-jerk" #define MSG_VMAX _UxGT("サイダイオクリソクド ") // "Vmax " #define MSG_VMIN _UxGT("サイショウオクリソクド") // "Vmin" @@ -143,8 +135,9 @@ #define MSG_STOP_PRINT _UxGT("プリントテイシ") // "Stop print" #define MSG_CARD_MENU _UxGT("SDカードカラプリント") // "Print from SD" #define MSG_NO_CARD _UxGT("SDカードガアリマセン") // "No SD card" -#define MSG_DWELL _UxGT("キュウシ...") // "Sleep..." -#define MSG_USERWAIT _UxGT("シバラクオマチクダサイ...") // "Wait for user..." +#define MSG_DWELL _UxGT("キュウシ") // "Sleep..." +#define MSG_USERWAIT _UxGT("シバラクオマチクダサイ") // "Wait for user..." +#define MSG_RESUMING _UxGT("プリントサイカイ") // "Resuming print" #define MSG_PRINT_ABORTED _UxGT("プリントガチュウシサレマシタ") // "Print aborted" #define MSG_NO_MOVE _UxGT("ウゴキマセン") // "No move." #define MSG_KILLED _UxGT("ヒジョウテイシ") // "KILLED. " @@ -183,8 +176,10 @@ #define MSG_SHORT_DAY _UxGT("d") // One character only #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only -#define MSG_HEATING _UxGT("カネツチュウ...") // "Heating..." -#define MSG_BED_HEATING _UxGT("ベッド カネツチュウ...") // "Bed Heating..." +#define MSG_HEATING _UxGT("カネツチュウ") // "Heating..." +#define MSG_HEATING_COMPLETE _UxGT("カネツカンリョウ") // "Heating done." +#define MSG_BED_HEATING _UxGT("ベッド カネツチュウ") // "Bed Heating." +#define MSG_BED_DONE _UxGT("ベッド カネツカンリョウ") // "Bed done." #define MSG_DELTA_CALIBRATE _UxGT("デルタ コウセイ") // "Delta Calibration" #define MSG_DELTA_CALIBRATE_X _UxGT("Xジク コウセイ") // "Calibrate X" #define MSG_DELTA_CALIBRATE_Y _UxGT("Yジク コウセイ") // "Calibrate Y" @@ -209,7 +204,10 @@ #define MSG_INFO_PSU _UxGT("デンゲンシュベツ") // "Power Supply" #define MSG_DRIVE_STRENGTH _UxGT("モータークドウリョク") // "Drive Strength" #define MSG_DAC_PERCENT _UxGT("DACシュツリョク %") // "Driver %" -#define MSG_DAC_EEPROM_WRITE MSG_STORE_EEPROM // "DAC EEPROM Write" +#define MSG_DAC_EEPROM_WRITE MSG_STORE_EPROM // "DAC EEPROM Write" +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("サラニオシダス") // "Extrude more" #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("プリントサイカイ") // "Resume print" #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("コウカンヲカイシシマス") // "Wait for start" #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("シバラクオマチクダサイ") // "of the filament" @@ -219,6 +217,8 @@ #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("クリックスルトゾッコウシマス") // "and press button" #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("フィラメントソウテンチュウ") // "Wait for" #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("シバラクオマチクダサイ") // "filament load" +#define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("フィラメントオシダシチュウ") // "Wait for" +#define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("シバラクオマチクダサイ") // "filament extrude" #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("プリントヲサイカイシマス") // "Wait for print" #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("シバラクオマチクダサイ") // "to resume" diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index 128bcea..11f612d 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -47,7 +47,6 @@ #define MSG_AUTO_HOME_X _UxGT("Home X") #define MSG_AUTO_HOME_Y _UxGT("Home Y") #define MSG_AUTO_HOME_Z _UxGT("Home Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibreer Z") #define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Klik voor begin") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Volgende Plaats") @@ -104,15 +103,9 @@ #define MSG_SELECT _UxGT("Selecteer") #define MSG_ACC _UxGT("Versn") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") #define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VMAX _UxGT("Vmax ") #define MSG_VMIN _UxGT("Vmin") @@ -121,15 +114,9 @@ #define MSG_A_RETRACT _UxGT("A-retract") #define MSG_A_TRAVEL _UxGT("A-travel") #define MSG_STEPS_PER_MM _UxGT("Steps/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Asteps/mm") - #define MSG_BSTEPS _UxGT("Bsteps/mm") - #define MSG_CSTEPS _UxGT("Csteps/mm") -#else - #define MSG_ASTEPS _UxGT("Xsteps/mm") - #define MSG_BSTEPS _UxGT("Ysteps/mm") - #define MSG_CSTEPS _UxGT("Zsteps/mm") -#endif +#define MSG_XSTEPS _UxGT("Xsteps/mm") +#define MSG_YSTEPS _UxGT("Ysteps/mm") +#define MSG_ZSTEPS _UxGT("Zsteps/mm") #define MSG_ESTEPS _UxGT("Esteps/mm") #define MSG_E1STEPS _UxGT("E1steps/mm") #define MSG_E2STEPS _UxGT("E2steps/mm") @@ -157,6 +144,7 @@ #define MSG_NO_CARD _UxGT("Geen SD kaart") #define MSG_DWELL _UxGT("Slapen...") #define MSG_USERWAIT _UxGT("Wachten...") +#define MSG_RESUMING _UxGT("Print hervatten") #define MSG_PRINT_ABORTED _UxGT("Print afgebroken") #define MSG_NO_MOVE _UxGT("Geen beweging.") #define MSG_KILLED _UxGT("Afgebroken. ") @@ -189,14 +177,16 @@ #define MSG_ERR_MINTEMP _UxGT("Err: Min. temp") #define MSG_ERR_MAXTEMP_BED _UxGT("Err: Max.tmp bed") #define MSG_ERR_MINTEMP_BED _UxGT("Err: Min.tmp bed") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Fout Z homing") #define MSG_HALTED _UxGT("PRINTER GESTOPT") #define MSG_PLEASE_RESET _UxGT("Reset A.U.B.") #define MSG_SHORT_DAY _UxGT("d") // One character only. Keep English standard #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("Voorwarmen...") -#define MSG_BED_HEATING _UxGT("Bed voorverw...") +#define MSG_HEATING_COMPLETE _UxGT("Voorverw. kompl.") +#define MSG_BED_HEATING _UxGT("Bed voorverw.") +#define MSG_BED_DONE _UxGT("Bed is voorverw.") #define MSG_DELTA_CALIBRATE _UxGT("Delta Calibratie") #define MSG_DELTA_CALIBRATE_X _UxGT("Kalibreer X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibreer Y") @@ -236,7 +226,11 @@ #define MSG_DRIVE_STRENGTH _UxGT("Motorstroom") #define MSG_DAC_PERCENT _UxGT("Driver %") //accepted English term in Dutch #define MSG_DAC_EEPROM_WRITE _UxGT("DAC Opslaan") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extrudeer meer") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Hervat print") +#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Minimum Temp is ") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ") //accepeted English term // // Filament Change screens show up to 3 lines on a 4-line display @@ -260,6 +254,9 @@ #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wacht voor") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament te") #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("laden") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Wacht voor") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("filament te") + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 _UxGT("extruderen") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wacht voor print") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("om verder") #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("te gaan") @@ -276,6 +273,8 @@ #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("en druk knop") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wacht voor") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("inladen...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Wacht voor") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("extrudering") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wacht voor") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("printing...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_pl-DOGM.h b/Marlin/language_pl-DOGM.h index 5839325..e712185 100644 --- a/Marlin/language_pl-DOGM.h +++ b/Marlin/language_pl-DOGM.h @@ -26,7 +26,6 @@ #ifndef LANGUAGE_PL_DOGM_H #define LANGUAGE_PL_DOGM_H -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" gotowy.") #define MSG_SD_INSERTED _UxGT("Karta włożona") @@ -39,7 +38,6 @@ #define MSG_AUTO_HOME_X _UxGT("Zeruj X") #define MSG_AUTO_HOME_Y _UxGT("Zeruj Y") #define MSG_AUTO_HOME_Z _UxGT("Zeruj Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibruj Z") #define MSG_LEVEL_BED _UxGT("Poziom. stołu") #define MSG_LEVEL_BED_HOMING _UxGT("Pozycja zerowa") #define MSG_LEVEL_BED_WAITING _UxGT("Kliknij by rozp.") @@ -93,15 +91,9 @@ #define MSG_SELECT _UxGT("Select") #define MSG_ACC _UxGT("Przyśpieszenie") #define MSG_JERK _UxGT("Zryw") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Zryw Va") - #define MSG_VB_JERK _UxGT("Zryw Vb") - #define MSG_VC_JERK _UxGT("Zryw Vc") -#else - #define MSG_VA_JERK _UxGT("Zryw Vx") - #define MSG_VB_JERK _UxGT("Zryw Vy") - #define MSG_VC_JERK _UxGT("Zryw Vz") -#endif +#define MSG_VX_JERK _UxGT("Zryw Vx") +#define MSG_VY_JERK _UxGT("Zryw Vy") +#define MSG_VZ_JERK _UxGT("Zryw Vz") #define MSG_VE_JERK _UxGT("Zryw Ve") #define MSG_VMAX _UxGT("Vmax ") #define MSG_VMIN _UxGT("Vmin") @@ -111,15 +103,9 @@ #define MSG_A_RETRACT _UxGT("A-wycofanie") #define MSG_A_TRAVEL _UxGT("A-przesuń.") #define MSG_STEPS_PER_MM _UxGT("kroki/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("krokiA/mm") - #define MSG_BSTEPS _UxGT("krokiB/mm") - #define MSG_CSTEPS _UxGT("krokiC/mm") -#else - #define MSG_ASTEPS _UxGT("krokiX/mm") - #define MSG_BSTEPS _UxGT("krokiY/mm") - #define MSG_CSTEPS _UxGT("krokiZ/mm") -#endif +#define MSG_XSTEPS _UxGT("krokiX/mm") +#define MSG_YSTEPS _UxGT("krokiY/mm") +#define MSG_ZSTEPS _UxGT("krokiZ/mm") #define MSG_ESTEPS _UxGT("krokiE/mm") #define MSG_E1STEPS _UxGT("krokiE1/mm") #define MSG_E2STEPS _UxGT("krokiE2/mm") @@ -146,6 +132,7 @@ #define MSG_NO_CARD _UxGT("Brak karty") #define MSG_DWELL _UxGT("Uśpij...") #define MSG_USERWAIT _UxGT("Oczekiwanie...") +#define MSG_RESUMING _UxGT("Wznawianie druku") #define MSG_PRINT_ABORTED _UxGT("Druk przerwany") #define MSG_NO_MOVE _UxGT("Brak ruchu") #define MSG_KILLED _UxGT("Ubity. ") @@ -178,14 +165,16 @@ #define MSG_ERR_MINTEMP _UxGT("Err min temp") #define MSG_ERR_MAXTEMP_BED _UxGT("Err max temp stołu") #define MSG_ERR_MINTEMP_BED _UxGT("Err min temp stołu") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z Forbidden") #define MSG_HALTED _UxGT("Drukarka zatrzym.") #define MSG_PLEASE_RESET _UxGT("Proszę zresetować") #define MSG_SHORT_DAY _UxGT("d") // One character only #define MSG_SHORT_HOUR _UxGT("g") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("Rozgrzewanie...") +#define MSG_HEATING_COMPLETE _UxGT("Rozgrzano") #define MSG_BED_HEATING _UxGT("Rozgrzewanie stołu...") +#define MSG_BED_DONE _UxGT("Rozgrzano stół") #define MSG_DELTA_CALIBRATE _UxGT("Kalibrowanie Delty") #define MSG_DELTA_CALIBRATE_X _UxGT("Kalibruj X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibruj Y") @@ -224,8 +213,9 @@ #define MSG_DAC_PERCENT _UxGT("Siła %") #define MSG_DAC_EEPROM_WRITE _UxGT("Zapisz DAC EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("ZMIEŃ FILAMENT") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("ZMIEŃ FILAMENT") #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ZMIEŃ OPCJE:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Ekstruduj więcej") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Wznów drukowanie") #if LCD_HEIGHT >= 4 @@ -239,6 +229,8 @@ #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("aby kontynuować...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Czekam na") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("włożenie filamentu") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Czekam na") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("ekstruzję filamentu") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Czekam na") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("wznowienie druku") #else // LCD_HEIGHT < 4 @@ -247,6 +239,7 @@ #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wysuwanie...") #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Włóż i naciśnij prz.") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ładowanie...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Ekstruzja...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wznowienie...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_pl-HD44780.h b/Marlin/language_pl-HD44780.h index 933b5b9..d14cf9d 100644 --- a/Marlin/language_pl-HD44780.h +++ b/Marlin/language_pl-HD44780.h @@ -40,7 +40,6 @@ #define MSG_AUTO_HOME_X _UxGT("Zeruj X") #define MSG_AUTO_HOME_Y _UxGT("Zeruj Y") #define MSG_AUTO_HOME_Z _UxGT("Zeruj Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibruj Z") #define MSG_LEVEL_BED _UxGT("Poziom. stolu") #define MSG_LEVEL_BED_HOMING _UxGT("Pozycja zerowa") #define MSG_LEVEL_BED_WAITING _UxGT("Kliknij by rozp.") @@ -94,15 +93,9 @@ #define MSG_SELECT _UxGT("Select") #define MSG_ACC _UxGT("Przyspieszenie") #define MSG_JERK _UxGT("Zryw") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Zryw Va") - #define MSG_VB_JERK _UxGT("Zryw Vb") - #define MSG_VC_JERK _UxGT("Zryw Vc") -#else - #define MSG_VA_JERK _UxGT("Zryw Vx") - #define MSG_VB_JERK _UxGT("Zryw Vy") - #define MSG_VC_JERK _UxGT("Zryw Vz") -#endif +#define MSG_VX_JERK _UxGT("Zryw Vx") +#define MSG_VY_JERK _UxGT("Zryw Vy") +#define MSG_VZ_JERK _UxGT("Zryw Vz") #define MSG_VE_JERK _UxGT("Zryw Ve") #define MSG_VMAX _UxGT("Vmax ") #define MSG_VMIN _UxGT("Vmin") @@ -112,15 +105,9 @@ #define MSG_A_RETRACT _UxGT("A-wycofanie") #define MSG_A_TRAVEL _UxGT("A-przesun.") #define MSG_STEPS_PER_MM _UxGT("kroki/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("krokiA/mm") - #define MSG_BSTEPS _UxGT("krokiB/mm") - #define MSG_CSTEPS _UxGT("krokiC/mm") -#else - #define MSG_ASTEPS _UxGT("krokiX/mm") - #define MSG_BSTEPS _UxGT("krokiY/mm") - #define MSG_CSTEPS _UxGT("krokiZ/mm") -#endif +#define MSG_XSTEPS _UxGT("krokiX/mm") +#define MSG_YSTEPS _UxGT("krokiY/mm") +#define MSG_ZSTEPS _UxGT("krokiZ/mm") #define MSG_ESTEPS _UxGT("krokiE/mm") #define MSG_E1STEPS _UxGT("krokiE1/mm") #define MSG_E2STEPS _UxGT("krokiE2/mm") @@ -147,6 +134,7 @@ #define MSG_NO_CARD _UxGT("Brak karty") #define MSG_DWELL _UxGT("Uspij...") #define MSG_USERWAIT _UxGT("Oczekiwanie...") +#define MSG_RESUMING _UxGT("Wznawianie druku") #define MSG_PRINT_ABORTED _UxGT("Druk przerwany") #define MSG_NO_MOVE _UxGT("Brak ruchu") #define MSG_KILLED _UxGT("Ubity. ") @@ -179,14 +167,16 @@ #define MSG_ERR_MINTEMP _UxGT("Err min temp") #define MSG_ERR_MAXTEMP_BED _UxGT("Err max temp stolu") #define MSG_ERR_MINTEMP_BED _UxGT("Err min temp stolu") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z Forbidden") #define MSG_HALTED _UxGT("Drukarka zatrzym.") #define MSG_PLEASE_RESET _UxGT("Prosze zresetowac") #define MSG_SHORT_DAY _UxGT("d") // One character only #define MSG_SHORT_HOUR _UxGT("g") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("Rozgrzewanie...") +#define MSG_HEATING_COMPLETE _UxGT("Rozgrzano") #define MSG_BED_HEATING _UxGT("Rozgrzewanie stolu...") +#define MSG_BED_DONE _UxGT("Rozgrzano stol") #define MSG_DELTA_CALIBRATE _UxGT("Kalibrowanie Delty") #define MSG_DELTA_CALIBRATE_X _UxGT("Kalibruj X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibruj Y") @@ -225,8 +215,9 @@ #define MSG_DAC_PERCENT _UxGT("Sila %") #define MSG_DAC_EEPROM_WRITE _UxGT("Zapisz DAC EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("ZMIEN FILAMENT") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("ZMIEN FILAMENT") #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ZMIEN OPCJE:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Ekstruduj wiecej") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Wznow drukowanie") #if LCD_HEIGHT >= 4 @@ -240,6 +231,8 @@ #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("aby kontynuowac...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Czekam na") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("wlozenie filamentu") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Czekam na") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("ekstruzje filamentu") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Czekam na") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("wznowienie druku") #else // LCD_HEIGHT < 4 @@ -248,6 +241,7 @@ #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wysuwanie...") #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Wloz i nacisnij prz.") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ladowanie...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Ekstruzja...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wznowienie...") #endif // LCD_HEIGHT < 4 @@ -262,6 +256,8 @@ #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("aby kontynuowac...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Czekam na") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("wlozenie filamentu") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Czekam na") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("ekstruzje filamentu") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Czekam na") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("wznowienie druku") #else // LCD_HEIGHT < 4 @@ -270,6 +266,7 @@ #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wysuwanie...") #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Wloz i nacisnij prz.") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ladowanie...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Ekstruzja...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wznowienie...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index 303ea1a..5ba2956 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -33,350 +33,140 @@ #define DISPLAY_CHARSET_ISO10646_1 #define NOT_EXTENDED_ISO10646_1_5X7 -#define WELCOME_MSG MACHINE_NAME _UxGT(" pronto.") - -#define MSG_BACK _UxGT("Voltar") -#define MSG_SD_INSERTED _UxGT("Cartao inserido") -#define MSG_SD_REMOVED _UxGT("Cartao removido") -#define MSG_LCD_ENDSTOPS _UxGT("Finais") -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Desabi. motores") -#define MSG_DEBUG_MENU _UxGT("Menu Debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Testar Barra de Prog")//resso -#define MSG_AUTO_HOME_X _UxGT("Ir na origem X") -#define MSG_AUTO_HOME_Y _UxGT("Ir na origem Y") -#define MSG_AUTO_HOME_Z _UxGT("Ir na origem Z") -#define MSG_AUTO_HOME _UxGT("Ir na origem XYZ") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Indo para origem") -#define MSG_LEVEL_BED_WAITING _UxGT("Clique para Iniciar") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Proximo Ponto") -#define MSG_LEVEL_BED_DONE _UxGT("Fim da nivelacao!") -#define MSG_Z_FADE_HEIGHT _UxGT("Suavizar altura") -#define MSG_SET_HOME_OFFSETS _UxGT("Compensar origem") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Alteracao feita") -#define MSG_SET_ORIGIN _UxGT("Ajustar Origem") -#define MSG_PREHEAT_1 _UxGT("Pre-aquecer PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL _UxGT("Pre-aq.Todo PLA") -#define MSG_PREHEAT_1_END _UxGT("Pre-aq.Extrusora") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq.Mesa PLA") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Ajustar PLA") -#define MSG_PREHEAT_2 _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_N _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_ALL _UxGT("Pre-aq.Todo ABS") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq.Mesa ABS") -#define MSG_PREHEAT_2_END _UxGT("Pre-aq.Extrusora") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Ajustar ABS") -#define MSG_COOLDOWN _UxGT("Esfriar") -#define MSG_SWITCH_PS_ON _UxGT("Ligar") -#define MSG_SWITCH_PS_OFF _UxGT("Desligar") -#define MSG_EXTRUDE _UxGT("Extrusar") -#define MSG_RETRACT _UxGT("Retrair") -#define MSG_MOVE_AXIS _UxGT("Mover eixo") -#define MSG_BED_LEVELING _UxGT("Nivelacao Mesa") -#define MSG_LEVEL_BED _UxGT("Nivelar Mesa") -#define MSG_LEVEL_CORNERS _UxGT("Nivelar Cantos") -#define MSG_NEXT_CORNER _UxGT("Proximo Canto") -#define MSG_EDITING_STOPPED _UxGT("Fim da Edicao") - -#define MSG_USER_MENU _UxGT("Comando customizado") -#define MSG_UBL_DOING_G29 _UxGT("Executando G29") -#define MSG_UBL_UNHOMED _UxGT("Fora da Origam") -#define MSG_UBL_TOOLS _UxGT("Ferramentas UBL") -#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#define MSG_UBL_MANUAL_MESH _UxGT("Fazer malha manual") -#define MSG_UBL_BC_INSERT _UxGT("Calcar e calibrar") -#define MSG_UBL_BC_INSERT2 _UxGT("Medir") -#define MSG_UBL_BC_REMOVE _UxGT("Remover e calibrar") - -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Indo para o Proximo") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Ativar UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Desativar UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Temp. Mesa") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temp. Extrusora") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Editar Malha") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editar Malha Custom") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Ajuste Fino da Malha") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Fim da Edicao") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Montar Customi") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Montar ") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Montar PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Montar ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Montar fria") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajustar Altura") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Tamanho da Elevacao") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validar Malha") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Checar PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Checar ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validar Malha Custom") -#define MSG_UBL_CONTINUE_MESH _UxGT("Continuar Malha") -#define MSG_UBL_MESH_LEVELING _UxGT("Nivelacao da Malha") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Nivelacao 3 pontos") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Nivelacao Grid") -#define MSG_UBL_MESH_LEVEL _UxGT("Nivelar Malha") -#define MSG_UBL_SIDE_POINTS _UxGT("Cantos") -#define MSG_UBL_MAP_TYPE _UxGT("Tipo de Mapa") -#define MSG_UBL_OUTPUT_MAP _UxGT("Salvar Mapa da Malha") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Enviar Para Host") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Salvar Malha CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Salvar Backup") -#define MSG_UBL_INFO_UBL _UxGT("Informacao do UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Editar Malha") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Qtd de Enchimento") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Enchimento Manual") -#define MSG_UBL_SMART_FILLIN _UxGT("Enchimento Smart") -#define MSG_UBL_FILLIN_MESH _UxGT("Preencher malha") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Invalidar tudo") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalidar proximo") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Ajuste Fino de Todos") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Ajuar Mais Proximo") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Armazenamento Malha") -#define MSG_UBL_STORAGE_SLOT _UxGT("Slot de Memoria") -#define MSG_UBL_LOAD_MESH _UxGT("Ler Malha") -#define MSG_UBL_SAVE_MESH _UxGT("Salvar Malha") -#define MSG_MESH_LOADED _UxGT("Malha %i carregada") -#define MSG_MESH_SAVED _UxGT("Malha %i salva") -#define MSG_NO_STORAGE _UxGT("Sem armazenamento") -#define MSG_UBL_SAVE_ERROR _UxGT("Erro ao salvar UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Erro no restauro UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Compensacao Z parou") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo a passo") -#define MSG_LED_CONTROL _UxGT("Controle do LED") -#define MSG_LEDS _UxGT("Luz") -#define MSG_LED_PRESETS _UxGT("Configuracao da Luz") -#define MSG_SET_LEDS_RED _UxGT("Luz Vermelha") -#define MSG_SET_LEDS_ORANGE _UxGT("Luz Laranja") -#define MSG_SET_LEDS_YELLOW _UxGT("Luz Amarela") -#define MSG_SET_LEDS_GREEN _UxGT("Luz Verde") -#define MSG_SET_LEDS_BLUE _UxGT("Luz Azul") -#define MSG_SET_LEDS_INDIGO _UxGT("Luz Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Luz Violeta") -#define MSG_SET_LEDS_WHITE _UxGT("Luz Branca") -#define MSG_SET_LEDS_DEFAULT _UxGT("Luz Padrao") -#define MSG_CUSTOM_LEDS _UxGT("Luz Customizada") -#define MSG_INTENSITY_R _UxGT("Intensidade Vermelho") -#define MSG_INTENSITY_G _UxGT("Intensidade Verde") -#define MSG_INTENSITY_B _UxGT("Intensidade Azul") -#define MSG_INTENSITY_W _UxGT("Intensidade Branco") -#define MSG_LED_BRIGHTNESS _UxGT("Brilho") - -#define MSG_MOVING _UxGT("Movendo...") -#define MSG_FREE_XY _UxGT("Liberar XY") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Mover Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidade") -#define MSG_BED_Z _UxGT("Base Z") -#define MSG_NOZZLE _UxGT("Bocal") -#define MSG_BED _UxGT("Mesa") -#define MSG_FAN_SPEED _UxGT("Vel. Ventoinha") -#define MSG_FLOW _UxGT("Vazao") -#define MSG_CONTROL _UxGT("Controle") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fator") -#define MSG_AUTOTEMP _UxGT("Temp. Automatica") -#define MSG_ON _UxGT("Ligado ") -#define MSG_OFF _UxGT("Desligado") -#define MSG_PID_P _UxGT("PID-P") -#define MSG_PID_I _UxGT("PID-I") -#define MSG_PID_D _UxGT("PID-D") -#define MSG_PID_C _UxGT("PID-C") -#define MSG_SELECT _UxGT("Selecionar") -#define MSG_ACC _UxGT("Acel.") -#define MSG_JERK _UxGT("Jogo") -#if IS_SCARA - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VZ") -#elif IS_DELTA - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VC") -#else - #define MSG_VA_JERK _UxGT("jogo VX") - #define MSG_VB_JERK _UxGT("jogo VY") - #define MSG_VC_JERK _UxGT("jogo VZ") -#endif -#define MSG_VE_JERK _UxGT("jogo VE") -#define MSG_VELOCITY _UxGT("Velocidade") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VDeslocamento min") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("Retrair A") -#define MSG_A_TRAVEL _UxGT("Movimento A") -#define MSG_STEPS_PER_MM _UxGT("Passo/mm") -#if IS_SCARA - #define MSG_ASTEPS _UxGT("Passo A/deg") - #define MSG_BSTEPS _UxGT("Passo B/deg") - #define MSG_CSTEPS _UxGT("Passo Z/mm") -#elif IS_DELTA - #define MSG_ASTEPS _UxGT("Passo A/mm") - #define MSG_BSTEPS _UxGT("Passo B/mm") - #define MSG_CSTEPS _UxGT("Passo C/mm") -#else - #define MSG_ASTEPS _UxGT("Passo X/mm") - #define MSG_BSTEPS _UxGT("Passo Y/mm") - #define MSG_CSTEPS _UxGT("Passo Z/mm") -#endif -#define MSG_ESTEPS _UxGT("E/mm") -#define MSG_E1STEPS _UxGT("E1/mm") -#define MSG_E2STEPS _UxGT("E2/mm") -#define MSG_E3STEPS _UxGT("E3/mm") -#define MSG_E4STEPS _UxGT("E4/mm") -#define MSG_E5STEPS _UxGT("E5/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movimento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("Extrusao em mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diâmetro Fil.") -#define MSG_ADVANCE_K _UxGT("Avancar K") -#define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Salvar Configuracao") -#define MSG_LOAD_EEPROM _UxGT("Ler Configuracao") -#define MSG_RESTORE_FAILSAFE _UxGT("Restauro seguro") -#define MSG_INIT_EEPROM _UxGT("Iniciar EEPROM") -#define MSG_REFRESH LCD_STR_REFRESH _UxGT(" Atualizacao") -#define MSG_WATCH _UxGT("Informacoes") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Ajustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impressao") -#define MSG_RESUME_PRINT _UxGT("Resumir impressao") -#define MSG_STOP_PRINT _UxGT("Parar impressao") -#define MSG_CARD_MENU _UxGT("Imprimir do SD") -#define MSG_NO_CARD _UxGT("Sem cartao SD") -#define MSG_DWELL _UxGT("ZzZzZz...") -#define MSG_USERWAIT _UxGT("Clique para retomar") -#define MSG_PRINT_ABORTED _UxGT("Impressao Abortada") -#define MSG_NO_MOVE _UxGT("Sem movimento") -#define MSG_KILLED _UxGT("PARADA DE EMERGENCIA") -#define MSG_STOPPED _UxGT("PAROU. ") -#define MSG_CONTROL_RETRACT _UxGT("Retrair mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Retrair Troca mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retrair V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saltar mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Des-Retrair mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Des-RetTroca mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Des-Retrair V") -#define MSG_AUTORETRACT _UxGT("Retracao Automatica") -#define MSG_FILAMENTCHANGE _UxGT("Trocar Filamento") -#define MSG_INIT_SDCARD _UxGT("Iniciar SD") -#define MSG_CNG_SDCARD _UxGT("Trocar SD") -#define MSG_ZPROBE_OUT _UxGT("Sonda fora da mesa") -#define MSG_SKEW_FACTOR _UxGT("Fator de Cisalho") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Testar BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("Reiniciar BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Implantar BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Condicionar BLTouch") - -#define MSG_HOME _UxGT("Home") -#define MSG_FIRST _UxGT("Primeiro") -#define MSG_ZPROBE_ZOFFSET _UxGT("Compensar Sonda em Z") -#define MSG_BABYSTEP_X _UxGT("Passinho X") -#define MSG_BABYSTEP_Y _UxGT("Passinho Y") -#define MSG_BABYSTEP_Z _UxGT("Passinho Z") -#define MSG_ENDSTOP_ABORT _UxGT("Fim de Curso") -#define MSG_HEATING_FAILED_LCD _UxGT("Aquecimento falhou") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Erro:Temp Redundante") -#define MSG_THERMAL_RUNAWAY _UxGT("ESCAPE TERMICO") -#define MSG_ERR_MAXTEMP _UxGT("Erro:Temp Maxima") -#define MSG_ERR_MINTEMP _UxGT("Erro:Temp Minima") -#define MSG_ERR_MAXTEMP_BED _UxGT("Erro:Temp Mesa Max") -#define MSG_ERR_MINTEMP_BED _UxGT("Erro:Temp Mesa Min") -#define MSG_HEATING _UxGT("Aquecendo...") -#define MSG_BED_HEATING _UxGT("Aquecendo base...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibrar Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Calibrar X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrar Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Calibrar Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrar Centro") - -#define MSG_DELTA_SETTINGS _UxGT("Configuracao Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto-Calibracao") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Calibrar Altura") -#define MSG_DELTA_DIAG_ROD _UxGT("Haste Diagonal") -#define MSG_DELTA_HEIGHT _UxGT("Altura") -#define MSG_DELTA_RADIUS _UxGT("Raio") -#define MSG_INFO_MENU _UxGT("Sobre") -#define MSG_INFO_PRINTER_MENU _UxGT("Impressora") -#define MSG_3POINT_LEVELING _UxGT("Nivelamento 3 pontos") -#define MSG_LINEAR_LEVELING _UxGT("Nivelamento Linear") -#define MSG_BILINEAR_LEVELING _UxGT("Nivelamento Bilinear") -#define MSG_UBL_LEVELING _UxGT("Nivelamento UBL") -#define MSG_MESH_LEVELING _UxGT("Nivelamento da Malha") -#define MSG_INFO_STATS_MENU _UxGT("Estatisticas") -#define MSG_INFO_BOARD_MENU _UxGT("Info. da Placa") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusoras") -#define MSG_INFO_BAUDRATE _UxGT("Frequencia Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocolo") -#define MSG_CASE_LIGHT _UxGT("Luz da Estrutura") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Intensidade Brilho") -#define MSG_INFO_PRINT_COUNT _UxGT("Qtd Impressoes") -#define MSG_INFO_COMPLETED_PRINTS _UxGT("Completas") -#define MSG_INFO_PRINT_TIME _UxGT("Tempo de Imprimindo") -#define MSG_INFO_PRINT_LONGEST _UxGT("Impressao Mais Longa") -#define MSG_INFO_PRINT_FILAMENT _UxGT("Depositado") -#define MSG_INFO_MIN_TEMP _UxGT("Temp Min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp Max") -#define MSG_INFO_PSU _UxGT("PSU") -#define MSG_DRIVE_STRENGTH _UxGT("Forca do Motor") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escrever Eeprom DAC") - -#define MSG_FILAMENT_CHANGE_HEADER _UxGT("Troca de Filamento") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Config. de Retomada") -#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extrusar Mais") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Continuar Impressao") -#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Temp. Minima eh ") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Bocal: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Falha ao ir a origem") -#define MSG_ERR_PROBING_FAILED _UxGT("Falha ao sondar") - -#if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando o") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("inicio da") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("troca de Filamento") - - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("remocao de filamento") - - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Coloque Filamento") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("pressione o botao") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("para continuar...") - - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Pressione o botao") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("p/ Aquecer o Bocal") - - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo o Bocal") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Aguarde...") - - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filamento") - - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Esperando extrusao") - #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("de filamento") - - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Esperando impressao") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("continuar") -#else LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Aguarde...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejetando...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insira e Clique") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Carregando...") - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extrusando...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Continuando...") -#endif +#define WELCOME_MSG MACHINE_NAME " pronto." +#define MSG_SD_INSERTED "Cartao inserido" +#define MSG_SD_REMOVED "Cartao removido" +#define MSG_MAIN "Menu principal" +#define MSG_AUTOSTART "Autostart" +#define MSG_DISABLE_STEPPERS "Desabi. motores" +#define MSG_AUTO_HOME "Ir para origen" +#define MSG_LEVEL_BED_HOMING "Homing XYZ" +#define MSG_LEVEL_BED_WAITING "Click to Begin" +#define MSG_LEVEL_BED_DONE "Leveling Done!" +#define MSG_SET_HOME_OFFSETS "Ajustar Jogo" +#define MSG_HOME_OFFSETS_APPLIED "Offsets applied" +#define MSG_SET_ORIGIN "Ajustar orig." +#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" +#define MSG_EXTRUDE "Extrudar" +#define MSG_RETRACT "Retrair" +#define MSG_MOVE_AXIS "Mover eixo" +#define MSG_MOVE_X "Mover X" +#define MSG_MOVE_Y "Mover Y" +#define MSG_MOVE_Z "Mover Z" +#define MSG_MOVE_E "Mover Extrusor" +#define MSG_MOVE_01MM "Mover 0.1mm" +#define MSG_MOVE_1MM "Mover 1mm" +#define MSG_MOVE_10MM "Mover 10mm" +#define MSG_SPEED "Velocidade" +#define MSG_BED_Z "Base Z" +#define MSG_NOZZLE LCD_STR_THERMOMETER " Bocal" +#define MSG_BED LCD_STR_THERMOMETER " Base" +#define MSG_FAN_SPEED "Vel. Ventoinha" +#define MSG_FLOW "Fluxo" +#define MSG_CONTROL "Controle" +#define MSG_MIN LCD_STR_THERMOMETER " Min" +#define MSG_MAX LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" +#define MSG_AUTOTEMP "Temp. Automatica" +#define MSG_ON "Ligado " +#define MSG_OFF "Desligado" +#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_ACC "Acc" +#define MSG_JERK "Jogo" +#define MSG_VX_JERK "jogo VX" +#define MSG_VY_JERK "jogo VY" +#define MSG_VZ_JERK "jogo VZ" +#define MSG_VE_JERK "jogo VE" +#define MSG_VMAX " Vmax " +#define MSG_VMIN "Vmin" +#define MSG_VTRAV_MIN "VTrav min" +#define MSG_AMAX "Amax " +#define MSG_A_RETRACT "Retrair A" +#define MSG_A_TRAVEL "A-movimento" +#define MSG_STEPS_PER_MM "Passo/mm" +#define MSG_XSTEPS "Passo X/mm" +#define MSG_YSTEPS "Passo Y/mm" +#define MSG_ZSTEPS "Passo Z/mm" +#define MSG_ESTEPS "E/mm" +#define MSG_E1STEPS "E1/mm" +#define MSG_E2STEPS "E2/mm" +#define MSG_E3STEPS "E3/mm" +#define MSG_E4STEPS "E4/mm" +#define MSG_E5STEPS "E5/mm" +#define MSG_TEMPERATURE "Temperatura" +#define MSG_MOTION "Movimento" +#define MSG_FILAMENT "Filamento" +#define MSG_VOLUMETRIC_ENABLED "Extr. em mm3" +#define MSG_FILAMENT_DIAM "Diametro Fil." +#define MSG_CONTRAST "Contraste" +#define MSG_STORE_EEPROM "Salvar" +#define MSG_LOAD_EEPROM "Ler" +#define MSG_RESTORE_FAILSAFE "Rest. de emerg." +#define MSG_REFRESH LCD_STR_REFRESH " Restaurar" +#define MSG_WATCH "Monitorar" +#define MSG_PREPARE "Preparar" +#define MSG_TUNE "Afinar" +#define MSG_PAUSE_PRINT "Pausar impressao" +#define MSG_RESUME_PRINT "Resumir impressao" +#define MSG_STOP_PRINT "Parar impressao" +#define MSG_CARD_MENU "Imprimir do SD" +#define MSG_NO_CARD "Sem cartao SD" +#define MSG_DWELL "Repouso..." +#define MSG_USERWAIT "Esperando ordem" +#define MSG_RESUMING "Resumindo Impres." +#define MSG_PRINT_ABORTED "Impres. Abortada." +#define MSG_NO_MOVE "Sem movimento" +#define MSG_KILLED "PARADA DE EMERG." +#define MSG_STOPPED "PARADA. " +#define MSG_CONTROL_RETRACT "Retrair mm" +#define MSG_CONTROL_RETRACT_SWAP "Retrair Troca mm" +#define MSG_CONTROL_RETRACTF "Retrair V" +#define MSG_CONTROL_RETRACT_ZLIFT "Levantar mm" +#define MSG_CONTROL_RETRACT_RECOVER "Des Retrair mm" +#define MSG_CONTROL_RETRACT_RECOVER_SWAP "Des RetTroca mm" +#define MSG_CONTROL_RETRACT_RECOVERF "Des Retrair V" +#define MSG_AUTORETRACT "Retracao Autom." +#define MSG_FILAMENTCHANGE "Trocar Filamento" +#define MSG_INIT_SDCARD "Iniciar SD" +#define MSG_CNG_SDCARD "Trocar SD" +#define MSG_ZPROBE_OUT "Son. fora da mesa" +#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" +#define MSG_BABYSTEP_Z "Passinho Z" +#define MSG_ENDSTOP_ABORT "Fim de Curso" +#define MSG_HEATING_FAILED_LCD "Aquecimento falhou" +#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP" +#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY" +#define MSG_ERR_MAXTEMP "Err: T Maxima" +#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_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" +#define MSG_DELTA_CALIBRATE_Z "Calibrar Z" +#define MSG_DELTA_CALIBRATE_CENTER "Calibrar Centro" #endif // LANGUAGE_PT_BR_H diff --git a/Marlin/language_pt-br_utf8.h b/Marlin/language_pt-br_utf8.h index 880b396..9c4c9d7 100644 --- a/Marlin/language_pt-br_utf8.h +++ b/Marlin/language_pt-br_utf8.h @@ -31,143 +31,37 @@ #ifndef LANGUAGE_PT_BR_UTF_H #define LANGUAGE_PT_BR_UTF_H -#define MAPPER_C2C3 #define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" pronto.") - -#define MSG_BACK _UxGT("Voltar") #define MSG_SD_INSERTED _UxGT("Cartão inserido") #define MSG_SD_REMOVED _UxGT("Cartão removido") -#define MSG_LCD_ENDSTOPS _UxGT("Finais") #define MSG_MAIN _UxGT("Menu principal") #define MSG_AUTOSTART _UxGT("Autostart") #define MSG_DISABLE_STEPPERS _UxGT("Desabi. motores") -#define MSG_DEBUG_MENU _UxGT("Menu Debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Testar Barra de Prog")//resso -#define MSG_AUTO_HOME_X _UxGT("Ir na origem X") -#define MSG_AUTO_HOME_Y _UxGT("Ir na origem Y") -#define MSG_AUTO_HOME_Z _UxGT("Ir na origem Z") -#define MSG_AUTO_HOME _UxGT("Ir na origem XYZ") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") +#define MSG_AUTO_HOME _UxGT("Ir para origen") #define MSG_LEVEL_BED_HOMING _UxGT("Indo para origem") -#define MSG_LEVEL_BED_WAITING _UxGT("Clique para Iniciar") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Próximo Ponto") -#define MSG_LEVEL_BED_DONE _UxGT("Fim nivelação!") -#define MSG_Z_FADE_HEIGHT _UxGT("Suavizar altura") -#define MSG_SET_HOME_OFFSETS _UxGT("Compensar origem") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Alteração feita") -#define MSG_SET_ORIGIN _UxGT("Ajustar Origem") +#define MSG_LEVEL_BED_WAITING _UxGT("Click to Begin") +#define MSG_LEVEL_BED_DONE _UxGT("Leveling Done!") +#define MSG_SET_HOME_OFFSETS _UxGT("Ajustar Jogo") +#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets applied") +#define MSG_SET_ORIGIN _UxGT("Ajustar orig.") #define MSG_PREHEAT_1 _UxGT("Pre-aquecer PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") +#define MSG_PREHEAT_1_N _UxGT("Pre-aquecer PLA") #define MSG_PREHEAT_1_ALL _UxGT("Pre-aq.Todo PLA") -#define MSG_PREHEAT_1_END _UxGT("Pre-aq.Extrusora") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq.Mesa PLA") +#define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq. PLA ") LCD_STR_THERMOMETER _UxGT("Base") #define MSG_PREHEAT_1_SETTINGS _UxGT("Ajustar PLA") #define MSG_PREHEAT_2 _UxGT("Pre-aquecer ABS") #define MSG_PREHEAT_2_N _UxGT("Pre-aquecer ABS") #define MSG_PREHEAT_2_ALL _UxGT("Pre-aq.Todo ABS") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq.Mesa ABS") -#define MSG_PREHEAT_2_END _UxGT("Pre-aq.Extrusora") +#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq. ABS ") LCD_STR_THERMOMETER _UxGT("Base") #define MSG_PREHEAT_2_SETTINGS _UxGT("Ajustar ABS") #define MSG_COOLDOWN _UxGT("Esfriar") #define MSG_SWITCH_PS_ON _UxGT("Ligar") #define MSG_SWITCH_PS_OFF _UxGT("Desligar") -#define MSG_EXTRUDE _UxGT("Extrusar") +#define MSG_EXTRUDE _UxGT("Extrudar") #define MSG_RETRACT _UxGT("Retrair") #define MSG_MOVE_AXIS _UxGT("Mover eixo") -#define MSG_BED_LEVELING _UxGT("Nivelação Mesa") -#define MSG_LEVEL_BED _UxGT("Nivelar Mesa") -#define MSG_LEVEL_CORNERS _UxGT("Nivelar Cantos") -#define MSG_NEXT_CORNER _UxGT("Próximo Canto") -#define MSG_EDITING_STOPPED _UxGT("Fim da Edição") - -#define MSG_USER_MENU _UxGT("Comando customizado") -#define MSG_UBL_DOING_G29 _UxGT("Executando G29") -#define MSG_UBL_UNHOMED _UxGT("Fora da Origam") -#define MSG_UBL_TOOLS _UxGT("Ferramentas UBL") -#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#define MSG_UBL_MANUAL_MESH _UxGT("Fazer malha manual") -#define MSG_UBL_BC_INSERT _UxGT("Calçar e calibrar") -#define MSG_UBL_BC_INSERT2 _UxGT("Medir") -#define MSG_UBL_BC_REMOVE _UxGT("Remover e calibrar") - -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Indo para o Próximo") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Ativar UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Desativar UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Temp. Mesa") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temp. Extrusora") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Editar Malha") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editar Malha Custom") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Ajuste Fino da Malha") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Fim da Edição") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Montar Customi") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Montar ") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Montar PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Montar ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Montar fria") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajustar Altura") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Tamanho da Elevação") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validar Malha") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Checar PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Checar ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validar Malha Custom") -#define MSG_UBL_CONTINUE_MESH _UxGT("Continuar Malha") -#define MSG_UBL_MESH_LEVELING _UxGT("Nivelação da Malha") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Nivelação 3 pontos") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Nivelação Grid") -#define MSG_UBL_MESH_LEVEL _UxGT("Nivelar Malha") -#define MSG_UBL_SIDE_POINTS _UxGT("Cantos") -#define MSG_UBL_MAP_TYPE _UxGT("Tipo de Mapa") -#define MSG_UBL_OUTPUT_MAP _UxGT("Salvar Mapa da Malha") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Enviar Para Host") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Salvar Malha CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Salvar Backup") -#define MSG_UBL_INFO_UBL _UxGT("Informação do UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Editar Malha") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Qtd de Enchimento") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Enchimento Manual") -#define MSG_UBL_SMART_FILLIN _UxGT("Enchimento Smart") -#define MSG_UBL_FILLIN_MESH _UxGT("Preencher malha") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Invalidar tudo") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalidar próximo") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Ajuste Fino de Todos") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Ajuar Mais Próximo") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Armazenamento Malha") -#define MSG_UBL_STORAGE_SLOT _UxGT("Slot de Memória") -#define MSG_UBL_LOAD_MESH _UxGT("Ler Malha") -#define MSG_UBL_SAVE_MESH _UxGT("Salvar Malha") -#define MSG_MESH_LOADED _UxGT("Malha %i carregada") -#define MSG_MESH_SAVED _UxGT("Malha %i salva") -#define MSG_NO_STORAGE _UxGT("Sem armazenamento") -#define MSG_UBL_SAVE_ERROR _UxGT("Erro ao salvar UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Erro no restauro UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Compensação Z parou") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo a passo") -#define MSG_LED_CONTROL _UxGT("Controle do LED") -#define MSG_LEDS _UxGT("Luz") -#define MSG_LED_PRESETS _UxGT("Configuração da Luz") -#define MSG_SET_LEDS_RED _UxGT("Luz Vermelha") -#define MSG_SET_LEDS_ORANGE _UxGT("Luz Laranja") -#define MSG_SET_LEDS_YELLOW _UxGT("Luz Amarela") -#define MSG_SET_LEDS_GREEN _UxGT("Luz Verde") -#define MSG_SET_LEDS_BLUE _UxGT("Luz Azul") -#define MSG_SET_LEDS_INDIGO _UxGT("Luz Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Luz Violeta") -#define MSG_SET_LEDS_WHITE _UxGT("Luz Branca") -#define MSG_SET_LEDS_DEFAULT _UxGT("Luz Padrão") -#define MSG_CUSTOM_LEDS _UxGT("Luz Customizada") -#define MSG_INTENSITY_R _UxGT("Intensidade Vermelho") -#define MSG_INTENSITY_G _UxGT("Intensidade Verde") -#define MSG_INTENSITY_B _UxGT("Intensidade Azul") -#define MSG_INTENSITY_W _UxGT("Intensidade Branco") -#define MSG_LED_BRIGHTNESS _UxGT("Brilho") - -#define MSG_MOVING _UxGT("Movendo...") -#define MSG_FREE_XY _UxGT("Liberar XY") #define MSG_MOVE_X _UxGT("Mover X") #define MSG_MOVE_Y _UxGT("Mover Y") #define MSG_MOVE_Z _UxGT("Mover Z") @@ -177,14 +71,14 @@ #define MSG_MOVE_10MM _UxGT("Mover 10mm") #define MSG_SPEED _UxGT("Velocidade") #define MSG_BED_Z _UxGT("Base Z") -#define MSG_NOZZLE _UxGT("Bocal") -#define MSG_BED _UxGT("Mesa") +#define MSG_NOZZLE LCD_STR_THERMOMETER _UxGT(" Bocal") +#define MSG_BED LCD_STR_THERMOMETER _UxGT(" Base") #define MSG_FAN_SPEED _UxGT("Vel. Ventoinha") -#define MSG_FLOW _UxGT("Vazão") +#define MSG_FLOW _UxGT("Fluxo") #define MSG_CONTROL _UxGT("Controle") #define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") #define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fator") +#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fact") #define MSG_AUTOTEMP _UxGT("Temp. Automática") #define MSG_ON _UxGT("Ligado ") #define MSG_OFF _UxGT("Desligado") @@ -192,44 +86,22 @@ #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") #define MSG_PID_C _UxGT("PID-C") -#define MSG_SELECT _UxGT("Selecionar") -#define MSG_ACC _UxGT("Acel.") +#define MSG_ACC _UxGT("Acc") #define MSG_JERK _UxGT("Jogo") -#if IS_SCARA - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VZ") -#elif IS_DELTA - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VC") -#else - #define MSG_VA_JERK _UxGT("jogo VX") - #define MSG_VB_JERK _UxGT("jogo VY") - #define MSG_VC_JERK _UxGT("jogo VZ") -#endif +#define MSG_VX_JERK _UxGT("jogo VX") +#define MSG_VY_JERK _UxGT("jogo VY") +#define MSG_VZ_JERK _UxGT("jogo VZ") #define MSG_VE_JERK _UxGT("jogo VE") -#define MSG_VELOCITY _UxGT("Velocidade") -#define MSG_VMAX _UxGT("Vmax ") +#define MSG_VMAX _UxGT(" Vmax ") #define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VDeslocamento min") +#define MSG_VTRAV_MIN _UxGT("VTrav min") #define MSG_AMAX _UxGT("Amax ") #define MSG_A_RETRACT _UxGT("Retrair A") -#define MSG_A_TRAVEL _UxGT("Movimento A") +#define MSG_A_TRAVEL _UxGT("A-movimento") #define MSG_STEPS_PER_MM _UxGT("Passo/mm") -#if IS_SCARA - #define MSG_ASTEPS _UxGT("Passo A/deg") - #define MSG_BSTEPS _UxGT("Passo B/deg") - #define MSG_CSTEPS _UxGT("Passo Z/mm") -#elif IS_DELTA - #define MSG_ASTEPS _UxGT("Passo A/mm") - #define MSG_BSTEPS _UxGT("Passo B/mm") - #define MSG_CSTEPS _UxGT("Passo C/mm") -#else - #define MSG_ASTEPS _UxGT("Passo X/mm") - #define MSG_BSTEPS _UxGT("Passo Y/mm") - #define MSG_CSTEPS _UxGT("Passo Z/mm") -#endif +#define MSG_XSTEPS _UxGT("Passo X/mm") +#define MSG_YSTEPS _UxGT("Passo Y/mm") +#define MSG_ZSTEPS _UxGT("Passo Z/mm") #define MSG_ESTEPS _UxGT("E/mm") #define MSG_E1STEPS _UxGT("E1/mm") #define MSG_E2STEPS _UxGT("E2/mm") @@ -239,146 +111,62 @@ #define MSG_TEMPERATURE _UxGT("Temperatura") #define MSG_MOTION _UxGT("Movimento") #define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("Extrusão em mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diâmetro Fil.") -#define MSG_ADVANCE_K _UxGT("Avançar K") +#define MSG_VOLUMETRIC_ENABLED _UxGT("Extr. em mm3") +#define MSG_FILAMENT_DIAM _UxGT("Diametro Fil.") #define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Salvar Configuração") -#define MSG_LOAD_EEPROM _UxGT("Ler Configuração") -#define MSG_RESTORE_FAILSAFE _UxGT("Restauro seguro") -#define MSG_INIT_EEPROM _UxGT("Iniciar EEPROM") -#define MSG_REFRESH LCD_STR_REFRESH _UxGT(" Atualização") -#define MSG_WATCH _UxGT("Informações") +#define MSG_STORE_EEPROM _UxGT("Salvar") +#define MSG_LOAD_EEPROM _UxGT("Ler") +#define MSG_RESTORE_FAILSAFE _UxGT("Rest. de emerg.") +#define MSG_REFRESH LCD_STR_REFRESH _UxGT(" Restaurar") +#define MSG_WATCH _UxGT("Monitorar") #define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Ajustar") +#define MSG_TUNE _UxGT("Afinar") #define MSG_PAUSE_PRINT _UxGT("Pausar impressão") #define MSG_RESUME_PRINT _UxGT("Resumir impressão") #define MSG_STOP_PRINT _UxGT("Parar impressão") #define MSG_CARD_MENU _UxGT("Imprimir do SD") #define MSG_NO_CARD _UxGT("Sem cartão SD") -#define MSG_DWELL _UxGT("ZzZzZz...") -#define MSG_USERWAIT _UxGT("Clique para retomar") -#define MSG_PRINT_ABORTED _UxGT("Impressão Abortada") +#define MSG_DWELL _UxGT("Repouso...") +#define MSG_USERWAIT _UxGT("Esperando ordem") +#define MSG_RESUMING _UxGT("Resumindo Impres.") +#define MSG_PRINT_ABORTED _UxGT("Impres. Abortada.") #define MSG_NO_MOVE _UxGT("Sem movimento") -#define MSG_KILLED _UxGT("PARADA DE EMERGÊNCIA") -#define MSG_STOPPED _UxGT("PAROU. ") +#define MSG_KILLED _UxGT("PARADA DE EMERG.") +#define MSG_STOPPED _UxGT("PARADA. ") #define MSG_CONTROL_RETRACT _UxGT("Retrair mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Retrair Troca mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retrair V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saltar mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Des-Retrair mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Des-RetTroca mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Des-Retrair V") -#define MSG_AUTORETRACT _UxGT("Retração Automática") +#define MSG_CONTROL_RETRACTF _UxGT("Retrair V") +#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Levantar mm") +#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Des Retrair mm") +#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Des RetTroca mm") +#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Des Retrair V") +#define MSG_AUTORETRACT _UxGT("Retração Autom.") #define MSG_FILAMENTCHANGE _UxGT("Trocar Filamento") #define MSG_INIT_SDCARD _UxGT("Iniciar SD") #define MSG_CNG_SDCARD _UxGT("Trocar SD") -#define MSG_ZPROBE_OUT _UxGT("Sonda fora da mesa") -#define MSG_SKEW_FACTOR _UxGT("Fator de Cisalho") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Testar BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("Reiniciar BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Implantar BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Condicionar BLTouch") - -#define MSG_HOME _UxGT("Home") -#define MSG_FIRST _UxGT("Primeiro") -#define MSG_ZPROBE_ZOFFSET _UxGT("Compensar Sonda em Z") +#define MSG_ZPROBE_OUT _UxGT("Son. fora da mesa") +#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST _UxGT("first") +#define MSG_ZPROBE_ZOFFSET _UxGT("Deslocamento no Z") #define MSG_BABYSTEP_X _UxGT("Passinho X") #define MSG_BABYSTEP_Y _UxGT("Passinho Y") #define MSG_BABYSTEP_Z _UxGT("Passinho Z") #define MSG_ENDSTOP_ABORT _UxGT("Fim de Curso") #define MSG_HEATING_FAILED_LCD _UxGT("Aquecimento falhou") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Erro:Temp Redundante") -#define MSG_THERMAL_RUNAWAY _UxGT("ESCAPE TÉRMICO") -#define MSG_ERR_MAXTEMP _UxGT("Erro:Temp Máxima") -#define MSG_ERR_MINTEMP _UxGT("Erro:Temp Mínima") -#define MSG_ERR_MAXTEMP_BED _UxGT("Erro:Temp Mesa Máx") -#define MSG_ERR_MINTEMP_BED _UxGT("Erro:Temp Mesa Mín") +#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: REDUNDANT TEMP") +#define MSG_THERMAL_RUNAWAY _UxGT("THERMAL RUNAWAY") +#define MSG_ERR_MAXTEMP _UxGT("Err: T Máxima") +#define MSG_ERR_MINTEMP _UxGT("Err: T Mínima") +#define MSG_ERR_MAXTEMP_BED _UxGT("Err: T Base Máxima") +#define MSG_ERR_MINTEMP_BED _UxGT("Err: T Base Mínima") #define MSG_HEATING _UxGT("Aquecendo...") -#define MSG_BED_HEATING _UxGT("Aquecendo base...") +#define MSG_HEATING_COMPLETE _UxGT("Aquecida.") +#define MSG_BED_HEATING _UxGT("Aquecendo base..") +#define MSG_BED_DONE _UxGT("Base aquecida.") #define MSG_DELTA_CALIBRATE _UxGT("Calibrar Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Calibrar X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrar Y") #define MSG_DELTA_CALIBRATE_Z _UxGT("Calibrar Z") #define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrar Centro") -#define MSG_DELTA_SETTINGS _UxGT("Configuração Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto-Calibração") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Calibrar Altura") -#define MSG_DELTA_DIAG_ROD _UxGT("Haste Diagonal") -#define MSG_DELTA_HEIGHT _UxGT("Altura") -#define MSG_DELTA_RADIUS _UxGT("Raio") -#define MSG_INFO_MENU _UxGT("Sobre") -#define MSG_INFO_PRINTER_MENU _UxGT("Impressora") -#define MSG_3POINT_LEVELING _UxGT("Nivelamento 3 pontos") -#define MSG_LINEAR_LEVELING _UxGT("Nivelamento Linear") -#define MSG_BILINEAR_LEVELING _UxGT("Nivelamento Bilinear") -#define MSG_UBL_LEVELING _UxGT("Nivelamento UBL") -#define MSG_MESH_LEVELING _UxGT("Nivelamento da Malha") -#define MSG_INFO_STATS_MENU _UxGT("Estatísticas") -#define MSG_INFO_BOARD_MENU _UxGT("Info. da Placa") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusoras") -#define MSG_INFO_BAUDRATE _UxGT("Frequência Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocolo") -#define MSG_CASE_LIGHT _UxGT("Luz da Estrutura") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Intensidade Brilho") -#define MSG_INFO_PRINT_COUNT _UxGT("Qtd Impressões") -#define MSG_INFO_COMPLETED_PRINTS _UxGT("Completas") -#define MSG_INFO_PRINT_TIME _UxGT("Tempo de Imprimindo") -#define MSG_INFO_PRINT_LONGEST _UxGT("Impressão Mais Longa") -#define MSG_INFO_PRINT_FILAMENT _UxGT("Depositado") -#define MSG_INFO_MIN_TEMP _UxGT("Temp Min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp Max") -#define MSG_INFO_PSU _UxGT("PSU") -#define MSG_DRIVE_STRENGTH _UxGT("Força do Motor") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escrever Eeprom DAC") - -#define MSG_FILAMENT_CHANGE_HEADER _UxGT("Troca de Filamento") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Config. de Retomada") -#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extrusar Mais") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Continuar Impressão") -#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Temp. Mínima é ") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Bocal: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Falha ao ir à origem") -#define MSG_ERR_PROBING_FAILED _UxGT("Falha ao sondar") - -#if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando o") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("inicio da") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("troca de Filamento") - - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("remoção de filamento") - - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Coloque Filamento") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("pressione o botão") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("para continuar...") - - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Pressione o botão") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("p/ Aquecer o Bocal") - - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo o Bocal") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Aguarde...") - - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filamento") - - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Esperando extrusão") - #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("de filamento") - - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Esperando impressão") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("continuar") -#else LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Aguarde...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejetando...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insira e Clique") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Carregando...") - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extrusando...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Continuando...") -#endif - #endif // LANGUAGE_PT_BR_UTF_H diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index 9493811..a07c208 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -43,7 +43,6 @@ #define MSG_AUTO_HOME_X "Ir para origem X" #define MSG_AUTO_HOME_Y "Ir para origem Y" #define MSG_AUTO_HOME_Z "Ir para origem Z" -#define MSG_TMC_Z_CALIBRATION "Calibrar Z" #define MSG_LEVEL_BED_HOMING "Indo para origem" #define MSG_LEVEL_BED_WAITING "Click para iniciar" #define MSG_LEVEL_BED_NEXT_POINT "Proximo ponto" @@ -92,16 +91,10 @@ #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" #define MSG_ACC "Acc" -#define MSG_JERK "Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK "Va-jerk" - #define MSG_VB_JERK "Vb-jerk" - #define MSG_VC_JERK "Vc-jerk" -#else - #define MSG_VA_JERK "Vx-jerk" - #define MSG_VB_JERK "Vy-jerk" - #define MSG_VC_JERK "Vz-jerk" -#endif +#define MSG_JERK _UxGT("Jerk") +#define MSG_VX_JERK "Vx-jerk" +#define MSG_VY_JERK "Vy-jerk" +#define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX " Vmax " #define MSG_VMIN "Vmin" @@ -110,15 +103,9 @@ #define MSG_A_RETRACT "A-retraccao" #define MSG_A_TRAVEL "A-movimento" #define MSG_STEPS_PER_MM "Passo/mm" -#if IS_KINEMATIC - #define MSG_ASTEPS "A passo/mm" - #define MSG_BSTEPS "B passo/mm" - #define MSG_CSTEPS "C passo/mm" -#else - #define MSG_ASTEPS "X passo/mm" - #define MSG_BSTEPS "Y passo/mm" - #define MSG_CSTEPS "Z passo/mm" -#endif +#define MSG_XSTEPS "X passo/mm" +#define MSG_YSTEPS "Y passo/mm" +#define MSG_ZSTEPS "Z passo/mm" #define MSG_ESTEPS "E passo/mm" #define MSG_E1STEPS "E1 passo/mm" #define MSG_E2STEPS "E2 passo/mm" @@ -145,6 +132,7 @@ #define MSG_NO_CARD "Sem cartao SD" #define MSG_DWELL "Em espera..." #define MSG_USERWAIT "A espera de ordem" +#define MSG_RESUMING "Retomando impressao" #define MSG_PRINT_ABORTED "Impressao cancelada" #define MSG_NO_MOVE "Sem movimento" #define MSG_KILLED "EMERGENCIA. " @@ -176,7 +164,9 @@ #define MSG_ERR_MAXTEMP_BED "Err: T Base Maxima" #define MSG_ERR_MINTEMP_BED "Err: T Base Minima" #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 0b0113c..1b01294 100644 --- a/Marlin/language_pt_utf8.h +++ b/Marlin/language_pt_utf8.h @@ -31,9 +31,7 @@ #ifndef LANGUAGE_PT_UTF_H #define LANGUAGE_PT_UTF_H -#define MAPPER_C2C3 #define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" pronta.") #define MSG_SD_INSERTED _UxGT("Cartão inserido") @@ -45,7 +43,6 @@ #define MSG_AUTO_HOME_X _UxGT("Ir para origem X") #define MSG_AUTO_HOME_Y _UxGT("Ir para origem Y") #define MSG_AUTO_HOME_Z _UxGT("Ir para origem Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") #define MSG_LEVEL_BED_HOMING _UxGT("Indo para origem") #define MSG_LEVEL_BED_WAITING _UxGT("Click para iniciar") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Próximo ponto") @@ -95,15 +92,9 @@ #define MSG_PID_C _UxGT("PID-C") #define MSG_ACC _UxGT("Acc") #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif +#define MSG_VX_JERK _UxGT("Vx-jerk") +#define MSG_VY_JERK _UxGT("Vy-jerk") +#define MSG_VZ_JERK _UxGT("Vz-jerk") #define MSG_VE_JERK _UxGT("Ve-jerk") #define MSG_VMAX _UxGT(" Vmax ") #define MSG_VMIN _UxGT("Vmin") @@ -112,15 +103,9 @@ #define MSG_A_RETRACT _UxGT("A-retracção") #define MSG_A_TRAVEL _UxGT("A-movimento") #define MSG_STEPS_PER_MM _UxGT("Passo/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A passo/mm") - #define MSG_BSTEPS _UxGT("B passo/mm") - #define MSG_CSTEPS _UxGT("C passo/mm") -#else - #define MSG_ASTEPS _UxGT("X passo/mm") - #define MSG_BSTEPS _UxGT("Y passo/mm") - #define MSG_CSTEPS _UxGT("Z passo/mm") -#endif +#define MSG_XSTEPS _UxGT("X passo/mm") +#define MSG_YSTEPS _UxGT("Y passo/mm") +#define MSG_ZSTEPS _UxGT("Z passo/mm") #define MSG_ESTEPS _UxGT("E passo/mm") #define MSG_E1STEPS _UxGT("E1 passo/mm") #define MSG_E2STEPS _UxGT("E2 passo/mm") @@ -147,6 +132,7 @@ #define MSG_NO_CARD _UxGT("Sem cartão SD") #define MSG_DWELL _UxGT("Em espera...") #define MSG_USERWAIT _UxGT("Á espera de ordem") +#define MSG_RESUMING _UxGT("Retomando impressão") #define MSG_PRINT_ABORTED _UxGT("Impressão cancelada") #define MSG_NO_MOVE _UxGT("Sem movimento") #define MSG_KILLED _UxGT("EMERGÊNCIA. ") @@ -178,7 +164,9 @@ #define MSG_ERR_MAXTEMP_BED _UxGT("Err: T Base Máxima") #define MSG_ERR_MINTEMP_BED _UxGT("Err: T Base Mínima") #define MSG_HEATING _UxGT("Aquecendo...") -#define MSG_BED_HEATING _UxGT("Aquecendo base...") +#define MSG_HEATING_COMPLETE _UxGT("Aquecida.") +#define MSG_BED_HEATING _UxGT("Aquecendo base..") +#define MSG_BED_DONE _UxGT("Base aquecida.") #define MSG_DELTA_CALIBRATE _UxGT("Calibração Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Calibrar X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrar Y") diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index 4a9fc53..3281987 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -32,55 +32,50 @@ #define MAPPER_D0D1 // For Cyrillic #define DISPLAY_CHARSET_ISO10646_5 -#define CHARSIZE 2 -#define WELCOME_MSG MACHINE_NAME _UxGT(" готов.") +#define WELCOME_MSG MACHINE_NAME _UxGT(" Готов.") #define MSG_BACK _UxGT("Назад") #define MSG_SD_INSERTED _UxGT("Карта вставлена") #define MSG_SD_REMOVED _UxGT("Карта извлечена") -#define MSG_LCD_ENDSTOPS _UxGT("Эндстопы") // Max length 8 characters -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Прогр. эндстопы") +#define MSG_LCD_ENDSTOPS _UxGT("Концевики") #define MSG_MAIN _UxGT("Меню") #define MSG_AUTOSTART _UxGT("Автостарт") #define MSG_DISABLE_STEPPERS _UxGT("Выкл. двигатели") #define MSG_DEBUG_MENU _UxGT("Меню отладки") #define MSG_PROGRESS_BAR_TEST _UxGT("Тест индикатора") -#define MSG_AUTO_HOME _UxGT("Авто парковка") +#define MSG_AUTO_HOME _UxGT("Авто Парковка") #define MSG_AUTO_HOME_X _UxGT("Парковка X") #define MSG_AUTO_HOME_Y _UxGT("Парковка Y") #define MSG_AUTO_HOME_Z _UxGT("Парковка Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Калибровать Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Нулевое положение") -#define MSG_LEVEL_BED_WAITING _UxGT("Нажмите чтобы начать") +#define MSG_LEVEL_BED_HOMING _UxGT("Нулевое полож") +#define MSG_LEVEL_BED_WAITING _UxGT("Нажмите начать") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Следующая точка") -#define MSG_LEVEL_BED_DONE _UxGT("Выравнивание готово!") +#define MSG_LEVEL_BED_DONE _UxGT("Выравнинваие готово!") #define MSG_Z_FADE_HEIGHT _UxGT("Высота спада") #define MSG_SET_HOME_OFFSETS _UxGT("Запомнить парковку") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Коррекции применены") +#define MSG_HOME_OFFSETS_APPLIED _UxGT("Коррекции примен") #define MSG_SET_ORIGIN _UxGT("Запомнить ноль") #define MSG_PREHEAT_1 _UxGT("Преднагрев PLA") #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" всё") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" сопло") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" стол") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" настр.") +#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Всё") +#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Сопло") +#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Стол") +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Настр.") #define MSG_PREHEAT_2 _UxGT("Преднагрев ABS") #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" всё") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" сопло") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" стол") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" настр.") +#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Всё") +#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Сопло") +#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Стол") +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Настр.") #define MSG_COOLDOWN _UxGT("Охлаждение") -#define MSG_SWITCH_PS_ON _UxGT("Включить питание") -#define MSG_SWITCH_PS_OFF _UxGT("Выключить питание") +#define MSG_SWITCH_PS_ON _UxGT("Включить Питание") +#define MSG_SWITCH_PS_OFF _UxGT("Отключить Питание") #define MSG_EXTRUDE _UxGT("Экструзия") #define MSG_RETRACT _UxGT("Втягивание") #define MSG_MOVE_AXIS _UxGT("Движение по осям") -#define MSG_BED_LEVELING _UxGT("Калибровка стола") +#define MSG_BED_LEVELING _UxGT("Калибровать стол") #define MSG_LEVEL_BED _UxGT("Калибровать стол") -#define MSG_LEVEL_CORNERS _UxGT("Выровнять углы") -#define MSG_NEXT_CORNER _UxGT("Следующий угол") -#define MSG_EDITING_STOPPED _UxGT("Ред. сетки завершено") +#define MSG_EDITING_STOPPED _UxGT("Ред. сетки завершена") #define MSG_USER_MENU _UxGT("Свои комманды") #define MSG_UBL_DOING_G29 _UxGT("Выполняем G29") #define MSG_UBL_UNHOMED _UxGT("Паркуем сначала XYZ") @@ -92,14 +87,14 @@ #define MSG_UBL_BC_REMOVE _UxGT("Удал. и измер. стол") #define MSG_UBL_MOVING_TO_NEXT _UxGT("Двигаемся дальше") #define MSG_UBL_ACTIVATE_MESH _UxGT("Активировать UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Деактивировать UBL") +#define MSG_UBL_DEACTIVATE_MESH _UxGT("Выключить UBL") #define MSG_UBL_SET_BED_TEMP _UxGT("Температура стола") #define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP #define MSG_UBL_SET_HOTEND_TEMP _UxGT("Температура сопла") #define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP #define MSG_UBL_MESH_EDIT _UxGT("Редактор сеток") #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Редакт. свою сетку") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Точная настр. сетки") +#define MSG_UBL_FINE_TUNE_MESH _UxGT("Точ. настройка сетки") #define MSG_UBL_DONE_EDITING_MESH _UxGT("Ред. сетки завершено") #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Построить свою сетку") #define MSG_UBL_BUILD_MESH_MENU _UxGT("Построить сетку") @@ -123,70 +118,46 @@ #define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Вывести на хост") #define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Вывести в CSV") #define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Забекапить сетку") -#define MSG_UBL_INFO_UBL _UxGT("Вывод информации UBL") +#define MSG_UBL_INFO_UBL _UxGT("Выдача инфор. UBL") #define MSG_UBL_EDIT_MESH_MENU _UxGT("Редактировать сетку") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Кол-во заполнителя") +#define MSG_UBL_FILLIN_AMOUNT _UxGT("Заполнить значения") #define MSG_UBL_MANUAL_FILLIN _UxGT("Ручное заполнение") -#define MSG_UBL_SMART_FILLIN _UxGT("Умное заполнение") +#define MSG_UBL_SMART_FILLIN _UxGT("Уменое заполнение") #define MSG_UBL_FILLIN_MESH _UxGT("Заполнить сетку") #define MSG_UBL_INVALIDATE_ALL _UxGT("Аннулировать всё") #define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Аннулир. ближ. точку") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Точная настр. всего") +#define MSG_UBL_FINE_TUNE_ALL _UxGT("Точ. настройка всего") #define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Настр. ближ. точки") #define MSG_UBL_STORAGE_MESH_MENU _UxGT("Хранилище сетей") #define MSG_UBL_STORAGE_SLOT _UxGT("Слот памяти") -#define MSG_UBL_LOAD_MESH _UxGT("Загрузить сетку стола") -#define MSG_UBL_SAVE_MESH _UxGT("Сохранить сетку стола") -#define MSG_MESH_LOADED _UxGT("Сетка %i загружена") -#define MSG_MESH_SAVED _UxGT("Сетка %i сохранена") -#define MSG_NO_STORAGE _UxGT("Нет хранилища") -#define MSG_UBL_SAVE_ERROR _UxGT("Ошибка: Сохран. UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Ошибка: Восстан. UBL") +#define MSG_UBL_LOAD_MESH _UxGT("Загрузить стол сетки") +#define MSG_UBL_SAVE_MESH _UxGT("Сохранить стол сетки") +#define MSG_UBL_SAVE_ERROR _UxGT("Ошибка: Сохр. UBL") +#define MSG_UBL_RESTORE_ERROR _UxGT("Ошибка: Загрузки UBL") #define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Смещение Z останов.") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Пошаговое UBL") - -#define MSG_LED_CONTROL _UxGT("Настройки LED") -#define MSG_LEDS _UxGT("Подсветку") -#define MSG_LED_PRESETS _UxGT("Предустановки света") -#define MSG_SET_LEDS_RED _UxGT("Красный свет") -#define MSG_SET_LEDS_ORANGE _UxGT("Оранжевый свет") -#define MSG_SET_LEDS_YELLOW _UxGT("Жёлтый свет") -#define MSG_SET_LEDS_GREEN _UxGT("Зелёный свет") -#define MSG_SET_LEDS_BLUE _UxGT("Синий свет") -#define MSG_SET_LEDS_INDIGO _UxGT("Индиго свет") -#define MSG_SET_LEDS_VIOLET _UxGT("Фиолетовый свет") -#define MSG_SET_LEDS_WHITE _UxGT("Белый свет") -#define MSG_SET_LEDS_DEFAULT _UxGT("Свет по умолчанию") -#define MSG_CUSTOM_LEDS _UxGT("Свои настр. света") -#define MSG_INTENSITY_R _UxGT("Интенсивн. красного") -#define MSG_INTENSITY_G _UxGT("Интенсивн. зелёного") -#define MSG_INTENSITY_B _UxGT("Интенсивн. синего") -#define MSG_INTENSITY_W _UxGT("Интенсивн. белого") -#define MSG_LED_BRIGHTNESS _UxGT("Яркость") - +#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Пошаговый UBL") #define MSG_MOVING _UxGT("Движемся...") #define MSG_FREE_XY _UxGT("Освобождаем XY") #define MSG_MOVE_X _UxGT("Движение по X") #define MSG_MOVE_Y _UxGT("Движение по Y") #define MSG_MOVE_Z _UxGT("Движение по Z") #define MSG_MOVE_E _UxGT("Экструдер") -#define MSG_MOVE_01MM _UxGT("Движение 0.1мм") -#define MSG_MOVE_1MM _UxGT("Движение 1мм") -#define MSG_MOVE_10MM _UxGT("Движение 10мм") +#define MSG_MOVE_01MM _UxGT("Движение 0.1mm") +#define MSG_MOVE_1MM _UxGT("Движение 1mm") +#define MSG_MOVE_10MM _UxGT("Движение 10mm") #define MSG_SPEED _UxGT("Скорость") #define MSG_BED_Z _UxGT("Z стола") -#define MSG_NOZZLE _UxGT("Сопло") -#define MSG_BED _UxGT("Стол") +#define MSG_NOZZLE LCD_STR_THERMOMETER _UxGT(" Сопло") +#define MSG_BED LCD_STR_THERMOMETER _UxGT(" Стол") #define MSG_FAN_SPEED _UxGT("Кулер") -#define MSG_EXTRA_FAN_SPEED _UxGT("Кулер доп.") #define MSG_FLOW _UxGT("Поток") #define MSG_CONTROL _UxGT("Настройки") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Мин") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Макс") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Фактор") +#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Минимум") +#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Максимум") +#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Фактор") #define MSG_AUTOTEMP _UxGT("Автотемпература") -#define MSG_ON _UxGT("Вкл.") -#define MSG_OFF _UxGT("Выкл.") +#define MSG_ON _UxGT("Вкл. ") +#define MSG_OFF _UxGT("Откл. ") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") @@ -194,93 +165,74 @@ #define MSG_SELECT _UxGT("Выбор") #define MSG_ACC _UxGT("Ускорение") #define MSG_JERK _UxGT("Рывок") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-рывок") - #define MSG_VB_JERK _UxGT("Vb-рывок") - #define MSG_VC_JERK _UxGT("Vc-рывок") -#else - #define MSG_VX_JERK _UxGT("Vx-рывок") - #define MSG_VY_JERK _UxGT("Vy-рывок") - #define MSG_VZ_JERK _UxGT("Vz-рывок") -#endif +#define MSG_VX_JERK _UxGT("Vx-рывок") +#define MSG_VY_JERK _UxGT("Vy-рывок") +#define MSG_VZ_JERK _UxGT("Vz-рывок") #define MSG_VE_JERK _UxGT("Ve-рывок") -#define MSG_VELOCITY _UxGT("Быстрота") +#define MSG_VELOCITY _UxGT("Скорость") #define MSG_VMAX _UxGT("Vмакс ") #define MSG_VMIN _UxGT("Vмин") #define MSG_VTRAV_MIN _UxGT("Vпутеш. мин") #define MSG_ACCELERATION _UxGT("Ускорение") -#define MSG_AMAX _UxGT("Aмакс ") +#define MSG_AMAX _UxGT("Aмакс") #define MSG_A_RETRACT _UxGT("A-втягивание") #define MSG_A_TRAVEL _UxGT("A-путеш.") #define MSG_STEPS_PER_MM _UxGT("Шаг/мм") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Aшаг/мм") - #define MSG_BSTEPS _UxGT("Bшаг/мм") - #define MSG_CSTEPS _UxGT("Cшаг/мм") -#else - #define MSG_ASTEPS _UxGT("Xшаг/мм") - #define MSG_BSTEPS _UxGT("Yшаг/мм") - #define MSG_CSTEPS _UxGT("Zшаг/мм") -#endif -#define MSG_ESTEPS _UxGT("Eшаг/мм") -#define MSG_E1STEPS _UxGT("E1шаг/мм") -#define MSG_E2STEPS _UxGT("E2шаг/мм") -#define MSG_E3STEPS _UxGT("E3шаг/мм") -#define MSG_E4STEPS _UxGT("E4шаг/мм") -#define MSG_E5STEPS _UxGT("E5шаг/мм") +#define MSG_XSTEPS _UxGT("X шаг/мм") +#define MSG_YSTEPS _UxGT("Y шаг/мм") +#define MSG_ZSTEPS _UxGT("Z шаг/мм") +#define MSG_ESTEPS _UxGT("E шаг/мм") +#define MSG_E1STEPS _UxGT("E1 шаг/мм") +#define MSG_E2STEPS _UxGT("E2 шаг/мм") +#define MSG_E3STEPS _UxGT("E3 шаг/мм") +#define MSG_E4STEPS _UxGT("E4 шаг/мм") +#define MSG_E5STEPS _UxGT("E5 шаг/мм") #define MSG_TEMPERATURE _UxGT("Температура") -#define MSG_MOTION _UxGT("Движение") -#define MSG_FILAMENT _UxGT("Филамент") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E в мм3") -#define MSG_FILAMENT_DIAM _UxGT("Диаметр филамента") -#define MSG_FILAMENT_UNLOAD _UxGT("Загрузка мм") -#define MSG_FILAMENT_LOAD _UxGT("Выгрузка мм") +#define MSG_MOTION _UxGT("Механика") +#define MSG_FILAMENT _UxGT("Пруток") +#define MSG_VOLUMETRIC_ENABLED _UxGT("E в mm3") +#define MSG_FILAMENT_DIAM _UxGT("Диаметр прутка") #define MSG_ADVANCE_K _UxGT("K продвижения") #define MSG_CONTRAST _UxGT("Контраст LCD") -#define MSG_STORE_EEPROM _UxGT("Сохранить настройки") -#define MSG_LOAD_EEPROM _UxGT("Загрузить настройки") -#define MSG_RESTORE_FAILSAFE _UxGT("Восстановить настр.") -#define MSG_INIT_EEPROM _UxGT("Инициализация EEPROM") +#define MSG_STORE_EEPROM _UxGT("Сохранить в EEPROM") +#define MSG_LOAD_EEPROM _UxGT("Считать из EEPROM") +#define MSG_RESTORE_FAILSAFE _UxGT("Сброс EEPROM") +#define MSG_INIT_EEPROM _UxGT("Иниц. EEPROM") #define MSG_REFRESH _UxGT("Обновить") -#define MSG_WATCH _UxGT("Информационный экран") -#define MSG_PREPARE _UxGT("Подготовить") -#define MSG_TUNE _UxGT("Настроить") +#define MSG_WATCH _UxGT("Обзор") +#define MSG_PREPARE _UxGT("Действия") +#define MSG_TUNE _UxGT("Настройки") #define MSG_PAUSE_PRINT _UxGT("Пауза печати") #define MSG_RESUME_PRINT _UxGT("Продолжить печать") #define MSG_STOP_PRINT _UxGT("Остановить печать") -#define MSG_CARD_MENU _UxGT("Печать с SD карты") -#define MSG_NO_CARD _UxGT("Нет SD карты") +#define MSG_CARD_MENU _UxGT("Обзор карты") +#define MSG_NO_CARD _UxGT("Нет карты") #define MSG_DWELL _UxGT("Сон...") #define MSG_USERWAIT _UxGT("Продолжить...") -#define MSG_PRINT_PAUSED _UxGT("Печать на паузе") -#define MSG_PRINTING _UxGT("Печать...") -#define MSG_PRINT_ABORTED _UxGT("Печать отменена") +#define MSG_PRINT_PAUSED _UxGT("Печать остановлена") +#define MSG_RESUMING _UxGT("Возобновление...") +#define MSG_PRINT_ABORTED _UxGT("Отмена печати") #define MSG_NO_MOVE _UxGT("Нет движения.") -#define MSG_KILLED _UxGT("УБИТО. ") -#define MSG_STOPPED _UxGT("ОСТАНОВЛЕНО. ") -#define MSG_CONTROL_RETRACT _UxGT("Втягивание мм") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Втягивание смены мм") +#define MSG_KILLED _UxGT("УБИТО.") +#define MSG_STOPPED _UxGT("ОСТАНОВЛЕНО.") +#define MSG_CONTROL_RETRACT _UxGT("Втягивание mm") +#define MSG_CONTROL_RETRACT_SWAP _UxGT("Втяг. смены mm") #define MSG_CONTROL_RETRACTF _UxGT("Втягивание V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Втяг. прыжка мм") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Возврат мм") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Возврат смены мм") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Возврат V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("Возврат смены V") +#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Втяг. прыжка mm") +#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Возврат mm") +#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Возврат смены mm") +#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Возврат V") #define MSG_AUTORETRACT _UxGT("Авто Втягивание") -#define MSG_FILAMENTCHANGE _UxGT("Смена филамента") -#define MSG_FILAMENTLOAD _UxGT("Загрузка филамента") -#define MSG_FILAMENTUNLOAD _UxGT("Выгрузка филамента") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Выгрузить всё") -#define MSG_INIT_SDCARD _UxGT("Иниц. SD карту") -#define MSG_CNG_SDCARD _UxGT("Сменить SD карту") +#define MSG_FILAMENTCHANGE _UxGT("Смена прутка") +#define MSG_INIT_SDCARD _UxGT("Иниц. карту") +#define MSG_CNG_SDCARD _UxGT("Сменить карту") #define MSG_ZPROBE_OUT _UxGT("Z датчик вне стола") -#define MSG_SKEW_FACTOR _UxGT("Фактор наклона") #define MSG_BLTOUCH _UxGT("BLTouch") #define MSG_BLTOUCH_SELFTEST _UxGT("Тестирование BLTouch") #define MSG_BLTOUCH_RESET _UxGT("Сброс BLTouch") #define MSG_BLTOUCH_DEPLOY _UxGT("Установка BLTouch") #define MSG_BLTOUCH_STOW _UxGT("Набивка BLTouch") -#define MSG_HOME _UxGT("Паркуй") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_HOME _UxGT("Паркуй") #define MSG_FIRST _UxGT("первый") #define MSG_ZPROBE_ZOFFSET _UxGT("Смещение Z") #define MSG_BABYSTEP_X _UxGT("Микрошаг X") @@ -288,36 +240,30 @@ #define MSG_BABYSTEP_Z _UxGT("Микрошаг Z") #define MSG_ENDSTOP_ABORT _UxGT("Сработал концевик") #define MSG_HEATING_FAILED_LCD _UxGT("Разогрев не удался") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Разогр. стола не уд.") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Ошибка: Избыточная Т") -#define MSG_THERMAL_RUNAWAY _UxGT("УБЕГАНИЕ ТЕПЛА") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("УБЕГАНИЕ ТЕПЛА СТОЛА") +#define MSG_ERR_REDUNDANT_TEMP _UxGT("Ошибка: T ред.") +#define MSG_THERMAL_RUNAWAY _UxGT("ТЕПЛО УБЕГАНИЯ!") #define MSG_ERR_MAXTEMP _UxGT("Ошибка: Т макс.") #define MSG_ERR_MINTEMP _UxGT("Ошибка: Т мин.") -#define MSG_ERR_MAXTEMP_BED _UxGT("Ошибка: Т стола макс") -#define MSG_ERR_MINTEMP_BED _UxGT("Ошибка: Т стола мин.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_MAXTEMP_BED _UxGT("Ошибка:Т макс.стол") +#define MSG_ERR_MINTEMP_BED _UxGT("Ошибка:Т мин.стол") +#define MSG_ERR_Z_HOMING _UxGT("G28 Z Запрещено") #define MSG_HALTED _UxGT("ПРИНТЕР ОСТАНОВЛЕН") -#define MSG_PLEASE_RESET _UxGT("Сделайте сброс") +#define MSG_PLEASE_RESET _UxGT("Нажмите ресет") #define MSG_SHORT_DAY _UxGT("д") // One character only #define MSG_SHORT_HOUR _UxGT("ч") // One character only #define MSG_SHORT_MINUTE _UxGT("м") // One character only -#define MSG_HEATING _UxGT("Нагрев...") -#define MSG_COOLING _UxGT("Охлаждение...") -#define MSG_BED_HEATING _UxGT("Нагрев стола...") -#define MSG_BED_COOLING _UxGT("Охлаждение стола...") +#define MSG_HEATING _UxGT("Нагреваю сопло...") +#define MSG_HEATING_COMPLETE _UxGT("Нагрев выполнен") +#define MSG_BED_HEATING _UxGT("Нагреваю стол") +#define MSG_BED_DONE _UxGT("Стол разогрет") #define MSG_DELTA_CALIBRATE _UxGT("Калибровка Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Калибровать X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Калибровать Y") #define MSG_DELTA_CALIBRATE_Z _UxGT("Калибровать Z") #define MSG_DELTA_CALIBRATE_CENTER _UxGT("Калибровать центр") -#define MSG_DELTA_SETTINGS _UxGT("Настройки Delta") +#define MSG_DELTA_SETTINGS _UxGT("Пок. настройки Delta") #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Авто калибровка") #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Задать высоту Delta") -#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Задать Z-смещение") -#define MSG_DELTA_DIAG_ROD _UxGT("Диаг. стержень") -#define MSG_DELTA_HEIGHT _UxGT("Высота") -#define MSG_DELTA_RADIUS _UxGT("Радиус") #define MSG_INFO_MENU _UxGT("О принтере") #define MSG_INFO_PRINTER_MENU _UxGT("Инф. о принтере") #define MSG_3POINT_LEVELING _UxGT("Калибровка 3-х точек") @@ -331,19 +277,17 @@ #define MSG_INFO_EXTRUDERS _UxGT("Экструдеры") #define MSG_INFO_BAUDRATE _UxGT("Бод") #define MSG_INFO_PROTOCOL _UxGT("Протокол") -#define MSG_CASE_LIGHT _UxGT("Подсветка корпуса") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Яркость подсветки") +#define MSG_CASE_LIGHT _UxGT("Корпусное освещение") +#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Яркость освещения") #if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Счётчик печати") #define MSG_INFO_COMPLETED_PRINTS _UxGT("Закончено") - #define MSG_INFO_PRINT_TIME _UxGT("Общее время печати") - #define MSG_INFO_PRINT_LONGEST _UxGT("Наидольшее задание") + #define MSG_INFO_PRINT_TIME _UxGT("Полное время печати") #define MSG_INFO_PRINT_FILAMENT _UxGT("Длинна филамента") #else #define MSG_INFO_PRINT_COUNT _UxGT("Отпечатков") #define MSG_INFO_COMPLETED_PRINTS _UxGT("Закончено") #define MSG_INFO_PRINT_TIME _UxGT("Всего") - #define MSG_INFO_PRINT_LONGEST _UxGT("Наидольшее") + #define MSG_INFO_PRINT_LONGEST _UxGT("Наибольшее") #define MSG_INFO_PRINT_FILAMENT _UxGT("Выдавлено") #endif #define MSG_INFO_MIN_TEMP _UxGT("Мин. Т") @@ -351,52 +295,42 @@ #define MSG_INFO_PSU _UxGT("Блок питания") #define MSG_DRIVE_STRENGTH _UxGT("Сила привода") #define MSG_DAC_PERCENT _UxGT("Привод %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Запись DAC EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("ПЕЧАТЬ НА ПАУЗЕ") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("ЗАГРУЗКА ФИЛАМЕНТА") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("ВЫГРУЗКА ФИЛАМЕНТА") +#define MSG_DAC_EEPROM_WRITE _UxGT("Записи DAC EEPROM") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("ПЕЧАТЬ ОСТАНОВЛЕНА") #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ОПЦИИ ВОЗОБНОВЛЕНИЯ:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Выдавить ещё") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Выдавить ещё") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Возобновить печать") +#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Мин. температура") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Сопла: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Возврат не удался") -#define MSG_ERR_PROBING_FAILED _UxGT("Не удалось прощупать") -#define MSG_M600_TOO_COLD _UxGT("M600: Низкая Т") - // // Filament Change screens show up to 3 lines on a 4-line display // ...or up to 2 lines on a 3-line display // #if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("начала смены") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("филамента") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("выгрузки") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("филамента") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Вставьте пруток") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("и нажмите кнопку") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("для продолжения") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Нажмите кнопку для") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("нагрева сопла...") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Нагрев сопла") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Ждите...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("загрузки прутка") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("экструзии") - #define MSG_FILAMENT_CHANGE_PURGE_3 _UxGT("филамента") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("возобновления") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("печати") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Ожидайте") + #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("начала смены") + #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("филамента") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ожидайте") + #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("выгрузки филамента") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Вставьте филамент") + #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("и нажмите кнопку") + #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("для продолжения...") + #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Нажмите кнопку для") + #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("нагрева сопла...") + #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Нагрев сопла") + #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Ждите...") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ожидайте") + #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("загрузки филамента") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Ожидайте") + #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("возобновления") #else // LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Ожидайте...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Выгрузка...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Вставь и нажми") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Нагрев...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Загрузка...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Выдавливание...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Возобновление...") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Ожидайте...") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Выгрузка...") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Вставь и нажми") + #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Нагрев...") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Загрузка...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Выдавливание...") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Возобновление...") #endif // LCD_HEIGHT < 4 #endif // LANGUAGE_RU_H diff --git a/Marlin/language_sk_utf8.h b/Marlin/language_sk_utf8.h index de3b2ba..d7157ca 100644 --- a/Marlin/language_sk_utf8.h +++ b/Marlin/language_sk_utf8.h @@ -36,14 +36,12 @@ #define MAPPER_C3C4C5_SK #define DISPLAY_CHARSET_ISO10646_SK -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" pripravená.") #define MSG_BACK _UxGT("Naspať") #define MSG_SD_INSERTED _UxGT("Karta vložená") #define MSG_SD_REMOVED _UxGT("Karta vybratá") #define MSG_LCD_ENDSTOPS _UxGT("Endstopy") // max 8 znakov -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft.endstopy") #define MSG_MAIN _UxGT("Hlavná ponuka") #define MSG_AUTOSTART _UxGT("Autoštart") #define MSG_DISABLE_STEPPERS _UxGT("Uvolniť motory") @@ -53,7 +51,6 @@ #define MSG_AUTO_HOME_X _UxGT("Domov os X") #define MSG_AUTO_HOME_Y _UxGT("Domov os Y") #define MSG_AUTO_HOME_Z _UxGT("Domov os Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrovať Z") #define MSG_LEVEL_BED_HOMING _UxGT("Meranie podložky") #define MSG_LEVEL_BED_WAITING _UxGT("Kliknutím spusťte") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Ďalší bod") @@ -82,8 +79,6 @@ #define MSG_MOVE_AXIS _UxGT("Posunúť osy") #define MSG_BED_LEVELING _UxGT("Vyrovnať podložku") #define MSG_LEVEL_BED _UxGT("Vyrovnať podložku") -#define MSG_LEVEL_CORNERS _UxGT("Vyrovnať rohy") -#define MSG_NEXT_CORNER _UxGT("Ďalší roh") #define MSG_EDITING_STOPPED _UxGT("Koniec úprav siete") #define MSG_UBL_DOING_G29 _UxGT("Vykonávam G29") @@ -101,7 +96,6 @@ #define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP #define MSG_UBL_SET_HOTEND_TEMP _UxGT("Teplota hotendu") #define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Úprava sieťe bodov") #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Upraviť vlastnú sieť") #define MSG_UBL_FINE_TUNE_MESH _UxGT("Doladiť sieť bodov") #define MSG_UBL_DONE_EDITING_MESH _UxGT("Koniec úprav siete") @@ -141,33 +135,11 @@ #define MSG_UBL_STORAGE_SLOT _UxGT("Pamaťový slot") #define MSG_UBL_LOAD_MESH _UxGT("Načítať sieť bodov") #define MSG_UBL_SAVE_MESH _UxGT("Uložiť sieť bodov") -#define MSG_MESH_LOADED _UxGT("Sieť %i načítaná") -#define MSG_MESH_SAVED _UxGT("Sieť %i uložená") -#define MSG_NO_STORAGE _UxGT("Nedostatok miesta") #define MSG_UBL_SAVE_ERROR _UxGT("Err: Uložiť UBL") #define MSG_UBL_RESTORE_ERROR _UxGT("Err: Obnoviť UBL") #define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Koniec Z-Offsetu") #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupne") -#define MSG_LED_CONTROL _UxGT("Nastavenie LED") -#define MSG_LEDS _UxGT("Svetlo") -#define MSG_LED_PRESETS _UxGT("Prednastavené farby") -#define MSG_SET_LEDS_RED _UxGT("Červená") -#define MSG_SET_LEDS_ORANGE _UxGT("Oranžová") -#define MSG_SET_LEDS_YELLOW _UxGT("Žltá") -#define MSG_SET_LEDS_GREEN _UxGT("Zelená") -#define MSG_SET_LEDS_BLUE _UxGT("Modrá") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Fialová") -#define MSG_SET_LEDS_WHITE _UxGT("Biela") -#define MSG_SET_LEDS_DEFAULT _UxGT("Obnoviť nastavenie") -#define MSG_CUSTOM_LEDS _UxGT("Vlastná farba") -#define MSG_INTENSITY_R _UxGT("Inten. červenej") -#define MSG_INTENSITY_G _UxGT("Inten. zelenej") -#define MSG_INTENSITY_B _UxGT("Inten. modrej") -#define MSG_INTENSITY_W _UxGT("Inten. bielej") -#define MSG_LED_BRIGHTNESS _UxGT("Jas") - #define MSG_USER_MENU _UxGT("Vlastné príkazy") #define MSG_MOVING _UxGT("Posun...") #define MSG_FREE_XY _UxGT("Uvolniť XY") @@ -183,7 +155,6 @@ #define MSG_NOZZLE _UxGT("Tryska") #define MSG_BED _UxGT("Podložka") #define MSG_FAN_SPEED _UxGT("Rýchlosť vent.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Rýchlosť ex. vent.") #define MSG_FLOW _UxGT("Prietok") #define MSG_CONTROL _UxGT("Ovládanie") #define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") @@ -199,17 +170,10 @@ #define MSG_SELECT _UxGT("Vybrať") #define MSG_ACC _UxGT("Zrýchl") #define MSG_JERK _UxGT("Skok") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-skok") - #define MSG_VB_JERK _UxGT("Vb-skok") - #define MSG_VC_JERK _UxGT("Vc-skok") -#else - #define MSG_VA_JERK _UxGT("Vx-skok") - #define MSG_VB_JERK _UxGT("Vy-skok") - #define MSG_VC_JERK _UxGT("Vz-skok") -#endif +#define MSG_VX_JERK _UxGT("Vx-skok") +#define MSG_VY_JERK _UxGT("Vy-skok") +#define MSG_VZ_JERK _UxGT("Vz-skok") #define MSG_VE_JERK _UxGT("Ve-skok") -#define MSG_JUNCTION_DEVIATION _UxGT("Junction Dev") #define MSG_VELOCITY _UxGT("Rýchlosť") #define MSG_VMAX _UxGT("Vmax ") #define MSG_VMIN _UxGT("Vmin") @@ -219,15 +183,9 @@ #define MSG_A_RETRACT _UxGT("A-retrakt") #define MSG_A_TRAVEL _UxGT("A-prejazd") #define MSG_STEPS_PER_MM _UxGT("Krokov/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Akrokov/mm") - #define MSG_BSTEPS _UxGT("Bkrokov/mm") - #define MSG_CSTEPS _UxGT("Ckrokov/mm") -#else - #define MSG_ASTEPS _UxGT("Xkrokov/mm") - #define MSG_BSTEPS _UxGT("Ykrokov/mm") - #define MSG_CSTEPS _UxGT("Zkrokov/mm") -#endif +#define MSG_XSTEPS _UxGT("Xkrokov/mm") +#define MSG_YSTEPS _UxGT("Ykrokov/mm") +#define MSG_ZSTEPS _UxGT("Zkrokov/mm") #define MSG_ESTEPS _UxGT("Ekrokov/mm") #define MSG_E1STEPS _UxGT("E1krokov/mm") #define MSG_E2STEPS _UxGT("E2krokov/mm") @@ -239,8 +197,6 @@ #define MSG_FILAMENT _UxGT("Filament") #define MSG_VOLUMETRIC_ENABLED _UxGT("E na mm3") #define MSG_FILAMENT_DIAM _UxGT("Fil. Priem.") -#define MSG_FILAMENT_UNLOAD _UxGT("Vysunúť mm") -#define MSG_FILAMENT_LOAD _UxGT("Zaviesť mm") #define MSG_ADVANCE_K _UxGT("K pro posun") #define MSG_CONTRAST _UxGT("Kontrast LCD") #define MSG_STORE_EEPROM _UxGT("Uložiť nastavenie") @@ -257,9 +213,9 @@ #define MSG_CARD_MENU _UxGT("Tlačiť z SD") #define MSG_NO_CARD _UxGT("Žiadna SD karta") #define MSG_DWELL _UxGT("Spím...") -#define MSG_USERWAIT _UxGT("Kliknutím pokrač.") +#define MSG_USERWAIT _UxGT("Čakám...") #define MSG_PRINT_PAUSED _UxGT("Tlač pozastavená") -#define MSG_PRINTING _UxGT("Tlačím...") +#define MSG_RESUMING _UxGT("Obnovovanie tlače") #define MSG_PRINT_ABORTED _UxGT("Tlač zrušená") #define MSG_NO_MOVE _UxGT("Žiadny pohyb.") #define MSG_KILLED _UxGT("PRERUŠENÉ. ") @@ -271,17 +227,11 @@ #define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("S UnRet mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") #define MSG_AUTORETRACT _UxGT("AutoRetr.") #define MSG_FILAMENTCHANGE _UxGT("Vymeniť filament") -#define MSG_FILAMENTLOAD _UxGT("Zaviesť filament") -#define MSG_FILAMENTUNLOAD _UxGT("Vysunúť filament") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Vysunúť všetko") - #define MSG_INIT_SDCARD _UxGT("Načítať SD kartu") #define MSG_CNG_SDCARD _UxGT("Vymeniť SD kartu") #define MSG_ZPROBE_OUT _UxGT("Sonda Z mimo podl") -#define MSG_SKEW_FACTOR _UxGT("Faktor skosenia") #define MSG_BLTOUCH _UxGT("BLTouch") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") #define MSG_BLTOUCH_RESET _UxGT("BLTouch Reset") @@ -295,36 +245,29 @@ #define MSG_BABYSTEP_Z _UxGT("Babystep Z") #define MSG_ENDSTOP_ABORT _UxGT("Endstop zastavil") #define MSG_HEATING_FAILED_LCD _UxGT("Chyba ohrevu") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Chyba ohrevu podl.") #define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEPLOTA") #define MSG_THERMAL_RUNAWAY _UxGT("TEPLOTNÝ SKOK") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("TEPLOTNÝ SKOK PODL.") #define MSG_ERR_MAXTEMP _UxGT("VYSOKÁ TEPLOTA") #define MSG_ERR_MINTEMP _UxGT("NÍZKA TEPLOTA") #define MSG_ERR_MAXTEMP_BED _UxGT("VYS. TEPL. PODL.") #define MSG_ERR_MINTEMP_BED _UxGT("NÍZ. TEPL. PODL.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z ZAKÁZANÉ") #define MSG_HALTED _UxGT("TLAČ. ZASTAVENÁ") #define MSG_PLEASE_RESET _UxGT("Spravte reset") #define MSG_SHORT_DAY _UxGT("d") #define MSG_SHORT_HOUR _UxGT("h") #define MSG_SHORT_MINUTE _UxGT("m") #define MSG_HEATING _UxGT("Ohrev...") -#define MSG_COOLING _UxGT("Ochladzovanie...") -#define MSG_BED_HEATING _UxGT("Ohrev podl...") -#define MSG_BED_COOLING _UxGT("Ochladzovanie podl...") +#define MSG_HEATING_COMPLETE _UxGT("Ohrev prebehol.") +#define MSG_BED_HEATING _UxGT("Ohrev podl.") +#define MSG_BED_DONE _UxGT("Podložka hotová.") #define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrácia") #define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrovať X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrovať Y") #define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibrovať Z") #define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibrovať Stred") -#define MSG_DELTA_SETTINGS _UxGT("Delta nastavenia") #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Autokalibrácia") #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Nast.výšku delty") -#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Offset sondy Z") -#define MSG_DELTA_DIAG_ROD _UxGT("Diag rameno") -#define MSG_DELTA_HEIGHT _UxGT("Výška") -#define MSG_DELTA_RADIUS _UxGT("Polomer") #define MSG_INFO_MENU _UxGT("O tlačiarni") #define MSG_INFO_PRINTER_MENU _UxGT("Info o tlačiarni") #define MSG_3POINT_LEVELING _UxGT("3-bodové rovnanie") @@ -362,16 +305,12 @@ #define MSG_DAC_PERCENT _UxGT("Motor %") #define MSG_DAC_EEPROM_WRITE _UxGT("Uložiť do EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("PAUZA TLAČE") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("ZAVEDENIE FILAMENTU") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("VYSUNUTIE FILAMENTU") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PAUZA TLAČE") #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("MOŽN. POKRAČ.:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Vytlačiť viacej") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Ešte vytlačiť") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Obnoviť tlač") +#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Min. teplota je ") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Tryska: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Parkovanie zlyhalo") -#define MSG_ERR_PROBING_FAILED _UxGT("Kalibrácia zlyhala") -#define MSG_M600_TOO_COLD _UxGT("M600: Príliž studený") #if LCD_HEIGHT >= 4 // Up to 3 lines allowed @@ -391,8 +330,9 @@ #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Čakajte prosím") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("na zavedenie") #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Čakajte na") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("vytlačenie") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Čakajte prosím") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("na vytlačenie") + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 _UxGT("filamentu") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Čakajte prosím") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("na pokračovanie") #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("tlače") @@ -403,7 +343,7 @@ #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte, kliknite") #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Ohrev...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Zavádzanie...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vytlačovanie...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Vytlačovanie...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Pokračovanie...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_tr.h b/Marlin/language_tr.h index 6234d14..daaa4c5 100644 --- a/Marlin/language_tr.h +++ b/Marlin/language_tr.h @@ -32,7 +32,6 @@ #define MAPPER_C2C3_TR #define DISPLAY_CHARSET_ISO10646_TR -#define CHARSIZE 2 #if DISABLED(DOGLCD) #error "Turkish needs a graphical display." @@ -52,7 +51,6 @@ #define MSG_AUTO_HOME_X _UxGT("X Sıfırla") // X Sıfırla #define MSG_AUTO_HOME_Y _UxGT("Y Sıfırla") // Y Sıfırla #define MSG_AUTO_HOME_Z _UxGT("Z Sıfırla") // Z Sıfırla -#define MSG_TMC_Z_CALIBRATION _UxGT("Ayarla Z") // Ayarla Z #define MSG_LEVEL_BED_HOMING _UxGT("XYZ Sıfırlanıyor") // XYZ Sıfırlanıyor #define MSG_LEVEL_BED_WAITING _UxGT("Başlatmak için tıkla") // Başlatmak için tıkla #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Sıradaki Nokta") // Sıradaki Nokta @@ -109,15 +107,9 @@ #define MSG_SELECT _UxGT("Seç") // Seç #define MSG_ACC _UxGT("İvme") // İvme #define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif +#define MSG_VX_JERK _UxGT("Vx-Jerk") // Vx-Jerk +#define MSG_VY_JERK _UxGT("Vy-Jerk") // Vy-Jerk +#define MSG_VZ_JERK _UxGT("Vz-jerk") // Vz-Jerk #define MSG_VE_JERK _UxGT("Ve-jerk") // Ve-Jerk #define MSG_VMAX _UxGT("Vmax ") // Vmax #define MSG_VMIN _UxGT("Vmin") // Vmin @@ -125,16 +117,10 @@ #define MSG_AMAX _UxGT("Amax ") // Amax #define MSG_A_RETRACT _UxGT("A-retract") // A-retract #define MSG_A_TRAVEL _UxGT("A-travel") // A-travel -#define MSG_STEPS_PER_MM _UxGT("Steps/mm") // Steps/mm -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Asteps/mm") - #define MSG_BSTEPS _UxGT("Bsteps/mm") - #define MSG_CSTEPS _UxGT("Csteps/mm") -#else - #define MSG_ASTEPS _UxGT("Xsteps/mm") - #define MSG_BSTEPS _UxGT("Ysteps/mm") - #define MSG_CSTEPS _UxGT("Zsteps/mm") -#endif +#define MSG_STEPS_PER_MM _UxGT("Steps/mm") // Xsteps/mm +#define MSG_XSTEPS _UxGT("Xsteps/mm") // Xsteps/mm +#define MSG_YSTEPS _UxGT("Ysteps/mm") // Ysteps/mm +#define MSG_ZSTEPS _UxGT("Zsteps/mm") // Zsteps/mm #define MSG_ESTEPS _UxGT("Esteps/mm") // Esteps/mm #define MSG_E1STEPS _UxGT("E1steps/mm") // E1steps/mm #define MSG_E2STEPS _UxGT("E2steps/mm") // E2steps/mm @@ -162,6 +148,7 @@ #define MSG_NO_CARD _UxGT("SD Kart Yok") // SD Kart Yok #define MSG_DWELL _UxGT("Uyku...") // Uyku... #define MSG_USERWAIT _UxGT("Operatör bekleniyor...") // Operatör bekleniyor... +#define MSG_RESUMING _UxGT("Baskı Sürdürülüyor") // Baskı Sürdürülüyor #define MSG_PRINT_ABORTED _UxGT("Baskı Durduruldu") // Baskı Durduruldu #define MSG_NO_MOVE _UxGT("İşlem yok.") // İşlem yok. #define MSG_KILLED _UxGT("Kilitlendi. ") // Kilitlendi. @@ -194,14 +181,16 @@ #define MSG_ERR_MINTEMP _UxGT("Hata: MINSICAKLIK") // Hata: MINSICAKLIK #define MSG_ERR_MAXTEMP_BED _UxGT("Hata: MAXSIC. TABLA") // Hata: MAXSIC. TABLA #define MSG_ERR_MINTEMP_BED _UxGT("Hata: MINSIC. TABLA") // Hata: MINSIC. TABLA -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z Yapılamaz") // G28 Z Yapılamaz #define MSG_HALTED _UxGT("YAZICI DURDURULDU") // YAZICI DURDURULDU #define MSG_PLEASE_RESET _UxGT("Lütfen resetleyin") // Lütfen resetleyin #define MSG_SHORT_DAY _UxGT("G") // One character only // G #define MSG_SHORT_HOUR _UxGT("S") // One character only // S #define MSG_SHORT_MINUTE _UxGT("D") // One character only // D #define MSG_HEATING _UxGT("Isınıyor...") // Isınıyor... -#define MSG_BED_HEATING _UxGT("Tabla Isınıyor...") // Tabla Isınıyor... +#define MSG_HEATING_COMPLETE _UxGT("Isınma tamam.") // Isınma tamam. +#define MSG_BED_HEATING _UxGT("Tabla Isınıyor.") // Tabla Isınıyor. +#define MSG_BED_DONE _UxGT("Tabla hazır.") // Tabla hazır. #define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrasyonu") // Delta Kalibrasyonu #define MSG_DELTA_CALIBRATE_X _UxGT("Ayarla X") // Ayarla X #define MSG_DELTA_CALIBRATE_Y _UxGT("Ayarla Y") // Ayarla Y @@ -239,8 +228,12 @@ #define MSG_DRIVE_STRENGTH _UxGT("Sürücü Gücü") // Sürücü Gücü #define MSG_DAC_PERCENT _UxGT("Sürücü %") // Sürücü % +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Seçenekler:") // Seçenekler: +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Daha Akıt") // Daha Akıt #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Baskıyı sürdür") // Baskıyı sürdür +#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Min. Sıcaklık") // Min. Sıcaklık: #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozül: ") // Nozül: #if LCD_HEIGHT >= 4 @@ -259,6 +252,8 @@ #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Lütfen Bekleyin...") // Lütfen Bekleyin... #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Bekleniyor") // Bekleniyor #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filamanın yüklenmesi") // filamanın yüklenmesi + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Bekleniyor") // Bekleniyor + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("filaman akması") // filaman akması #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Baskının sürdürülmesini") // Baskının sürdürülmesini #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("bekle") // bekle #else // LCD_HEIGHT < 4 @@ -267,6 +262,7 @@ #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Çıkartılıyor...") // Çıkartılıyor... #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Yükle ve bas") // Yükle ve bas #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Yüklüyor...") // Yüklüyor... + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Akıtılıyor...") // Akıtılıyor... #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Sürdürülüyor...") // Sürdürülüyor... #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_uk.h b/Marlin/language_uk.h index ed71d1a..e687e49 100644 --- a/Marlin/language_uk.h +++ b/Marlin/language_uk.h @@ -32,7 +32,6 @@ #define MAPPER_D0D1 // For Cyrillic #define DISPLAY_CHARSET_ISO10646_5 -#define CHARSIZE 2 #define WELCOME_MSG MACHINE_NAME _UxGT(" готовий.") #define MSG_SD_INSERTED _UxGT("Картка вставлена") @@ -45,7 +44,6 @@ #define MSG_AUTO_HOME_X _UxGT("Паркування X") #define MSG_AUTO_HOME_Y _UxGT("Паркування Y") #define MSG_AUTO_HOME_Z _UxGT("Паркування Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Калібрування Z") #define MSG_LEVEL_BED_HOMING _UxGT("Паркування XYZ") #define MSG_LEVEL_BED_WAITING _UxGT("Почати") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Слідуюча Точка") @@ -98,15 +96,9 @@ #define MSG_SELECT _UxGT("Вибрати") #define MSG_ACC _UxGT("Приск.") #define MSG_JERK _UxGT("Ривок") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-ривок") - #define MSG_VB_JERK _UxGT("Vb-ривок") - #define MSG_VC_JERK _UxGT("Vc-ривок") -#else - #define MSG_VA_JERK _UxGT("Vx-ривок") - #define MSG_VB_JERK _UxGT("Vy-ривок") - #define MSG_VC_JERK _UxGT("Vz-ривок") -#endif +#define MSG_VX_JERK _UxGT("Vx-ривок") +#define MSG_VY_JERK _UxGT("Vy-ривок") +#define MSG_VZ_JERK _UxGT("Vz-ривок") #define MSG_VE_JERK _UxGT("Ve-ривок") #define MSG_VMAX _UxGT("Vмакс") #define MSG_VMIN _UxGT("Vмін") @@ -115,15 +107,9 @@ #define MSG_A_RETRACT _UxGT("A-втягув.") #define MSG_A_TRAVEL _UxGT("A-руху") #define MSG_STEPS_PER_MM _UxGT("Кроків/мм") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Aкроків/мм") - #define MSG_BSTEPS _UxGT("Bкроків/мм") - #define MSG_CSTEPS _UxGT("Cкроків/мм") -#else - #define MSG_ASTEPS _UxGT("Xкроків/мм") - #define MSG_BSTEPS _UxGT("Yкроків/мм") - #define MSG_CSTEPS _UxGT("Zкроків/мм") -#endif +#define MSG_XSTEPS _UxGT("Xкроків/мм") +#define MSG_YSTEPS _UxGT("Yкроків/мм") +#define MSG_ZSTEPS _UxGT("Zкроків/мм") #define MSG_ESTEPS _UxGT("Eкроків/мм") #define MSG_E1STEPS _UxGT("E1кроків/мм") #define MSG_E2STEPS _UxGT("E2кроків/мм") @@ -150,6 +136,7 @@ #define MSG_NO_CARD _UxGT("Відсутня SD карт.") #define MSG_DWELL _UxGT("Сплячка...") #define MSG_USERWAIT _UxGT("Очікування дій...") +#define MSG_RESUMING _UxGT("Відновлення друку") #define MSG_PRINT_ABORTED _UxGT("Друк скасовано") #define MSG_NO_MOVE _UxGT("Немає руху.") #define MSG_KILLED _UxGT("ПЕРЕРВАНО. ") @@ -169,14 +156,16 @@ #define MSG_ENDSTOP_ABORT _UxGT("невдача кінцевика") #define MSG_HEATING_FAILED_LCD _UxGT("Невдалий нагрів") #define MSG_THERMAL_RUNAWAY _UxGT("ЗБІЙ ТЕМПЕРАТУРИ") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("G28 Z Відмовлено") #define MSG_HALTED _UxGT("ПРИНТЕР ЗУПИНЕНО") #define MSG_PLEASE_RESET _UxGT("Перезавантажте") #define MSG_SHORT_DAY _UxGT("д") // One character only #define MSG_SHORT_HOUR _UxGT("г") // One character only #define MSG_SHORT_MINUTE _UxGT("х") // One character only #define MSG_HEATING _UxGT("Нагрівання...") -#define MSG_BED_HEATING _UxGT("Нагрівання столу...") +#define MSG_HEATING_COMPLETE _UxGT("Нагріто.") +#define MSG_BED_HEATING _UxGT("Нагрівання столу.") +#define MSG_BED_DONE _UxGT("Стіл нагрітий.") #define MSG_DELTA_CALIBRATE _UxGT("Калібр. Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Калібрування X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Калібрування Y") @@ -215,6 +204,9 @@ #define MSG_DAC_PERCENT _UxGT("% мотору") #define MSG_DAC_EEPROM_WRITE _UxGT("Запис ЦАП на ПЗП") +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Екструдувати") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Відновити друк") #if LCD_HEIGHT >= 4 @@ -229,6 +221,9 @@ #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("продовження...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Зачекайте на") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("ввід волокна") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Зачекайте на") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("екструзію") + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 _UxGT("волокна") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Зачекайте на") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("відновлення") #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("друку") @@ -238,6 +233,7 @@ #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Вивід...") #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Вставте і нат.") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ввід...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Екструзія...") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Відновлення...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_zh_CN.h b/Marlin/language_zh_CN.h index 214c345..af5454b 100644 --- a/Marlin/language_zh_CN.h +++ b/Marlin/language_zh_CN.h @@ -30,28 +30,21 @@ #ifndef LANGUAGE_ZH_CN_H #define LANGUAGE_ZH_CN_H -#define CHARSIZE 3 - #define WELCOME_MSG MACHINE_NAME _UxGT("已就绪.") //" ready." -#define MSG_BACK _UxGT("返回") // ”Back“ #define MSG_SD_INSERTED _UxGT("存储卡已插入") //"Card inserted" #define MSG_SD_REMOVED _UxGT("存储卡被拔出") //"Card removed" #define MSG_LCD_ENDSTOPS _UxGT("挡块") //"Endstops" // Max length 8 characters #define MSG_MAIN _UxGT("主菜单") //"Main" #define MSG_AUTOSTART _UxGT("自动开始") //"Autostart" #define MSG_DISABLE_STEPPERS _UxGT("关闭步进电机") //"Disable steppers" -#define MSG_DEBUG_MENU _UxGT("调试菜单") // "Debug Menu" -#define MSG_PROGRESS_BAR_TEST _UxGT("进度条测试") // "Progress Bar Test" #define MSG_AUTO_HOME _UxGT("回原点") //"Auto home" #define MSG_AUTO_HOME_X _UxGT("回X原位") //"Home X" #define MSG_AUTO_HOME_Y _UxGT("回Y原位") //"Home Y" #define MSG_AUTO_HOME_Z _UxGT("回Z原位") //"Home Z" -#define MSG_TMC_Z_CALIBRATION _UxGT("⊿校准Z") //"Calibrate Z" #define MSG_LEVEL_BED_HOMING _UxGT("平台调平XYZ归原位") //"Homing XYZ" #define MSG_LEVEL_BED_WAITING _UxGT("单击开始热床调平") //"Click to Begin" #define MSG_LEVEL_BED_NEXT_POINT _UxGT("下个热床调平点") //"Next Point" #define MSG_LEVEL_BED_DONE _UxGT("完成热床调平") //"Leveling Done!" -#define MSG_Z_FADE_HEIGHT _UxGT("淡出高度") // "Fade Height" #define MSG_SET_HOME_OFFSETS _UxGT("设置原点偏移") //"Set home offsets" #define MSG_HOME_OFFSETS_APPLIED _UxGT("偏移已启用") //"Offsets applied" #define MSG_SET_ORIGIN _UxGT("设置原点") //"Set origin" @@ -73,95 +66,6 @@ #define MSG_MOVE_AXIS _UxGT("移动轴") //"Move axis" #define MSG_BED_LEVELING _UxGT("调平热床") //"Bed leveling" #define MSG_LEVEL_BED _UxGT("调平热床") //"Level bed" -#define MSG_LEVEL_CORNERS _UxGT("调平边角") // "Level corners" - -#define MSG_NEXT_CORNER _UxGT("下个边角") // "Next corner" -#define MSG_EDITING_STOPPED _UxGT("网格编辑已停止") // "Mesh Editing Stopped" - -#define MSG_USER_MENU _UxGT("定制命令") // "Custom Commands" -#define MSG_UBL_DOING_G29 _UxGT("执行G29") // "Doing G29" -#define MSG_UBL_UNHOMED _UxGT("先回XYZ原点") // "Home XYZ first" -#define MSG_UBL_TOOLS _UxGT("UBL工具") // "UBL Tools" -#define MSG_UBL_LEVEL_BED _UxGT("统一热床调平(UBL)") // "Unified Bed Leveling" -#define MSG_UBL_MANUAL_MESH _UxGT("手工创设网格") // "Manually Build Mesh" - -#define MSG_UBL_BC_INSERT _UxGT("放置垫片并测量") // "Place shim & measure" -#define MSG_UBL_BC_INSERT2 _UxGT("测量") // "Measure" -#define MSG_UBL_BC_REMOVE _UxGT("移除并测量热床") // "Remove & measure bed" -#define MSG_UBL_MOVING_TO_NEXT _UxGT("移动到下一个") // "Moving to next" -#define MSG_UBL_ACTIVATE_MESH _UxGT("激活UBL") // "Activate UBL" -#define MSG_UBL_DEACTIVATE_MESH _UxGT("关闭UBL") // "Deactivate UBL" -#define MSG_UBL_SET_BED_TEMP _UxGT("设置热床温度") // "Bed Temp" -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("热端温度") // "Hotend Temp" -#define MSG_UBL_MESH_EDIT _UxGT("网格编辑") // "Mesh Edit" -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("编辑客户网格") // "Edit Custom Mesh" -#define MSG_UBL_FINE_TUNE_MESH _UxGT("细调网格") // "Fine Tuning Mesh" -#define MSG_UBL_DONE_EDITING_MESH _UxGT("完成编辑网格") // "Done Editing Mesh" -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("创设客户网格") // "Build Custom Mesh" -#define MSG_UBL_BUILD_MESH_MENU _UxGT("创设网格") // "Build Mesh" -#define MSG_UBL_BUILD_PLA_MESH _UxGT("创设PLA网格") // "Build PLA Mesh" -#define MSG_UBL_BUILD_ABS_MESH _UxGT("创设ABS网格") // "Build ABS Mesh" -#define MSG_UBL_BUILD_COLD_MESH _UxGT("创设冷网格") // "Build Cold Mesh" -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("调整网格高度") // "Adjust Mesh Height" -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("高度合计") // "Height Amount" -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("批准网格") // "Validate Mesh" -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("批准PLA网格") // "Validate PLA Mesh" -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("批准ABS网格") // "Validate ABS Mesh" -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("批准客户网格") // "Validate Custom Mesh" -#define MSG_UBL_CONTINUE_MESH _UxGT("继续热床网格") // "Continue Bed Mesh" -#define MSG_UBL_MESH_LEVELING _UxGT("网格调平") // "Mesh Leveling" -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("三点调平") // "3-Point Leveling" -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("格子网格调平") // "Grid Mesh Leveling" -#define MSG_UBL_MESH_LEVEL _UxGT("调平网格") // "Level Mesh" -#define MSG_UBL_SIDE_POINTS _UxGT("边点") // "Side Points" -#define MSG_UBL_MAP_TYPE _UxGT("图类型") // "Map Type" -#define MSG_UBL_OUTPUT_MAP _UxGT("输出网格图") // "Output Mesh Map" -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("输出到主机") // "Output for Host" -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("输出到CSV") // "Output for CSV" -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("输出到备份") // "Off Printer Backup" -#define MSG_UBL_INFO_UBL _UxGT("输出UBL信息") // "Output UBL Info" -#define MSG_UBL_EDIT_MESH_MENU _UxGT("编辑网格") // "Edit Mesh" -#define MSG_UBL_FILLIN_AMOUNT _UxGT("填充合计") // "Fill-in Amount" -#define MSG_UBL_MANUAL_FILLIN _UxGT("手工填充") // "Manual Fill-in" -#define MSG_UBL_SMART_FILLIN _UxGT("聪明填充") // "Smart Fill-in" -#define MSG_UBL_FILLIN_MESH _UxGT("填充网格") // "Fill-in Mesh" -#define MSG_UBL_INVALIDATE_ALL _UxGT("作废所有的") // "Invalidate All" -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("作废最近的") // "Invalidate Closest" -#define MSG_UBL_FINE_TUNE_ALL _UxGT("细调所有的") // "Fine Tune All" -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("细调最近的") // "Fine Tune Closest" -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("网格存储") // "Mesh Storage" -#define MSG_UBL_STORAGE_SLOT _UxGT("存储槽") // "Memory Slot" -#define MSG_UBL_LOAD_MESH _UxGT("装载热床网格") // "Load Bed Mesh" -#define MSG_UBL_SAVE_MESH _UxGT("保存热床网格") // "Save Bed Mesh" -#define MSG_MESH_LOADED _UxGT("网格 %i 已装载") // "Mesh %i loaded" -#define MSG_MESH_SAVED _UxGT("网格 %i 已保存") // "Mesh %i saved" -#define MSG_NO_STORAGE _UxGT("没有存储") // "No storage" -#define MSG_UBL_SAVE_ERROR _UxGT("错误: UBL保存") // "Err: UBL Save" -#define MSG_UBL_RESTORE_ERROR _UxGT("错误: UBL还原") // "Err: UBL Restore" -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z偏移已停止") // "Z-Offset Stopped" -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("一步步UBL") // "Step-By-Step UBL" - -#define MSG_LED_CONTROL _UxGT("灯管控制") // "LED Control") -#define MSG_LEDS _UxGT("灯") // "Lights") -#define MSG_LED_PRESETS _UxGT("灯预置") // "Light Presets") -#define MSG_SET_LEDS_RED _UxGT("红") // "Red") -#define MSG_SET_LEDS_ORANGE _UxGT("橙") // "Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("黄") // "Yellow") -#define MSG_SET_LEDS_GREEN _UxGT("绿") // "Green") -#define MSG_SET_LEDS_BLUE _UxGT("蓝") // "Blue") -#define MSG_SET_LEDS_INDIGO _UxGT("青") // "Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("紫") // "Violet") -#define MSG_SET_LEDS_WHITE _UxGT("白") // "White") -#define MSG_SET_LEDS_DEFAULT _UxGT("缺省") // "Default") -#define MSG_CUSTOM_LEDS _UxGT("定制灯") // "Custom Lights") -#define MSG_INTENSITY_R _UxGT("红饱和度") // "Red Intensity") -#define MSG_INTENSITY_G _UxGT("绿饱和度") // "Green Intensity") -#define MSG_INTENSITY_B _UxGT("蓝饱和度") // "Blue Intensity") -#define MSG_INTENSITY_W _UxGT("白饱和度") // "White Intensity") -#define MSG_LED_BRIGHTNESS _UxGT("亮度") // "Brightness") -#define MSG_MOVING _UxGT("移动 ...") // "Moving...") -#define MSG_FREE_XY _UxGT("释放 XY") // "Free XY") - #define MSG_MOVE_X _UxGT("移动X") //"Move X" #define MSG_MOVE_Y _UxGT("移动Y") //"Move Y" #define MSG_MOVE_Z _UxGT("移动Z") //"Move Z" @@ -174,7 +78,6 @@ #define MSG_NOZZLE _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 喷嘴") //"Nozzle" 噴嘴 #define MSG_BED _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 热床") //"Bed" #define MSG_FAN_SPEED _UxGT("风扇速率") //"Fan speed" -#define MSG_EXTRA_FAN_SPEED _UxGT("额外风扇速率") // "Extra fan speed" #define MSG_FLOW _UxGT("挤出速率") //"Flow" #define MSG_CONTROL _UxGT("控制") //"Control" #define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最小") //" " LCD_STR_THERMOMETER " Min" @@ -190,53 +93,30 @@ #define MSG_SELECT _UxGT("选择") //"Select" #define MSG_ACC _UxGT("加速度") //"Accel" acceleration #define MSG_JERK _UxGT("抖动速率") // "Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("A轴抖动速率") //"Va-jerk" - #define MSG_VB_JERK _UxGT("B轴抖动速率") //"Vb-jerk" - #define MSG_VC_JERK _UxGT("C轴抖动速率") //"Vc-jerk" -#else - #define MSG_VA_JERK _UxGT("X轴抖动速率") //"Vx-jerk" - #define MSG_VB_JERK _UxGT("Y轴抖动速率") //"Vy-jerk" - #define MSG_VC_JERK _UxGT("Z轴抖动速率") //"Vz-jerk" -#endif +#define MSG_VX_JERK _UxGT("X轴抖动速率") //"Vx-jerk" +#define MSG_VY_JERK _UxGT("Y轴抖动速率") //"Vy-jerk" +#define MSG_VZ_JERK _UxGT("Z轴抖动速率") //"Vz-jerk" #define MSG_VE_JERK _UxGT("挤出机抖动速率") //"Ve-jerk" -#define MSG_VELOCITY _UxGT("速度") // "Velocity" #define MSG_VMAX _UxGT("最大进料速率") //"Vmax " max_feedrate_mm_s #define MSG_VMIN _UxGT("最小进料速率") //"Vmin" min_feedrate_mm_s #define MSG_VTRAV_MIN _UxGT("最小移动速率") //"VTrav min" min_travel_feedrate_mm_s, (target) speed of the move -#define MSG_ACCELERATION _UxGT("加速度") // "Acceleration" #define MSG_AMAX _UxGT("最大打印加速度") //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves #define MSG_A_RETRACT _UxGT("收进加速度") //"A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts #define MSG_A_TRAVEL _UxGT("非打印移动加速度") //"A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves #define MSG_STEPS_PER_MM _UxGT("轴步数/mm") //"Steps/mm" axis_steps_per_mm, axis steps-per-unit G92 -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A轴步数/mm") //"Asteps/mm" - #define MSG_BSTEPS _UxGT("B轴步数/mm") //"Bsteps/mm" - #define MSG_CSTEPS _UxGT("C轴步数/mm") //"Csteps/mm" -#else - #define MSG_ASTEPS _UxGT("X轴步数/mm") //"Xsteps/mm" - #define MSG_BSTEPS _UxGT("Y轴步数/mm") //"Ysteps/mm" - #define MSG_CSTEPS _UxGT("Z轴步数/mm") //"Zsteps/mm" -#endif +#define MSG_XSTEPS _UxGT("X轴步数/mm") //"Xsteps/mm" axis_steps_per_mm, axis steps-per-unit G92 +#define MSG_YSTEPS _UxGT("Y轴步数/mm") //"Ysteps/mm" +#define MSG_ZSTEPS _UxGT("Z轴步数/mm") //"Zsteps/mm" #define MSG_ESTEPS _UxGT("挤出机步数/mm") //"Esteps/mm" -#define MSG_E1STEPS _UxGT("挤出机1步数/mm") //"E1steps/mm" -#define MSG_E2STEPS _UxGT("挤出机2步数/mm") //"E2steps/mm" -#define MSG_E3STEPS _UxGT("挤出机3步数/mm") //"E3steps/mm" -#define MSG_E4STEPS _UxGT("挤出机4步数/mm") //"E4steps/mm" -#define MSG_E5STEPS _UxGT("挤出机5步数/mm") //"E5steps/mm" #define MSG_TEMPERATURE _UxGT("温度") //"Temperature" #define MSG_MOTION _UxGT("运动") //"Motion" #define MSG_FILAMENT _UxGT("丝料测容") //"Filament" lcd_control_volumetric_menu #define MSG_VOLUMETRIC_ENABLED _UxGT("测容积mm³") //"E in mm3" volumetric_enabled #define MSG_FILAMENT_DIAM _UxGT("丝料直径") //"Fil. Dia." -#define MSG_FILAMENT_UNLOAD _UxGT("卸载 mm") // "Unload mm" -#define MSG_FILAMENT_LOAD _UxGT("装载 mm") // "Load mm" -#define MSG_ADVANCE_K _UxGT("Advance K") // "Advance K" #define MSG_CONTRAST _UxGT("LCD对比度") //"LCD contrast" #define MSG_STORE_EEPROM _UxGT("保存设置") //"Store memory" #define MSG_LOAD_EEPROM _UxGT("装载设置") //"Load memory" #define MSG_RESTORE_FAILSAFE _UxGT("恢复安全值") //"Restore failsafe" -#define MSG_INIT_EEPROM _UxGT("初始化设置") // "Initialize EEPROM" #define MSG_REFRESH _UxGT("刷新") //"Refresh" #define MSG_WATCH _UxGT("信息屏") //"Info screen" #define MSG_PREPARE _UxGT("准备") //"Prepare" @@ -247,9 +127,9 @@ #define MSG_CARD_MENU _UxGT("从存储卡上打印") //"Print from SD" #define MSG_NO_CARD _UxGT("无存储卡") //"No SD card" #define MSG_DWELL _UxGT("休眠中 ...") //"Sleep..." -#define MSG_USERWAIT _UxGT("点击继续 ...") //"Click to resume..." -#define MSG_PRINT_PAUSED _UxGT("暫停打印") // "Print paused" -#define MSG_PRINT_ABORTED _UxGT("已取消打印") //"Print aborted" +#define MSG_USERWAIT _UxGT("等待用户 ...") //"Wait for user..." +#define MSG_RESUMING _UxGT("恢复打印中") //"Resuming print" +#define MSG_PRINT_ABORTED _UxGT("打印已取消") //"Print aborted" #define MSG_NO_MOVE _UxGT("无移动") //"No move." #define MSG_KILLED _UxGT("已杀掉") //"KILLED. " #define MSG_STOPPED _UxGT("已停止") //"STOPPED. " @@ -260,21 +140,11 @@ #define MSG_CONTROL_RETRACT_RECOVER _UxGT("回抽恢复长度mm") //"UnRet +mm" retract_recover_length, additional recover length (mm, added to retract length when recovering) #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("换手回抽恢复长度mm") //"S UnRet+mm" swap_retract_recover_length, additional swap recover length (mm, added to retract length when recovering from extruder change) #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("回抽恢复后进料速率mm/s") //"UnRet V" retract_recover_feedrate_mm_s, feedrate for recovering from retraction (mm/s) -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") // "S UnRet V" #define MSG_AUTORETRACT _UxGT("自动抽回") //"AutoRetr." autoretract_enabled, #define MSG_FILAMENTCHANGE _UxGT("更换丝料") //"Change filament" -#define MSG_FILAMENTLOAD _UxGT("装载丝料") // "Load filament" -#define MSG_FILAMENTUNLOAD _UxGT("卸载丝料") // "Unload filament" -#define MSG_FILAMENTUNLOAD_ALL _UxGT("卸载全部") // "Unload All" #define MSG_INIT_SDCARD _UxGT("初始化存储卡") //"Init. SD card" #define MSG_CNG_SDCARD _UxGT("更换存储卡") //"Change SD card" #define MSG_ZPROBE_OUT _UxGT("Z探针在热床之外") //"Z probe out. bed" Z probe is not within the physical limits -#define MSG_SKEW_FACTOR _UxGT("偏斜因数") // "Skew Factor" -#define MSG_BLTOUCH _UxGT("BLTouch") // "BLTouch" -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch 自检") // "BLTouch Self-Test" -#define MSG_BLTOUCH_RESET _UxGT("重置BLTouch") // "Reset BLTouch" -#define MSG_BLTOUCH_DEPLOY _UxGT("部署BLTouch") // "Deploy BLTouch" -#define MSG_BLTOUCH_STOW _UxGT("装载BLTouch") // "Stow BLTouch" #define MSG_HOME _UxGT("归位") //"Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST #define MSG_FIRST _UxGT("先") //"first" #define MSG_ZPROBE_ZOFFSET _UxGT("Z偏移") //"Z Offset" @@ -289,40 +159,29 @@ #define MSG_ERR_MINTEMP _UxGT("错误:最低温度") //"Err: MINTEMP" #define MSG_ERR_MAXTEMP_BED _UxGT("错误:最高热床温度") //"Err: MAXTEMP BED" #define MSG_ERR_MINTEMP_BED _UxGT("错误:最低热床温度") //"Err: MINTEMP BED" -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST #define MSG_HALTED _UxGT("打印停机") //"PRINTER HALTED" #define MSG_PLEASE_RESET _UxGT("请重置") //"Please reset" #define MSG_SHORT_DAY _UxGT("天") //"d" // One character only #define MSG_SHORT_HOUR _UxGT("时") //"h" // One character only #define MSG_SHORT_MINUTE _UxGT("分") //"m" // One character only #define MSG_HEATING _UxGT("加热中 ...") //"Heating..." -#define MSG_BED_HEATING _UxGT("加热热床中...") //"Bed Heating..." +#define MSG_HEATING_COMPLETE _UxGT("完成加热") //"Heating done." +#define MSG_BED_HEATING _UxGT("加热热床中") //"Bed Heating." +#define MSG_BED_DONE _UxGT("完成加热热床") //"Bed done." #define MSG_DELTA_CALIBRATE _UxGT("⊿校准") //"Delta Calibration" -#define MSG_DELTA_CALIBRATE_X _UxGT("⊿校准X") //"Calibrate X" -#define MSG_DELTA_CALIBRATE_Y _UxGT("⊿校准Y") //"Calibrate Y" -#define MSG_DELTA_CALIBRATE_Z _UxGT("⊿校准Z") //"Calibrate Z" -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("⊿校准中心") //"Calibrate Center" -#define MSG_DELTA_SETTINGS _UxGT("⊿设置") // "Delta Settings" -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("⊿自动校准") // "Auto Calibration" -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("设置⊿高度") // "Set Delta Height" -#define MSG_DELTA_DIAG_ROD _UxGT("⊿斜柱") // "Diag Rod" -#define MSG_DELTA_HEIGHT _UxGT("⊿高度") // "Height" -#define MSG_DELTA_RADIUS _UxGT("⊿半径") // "Radius" +#define MSG_DELTA_CALIBRATE_X _UxGT("校准X") //"Calibrate X" +#define MSG_DELTA_CALIBRATE_Y _UxGT("校准Y") //"Calibrate Y" +#define MSG_DELTA_CALIBRATE_Z _UxGT("校准Z") //"Calibrate Z" +#define MSG_DELTA_CALIBRATE_CENTER _UxGT("校准中心") //"Calibrate Center" + #define MSG_INFO_MENU _UxGT("关于打印机") //"About Printer" #define MSG_INFO_PRINTER_MENU _UxGT("打印机信息") //"Printer Info" -#define MSG_3POINT_LEVELING _UxGT("三点调平") // "3-Point Leveling" -#define MSG_LINEAR_LEVELING _UxGT("线性调平") // "Linear Leveling" -#define MSG_BILINEAR_LEVELING _UxGT("双线性调平") // "Bilinear Leveling" -#define MSG_UBL_LEVELING _UxGT("统一热床调平(UBL)") // "Unified Bed Leveling" -#define MSG_MESH_LEVELING _UxGT("网格调平") // "Mesh Leveling" #define MSG_INFO_STATS_MENU _UxGT("打印机统计") //"Printer Stats" #define MSG_INFO_BOARD_MENU _UxGT("主板信息") //"Board Info" #define MSG_INFO_THERMISTOR_MENU _UxGT("温度计") //"Thermistors" #define MSG_INFO_EXTRUDERS _UxGT("挤出机") //"Extruders" #define MSG_INFO_BAUDRATE _UxGT("波特率") //"Baud" #define MSG_INFO_PROTOCOL _UxGT("协议") //"Protocol" -#define MSG_CASE_LIGHT _UxGT("外壳灯") // "Case light" -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("灯亮度") // "Light BRIGHTNESS" #if LCD_WIDTH > 19 #define MSG_INFO_PRINT_COUNT _UxGT("打印计数") //"Print Count" @@ -341,19 +200,11 @@ #define MSG_INFO_MIN_TEMP _UxGT("最低温度") //"Min Temp" #define MSG_INFO_MAX_TEMP _UxGT("最高温度") //"Max Temp" #define MSG_INFO_PSU _UxGT("电源供应") //"Power Supply" -#define MSG_DRIVE_STRENGTH _UxGT("驱动力度") // "Drive Strength" -#define MSG_DAC_PERCENT _UxGT("驱动 %") // "Driver %" -#define MSG_DAC_EEPROM_WRITE _UxGT("保存驱动设置") // "DAC EEPROM Write" -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("打印已暂停") // "PRINT PAUSED" -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("装载丝料") // "LOAD FILAMENT" -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("卸载丝料") // "UNLOAD FILAMENT" -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("恢复选项:") // "RESUME OPTIONS:" -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("清除更多") // "Purge more" + +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("挤出更多") //"Extrude more" #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("恢复打印") //"Resume print" -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" 喷嘴: ") // " Nozzle: " -#define MSG_ERR_HOMING_FAILED _UxGT("归原位失败") // "Homing failed" -#define MSG_ERR_PROBING_FAILED _UxGT("探针探测失败") // "Probing failed" -#define MSG_M600_TOO_COLD _UxGT("M600: 太凉") // "M600: Too cold" #if LCD_HEIGHT >= 4 #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("等待开始") //"Wait for start" @@ -361,27 +212,26 @@ #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("变更") //"change" #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("等待") //"Wait for" #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("卸下丝料") //"filament unload" +#define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("") //"" #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("插入丝料") //"Insert filament" #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("并按键") //"and press button" #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("来继续 ...") //"to continue..." -#define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("按下按钮来") // "Press button to" -#define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("加热喷嘴.") // "heat nozzle." -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("加热喷嘴") // "Heating nozzle" -#define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("请等待 ...") // "Please wait..." #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("等待") //"Wait for" #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("进料") //"filament load" -#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("等待") // "Wait for" -#define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("丝料清除") // "filament purge" +#define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("") //"" +#define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("等待") //"Wait for" +#define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("丝料挤出") //"filament extrude" +#define MSG_FILAMENT_CHANGE_EXTRUDE_3 _UxGT("") //"" #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("等待打印") //"Wait for print" #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("恢复") //"to resume" +#define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("") //"" #else // LCD_HEIGHT < 4 #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("请等待 ...") //"Please wait..." #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("退出中 ...") //"Ejecting..." #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("插入并单击") //"Insert and Click" -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("加热中 ...") // "Heating..." #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("装载中 ...") //"Loading..." -#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("清除中 ...") // "Purging..." +#define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("挤出中 ...") //"Extruding..." #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("恢复中 ...") //"Resuming..." #endif // LCD_HEIGHT < 4 diff --git a/Marlin/language_zh_TW.h b/Marlin/language_zh_TW.h index b5a62a9..315f77f 100644 --- a/Marlin/language_zh_TW.h +++ b/Marlin/language_zh_TW.h @@ -30,28 +30,21 @@ #ifndef LANGUAGE_ZH_TW_H #define LANGUAGE_ZH_TW_H -#define CHARSIZE 3 - #define WELCOME_MSG MACHINE_NAME _UxGT("已就緒.") //" ready." -#define MSG_BACK _UxGT("返回") // ”Back“ #define MSG_SD_INSERTED _UxGT("記憶卡已插入") //"Card inserted" #define MSG_SD_REMOVED _UxGT("記憶卡被拔出") //"Card removed" #define MSG_LCD_ENDSTOPS _UxGT("擋塊") //"Endstops" // Max length 8 characters #define MSG_MAIN _UxGT("主選單") //"Main" #define MSG_AUTOSTART _UxGT("自動開始") //"Autostart" #define MSG_DISABLE_STEPPERS _UxGT("關閉步進馬達") //"Disable steppers" -#define MSG_DEBUG_MENU _UxGT("除錯選單") // "Debug Menu" -#define MSG_PROGRESS_BAR_TEST _UxGT("進度條測試") // "Progress Bar Test" #define MSG_AUTO_HOME _UxGT("自動回原點") //"Auto home" #define MSG_AUTO_HOME_X _UxGT("回X原點") //"Home X" #define MSG_AUTO_HOME_Y _UxGT("回Y原點") //"Home Y" #define MSG_AUTO_HOME_Z _UxGT("回Z原點") //"Home Z" -#define MSG_TMC_Z_CALIBRATION _UxGT("⊿校準Z") //"Calibrate Z" #define MSG_LEVEL_BED_HOMING _UxGT("平台調平XYZ歸原點") //"Homing XYZ" #define MSG_LEVEL_BED_WAITING _UxGT("單擊開始熱床調平") //"Click to Begin" #define MSG_LEVEL_BED_NEXT_POINT _UxGT("下個熱床調平點") //"Next Point" #define MSG_LEVEL_BED_DONE _UxGT("完成熱床調平") //"Leveling Done!" -#define MSG_Z_FADE_HEIGHT _UxGT("淡出高度") // "Fade Height" #define MSG_SET_HOME_OFFSETS _UxGT("設置原點偏移") //"Set home offsets" #define MSG_HOME_OFFSETS_APPLIED _UxGT("偏移已啟用") //"Offsets applied" #define MSG_SET_ORIGIN _UxGT("設置原點") //"Set origin" @@ -73,95 +66,6 @@ #define MSG_MOVE_AXIS _UxGT("移動軸") //"Move axis" #define MSG_BED_LEVELING _UxGT("調平熱床") //"Bed leveling" #define MSG_LEVEL_BED _UxGT("調平熱床") //"Level bed" -#define MSG_LEVEL_CORNERS _UxGT("調平邊角") // "Level corners" - -#define MSG_NEXT_CORNER _UxGT("下个邊角") // "Next corner" -#define MSG_EDITING_STOPPED _UxGT("網格編輯已停止") // "Mesh Editing Stopped" - -#define MSG_USER_MENU _UxGT("客制命令") // "Custom Commands" -#define MSG_UBL_DOING_G29 _UxGT("执行G29") // "Doing G29" -#define MSG_UBL_UNHOMED _UxGT("先回XYZ原點") // "Home XYZ first" -#define MSG_UBL_TOOLS _UxGT("UBL工具") // "UBL Tools" -#define MSG_UBL_LEVEL_BED _UxGT("統一熱床調平(UBL)") // "Unified Bed Leveling" -#define MSG_UBL_MANUAL_MESH _UxGT("手工建网") // "Manually Build Mesh" - -#define MSG_UBL_BC_INSERT _UxGT("放置墊片並測量") // "Place shim & measure" -#define MSG_UBL_BC_INSERT2 _UxGT("測量") // "Measure" -#define MSG_UBL_BC_REMOVE _UxGT("移除並測量熱床") // "Remove & measure bed" -#define MSG_UBL_MOVING_TO_NEXT _UxGT("移動到下一個") // "Moving to next" -#define MSG_UBL_ACTIVATE_MESH _UxGT("激活UBL") // "Activate UBL" -#define MSG_UBL_DEACTIVATE_MESH _UxGT("關閉UBL") // "Deactivate UBL" -#define MSG_UBL_SET_BED_TEMP _UxGT("設置熱床溫度") // "Bed Temp" -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("熱端溫度") // "Hotend Temp" -#define MSG_UBL_MESH_EDIT _UxGT("網格編輯") // "Mesh Edit" -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("編輯客戶網格") // "Edit Custom Mesh" -#define MSG_UBL_FINE_TUNE_MESH _UxGT("細調網格") // "Fine Tuning Mesh" -#define MSG_UBL_DONE_EDITING_MESH _UxGT("完成編輯網格") // "Done Editing Mesh" -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("創設客戶網格") // "Build Custom Mesh" -#define MSG_UBL_BUILD_MESH_MENU _UxGT("創設網格") // "Build Mesh" -#define MSG_UBL_BUILD_PLA_MESH _UxGT("創設PLA網格") // "Build PLA Mesh" -#define MSG_UBL_BUILD_ABS_MESH _UxGT("創設ABS網格") // "Build ABS Mesh" -#define MSG_UBL_BUILD_COLD_MESH _UxGT("創設冷網格") // "Build Cold Mesh" -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("調整網格高度") // "Adjust Mesh Height" -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("高度合計") // "Height Amount" -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("批准網格") // "Validate Mesh" -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("批准PLA網格") // "Validate PLA Mesh" -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("批准ABS網格") // "Validate ABS Mesh" -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("批准客戶網格") // "Validate Custom Mesh" -#define MSG_UBL_CONTINUE_MESH _UxGT("繼續熱床網格") // "Continue Bed Mesh" -#define MSG_UBL_MESH_LEVELING _UxGT("網格調平") // "Mesh Leveling" -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("三點調平") // "3-Point Leveling" -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("格子網格調平") // "Grid Mesh Leveling" -#define MSG_UBL_MESH_LEVEL _UxGT("調平網格") // "Level Mesh" -#define MSG_UBL_SIDE_POINTS _UxGT("邊點") // "Side Points" -#define MSG_UBL_MAP_TYPE _UxGT("圖類型") // "Map Type" -#define MSG_UBL_OUTPUT_MAP _UxGT("輸出網格圖") // "Output Mesh Map" -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("輸出到主機") // "Output for Host" -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("輸出到CSV") // "Output for CSV" -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("輸出到備份") // "Off Printer Backup" -#define MSG_UBL_INFO_UBL _UxGT("輸出UBL信息") // "Output UBL Info" -#define MSG_UBL_EDIT_MESH_MENU _UxGT("編輯網格") // "Edit Mesh" -#define MSG_UBL_FILLIN_AMOUNT _UxGT("填充合計") // "Fill-in Amount" -#define MSG_UBL_MANUAL_FILLIN _UxGT("手工填充") // "Manual Fill-in" -#define MSG_UBL_SMART_FILLIN _UxGT("聰明填充") // "Smart Fill-in" -#define MSG_UBL_FILLIN_MESH _UxGT("填充網格") // "Fill-in Mesh" -#define MSG_UBL_INVALIDATE_ALL _UxGT("作廢所有的") // "Invalidate All" -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("作廢最近的") // "Invalidate Closest" -#define MSG_UBL_FINE_TUNE_ALL _UxGT("細調所有的") // "Fine Tune All" -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("細調最近的") // "Fine Tune Closest" -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("網格存儲") // "Mesh Storage" -#define MSG_UBL_STORAGE_SLOT _UxGT("存儲槽") // "Memory Slot" -#define MSG_UBL_LOAD_MESH _UxGT("裝載熱床網格") // "Load Bed Mesh" -#define MSG_UBL_SAVE_MESH _UxGT("保存熱床網格") // "Save Bed Mesh" -#define MSG_MESH_LOADED _UxGT("網格 %i 已裝載") // "Mesh %i loaded" -#define MSG_MESH_SAVED _UxGT("網格 %i 已保存") // "Mesh %i saved" -#define MSG_NO_STORAGE _UxGT("沒有存儲") // "No storage" -#define MSG_UBL_SAVE_ERROR _UxGT("錯誤: UBL保存") // "Err: UBL Save" -#define MSG_UBL_RESTORE_ERROR _UxGT("錯誤: UBL還原") // "Err: UBL Restore" -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z偏移已停止") // "Z-Offset Stopped" -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("一步步UBL") // "Step-By-Step UBL" - -#define MSG_LED_CONTROL _UxGT("灯管控制") // "LED Control") -#define MSG_LEDS _UxGT("灯") // "Lights") -#define MSG_LED_PRESETS _UxGT("灯预置") // "Light Presets") -#define MSG_SET_LEDS_RED _UxGT("红") // "Red") -#define MSG_SET_LEDS_ORANGE _UxGT("橙") // "Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("黄") // "Yellow") -#define MSG_SET_LEDS_GREEN _UxGT("绿") // "Green") -#define MSG_SET_LEDS_BLUE _UxGT("蓝") // "Blue") -#define MSG_SET_LEDS_INDIGO _UxGT("青") // "Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("紫") // "Violet") -#define MSG_SET_LEDS_WHITE _UxGT("白") // "White") -#define MSG_SET_LEDS_DEFAULT _UxGT("缺省") // "Default") -#define MSG_CUSTOM_LEDS _UxGT("定制灯") // "Custom Lights") -#define MSG_INTENSITY_R _UxGT("红飽和度") // "Red Intensity") -#define MSG_INTENSITY_G _UxGT("绿飽和度") // "Green Intensity") -#define MSG_INTENSITY_B _UxGT("蓝飽和度") // "Blue Intensity") -#define MSG_INTENSITY_W _UxGT("白飽和度") // "White Intensity") -#define MSG_LED_BRIGHTNESS _UxGT("亮度") // "Brightness") -#define MSG_MOVING _UxGT("移动 ...") // "Moving...") -#define MSG_FREE_XY _UxGT("释放 XY") // "Free XY") - #define MSG_MOVE_X _UxGT("移動X") //"Move X" #define MSG_MOVE_Y _UxGT("移動Y") //"Move Y" #define MSG_MOVE_Z _UxGT("移動Z") //"Move Z" @@ -174,7 +78,6 @@ #define MSG_NOZZLE _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 噴嘴") //"Nozzle" 噴嘴 #define MSG_BED _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 熱床") //"Bed" #define MSG_FAN_SPEED _UxGT("風扇速率") //"Fan speed" -#define MSG_EXTRA_FAN_SPEED _UxGT("額外風扇速率") // "Extra fan speed" #define MSG_FLOW _UxGT("擠出速率") //"Flow" #define MSG_CONTROL _UxGT("控制") //"Control" #define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最小") //" " LCD_STR_THERMOMETER " Min" @@ -190,53 +93,30 @@ #define MSG_SELECT _UxGT("選擇") //"Select" #define MSG_ACC _UxGT("加速度") //"Accel" acceleration #define MSG_JERK _UxGT("抖動速率") //"Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("A軸抖動速率") //"Va-jerk" - #define MSG_VB_JERK _UxGT("B軸抖動速率") //"Vb-jerk" - #define MSG_VC_JERK _UxGT("C軸抖動速率") //"Vc-jerk" -#else - #define MSG_VA_JERK _UxGT("X軸抖動速率") //"Vx-jerk" - #define MSG_VB_JERK _UxGT("Y軸抖動速率") //"Vy-jerk" - #define MSG_VC_JERK _UxGT("Z軸抖動速率") //"Vz-jerk" -#endif +#define MSG_VX_JERK _UxGT("X軸抖動速率") //"Vx-jerk" +#define MSG_VY_JERK _UxGT("Y軸抖動速率") //"Vy-jerk" +#define MSG_VZ_JERK _UxGT("Z軸抖動速率") //"Vz-jerk" #define MSG_VE_JERK _UxGT("擠出機抖動速率") //"Ve-jerk" -#define MSG_VELOCITY _UxGT("速度") // "Velocity" #define MSG_VMAX _UxGT("最大進料速率") //"Vmax " max_feedrate_mm_s #define MSG_VMIN _UxGT("最小進料速率") //"Vmin" min_feedrate_mm_s #define MSG_VTRAV_MIN _UxGT("最小移動速率") //"VTrav min" min_travel_feedrate_mm_s, (target) speed of the move -#define MSG_ACCELERATION _UxGT("加速度") // "Acceleration" #define MSG_AMAX _UxGT("最大列印加速度") //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves #define MSG_A_RETRACT _UxGT("回縮加速度") //"A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts #define MSG_A_TRAVEL _UxGT("非列印移動加速度") //"A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves #define MSG_STEPS_PER_MM _UxGT("軸步數/mm") //"Steps/mm" axis_steps_per_mm, axis steps-per-unit G92 -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A軸步數/mm") //"Asteps/mm" axis_steps_per_mm, axis steps-per-unit G92 - #define MSG_BSTEPS _UxGT("B軸步數/mm") //"Bsteps/mm" - #define MSG_CSTEPS _UxGT("C軸步數/mm") //"Csteps/mm" -#else - #define MSG_ASTEPS _UxGT("X軸步數/mm") //"Xsteps/mm" axis_steps_per_mm, axis steps-per-unit G92 - #define MSG_BSTEPS _UxGT("Y軸步數/mm") //"Ysteps/mm" - #define MSG_CSTEPS _UxGT("Z軸步數/mm") //"Zsteps/mm" -#endif +#define MSG_XSTEPS _UxGT("X軸步數/mm") //"Xsteps/mm" axis_steps_per_mm, axis steps-per-unit G92 +#define MSG_YSTEPS _UxGT("Y軸步數/mm") //"Ysteps/mm" +#define MSG_ZSTEPS _UxGT("Z軸步數/mm") //"Zsteps/mm" #define MSG_ESTEPS _UxGT("擠出機步數/mm") //"Esteps/mm" -#define MSG_E1STEPS _UxGT("擠出機1步數/mm") //"E1steps/mm" -#define MSG_E2STEPS _UxGT("擠出機2步數/mm") //"E2steps/mm" -#define MSG_E3STEPS _UxGT("擠出機3步數/mm") //"E3steps/mm" -#define MSG_E4STEPS _UxGT("擠出機4步數/mm") //"E4steps/mm" -#define MSG_E5STEPS _UxGT("擠出機5步數/mm") //"E5steps/mm" #define MSG_TEMPERATURE _UxGT("溫度") //"Temperature" #define MSG_MOTION _UxGT("運作") //"Motion" #define MSG_FILAMENT _UxGT("絲料測容") //"Filament" lcd_control_volumetric_menu #define MSG_VOLUMETRIC_ENABLED _UxGT("測容積mm³") //"E in mm3" volumetric_enabled #define MSG_FILAMENT_DIAM _UxGT("絲料直徑") //"Fil. Dia." -#define MSG_FILAMENT_UNLOAD _UxGT("卸載 mm") // "Unload mm" -#define MSG_FILAMENT_LOAD _UxGT("装載 mm") // "Load mm" -#define MSG_ADVANCE_K _UxGT("Advance K") // "Advance K" #define MSG_CONTRAST _UxGT("LCD對比度") //"LCD contrast" #define MSG_STORE_EEPROM _UxGT("保存設置") //"Store memory" #define MSG_LOAD_EEPROM _UxGT("載入設置") //"Load memory" #define MSG_RESTORE_FAILSAFE _UxGT("恢復安全值") //"Restore failsafe" -#define MSG_INIT_EEPROM _UxGT("初始化設置") // "Initialize EEPROM" #define MSG_REFRESH _UxGT("刷新") //"Refresh" #define MSG_WATCH _UxGT("資訊界面") //"Info screen" #define MSG_PREPARE _UxGT("準備") //"Prepare" @@ -247,9 +127,9 @@ #define MSG_CARD_MENU _UxGT("從記憶卡上列印") //"Print from SD" #define MSG_NO_CARD _UxGT("無記憶卡") //"No SD card" #define MSG_DWELL _UxGT("休眠 ...") //"Sleep..." -#define MSG_USERWAIT _UxGT("點擊繼續 ...") //"Click to resume..." -#define MSG_PRINT_PAUSED _UxGT("列印已暫停") // "Print paused" -#define MSG_PRINT_ABORTED _UxGT("已取消列印") //"Print aborted" +#define MSG_USERWAIT _UxGT("等待用戶 ...") //"Wait for user..." +#define MSG_RESUMING _UxGT("恢復列印中") //"Resuming print" +#define MSG_PRINT_ABORTED _UxGT("列印已取消") //"Print aborted" #define MSG_NO_MOVE _UxGT("無移動") //"No move." #define MSG_KILLED _UxGT("已砍掉") //"KILLED. " #define MSG_STOPPED _UxGT("已停止") //"STOPPED. " @@ -259,22 +139,12 @@ #define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") //"Hop mm" retract_zlift, retract Z-lift #define MSG_CONTROL_RETRACT_RECOVER _UxGT("回縮恢復長度mm") //"UnRet +mm" retract_recover_length, additional recover length (mm, added to retract length when recovering) #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("換手回縮恢復長度mm") //"S UnRet+mm" swap_retract_recover_length, additional swap recover length (mm, added to retract length when recovering from extruder change) -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("回縮恢復後進料速率mm/s") //"UnRet V" retract_recover_feedrate_mm_s, feedrate for recovering from retraction (mm/s) -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") // "S UnRet V" +#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("回縮恢復後進料速率mm/s") //"UnRet V" retract_recover_feedrate_mm_s, feedrate for recovering from retraction (mm/s) #define MSG_AUTORETRACT _UxGT("自動回縮") //"AutoRetr." autoretract_enabled, #define MSG_FILAMENTCHANGE _UxGT("更換絲料") //"Change filament" -#define MSG_FILAMENTLOAD _UxGT("裝載絲料") // "Load filament" -#define MSG_FILAMENTUNLOAD _UxGT("卸載絲料") // "Unload filament" -#define MSG_FILAMENTUNLOAD_ALL _UxGT("卸載全部") // "Unload All" #define MSG_INIT_SDCARD _UxGT("初始化記憶卡") //"Init. SD card" #define MSG_CNG_SDCARD _UxGT("更換記憶卡") //"Change SD card" #define MSG_ZPROBE_OUT _UxGT("Z探針在熱床之外") //"Z probe out. bed" Z probe is not within the physical limits -#define MSG_SKEW_FACTOR _UxGT("偏斜因數") // "Skew Factor" -#define MSG_BLTOUCH _UxGT("BLTouch") // "BLTouch" -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch 自檢") // "BLTouch Self-Test" -#define MSG_BLTOUCH_RESET _UxGT("重置BLTouch") // "Reset BLTouch" -#define MSG_BLTOUCH_DEPLOY _UxGT("部署BLTouch") // "Deploy BLTouch" -#define MSG_BLTOUCH_STOW _UxGT("裝載BLTouch") // "Stow BLTouch" #define MSG_HOME _UxGT("歸位") //"Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST #define MSG_FIRST _UxGT("先") //"first" #define MSG_ZPROBE_ZOFFSET _UxGT("Z偏移") //"Z Offset" @@ -289,40 +159,29 @@ #define MSG_ERR_MINTEMP _UxGT("錯誤:最低溫度") //"Err: MINTEMP" #define MSG_ERR_MAXTEMP_BED _UxGT("錯誤:最高熱床溫度") //"Err: MAXTEMP BED" #define MSG_ERR_MINTEMP_BED _UxGT("錯誤:最低熱床溫度") //"Err: MINTEMP BED" -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST #define MSG_HALTED _UxGT("印表機停機") //"PRINTER HALTED" #define MSG_PLEASE_RESET _UxGT("請重置") //"Please reset" #define MSG_SHORT_DAY _UxGT("天") //"d" // One character only #define MSG_SHORT_HOUR _UxGT("時") //"h" // One character only #define MSG_SHORT_MINUTE _UxGT("分") //"m" // One character only #define MSG_HEATING _UxGT("加熱中 ...") //"Heating..." -#define MSG_BED_HEATING _UxGT("加熱熱床中...") //"Bed Heating..." +#define MSG_HEATING_COMPLETE _UxGT("完成加熱") //"Heating done." +#define MSG_BED_HEATING _UxGT("加熱熱床中") //"Bed Heating." +#define MSG_BED_DONE _UxGT("完成加熱熱床") //"Bed done." #define MSG_DELTA_CALIBRATE _UxGT("⊿校準") //"Delta Calibration" -#define MSG_DELTA_CALIBRATE_X _UxGT("⊿校準X") //"Calibrate X" -#define MSG_DELTA_CALIBRATE_Y _UxGT("⊿校準Y") //"Calibrate Y" -#define MSG_DELTA_CALIBRATE_Z _UxGT("⊿校準Z") //"Calibrate Z" -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("⊿校準中心") //"Calibrate Center" -#define MSG_DELTA_SETTINGS _UxGT("⊿設置") // "Delta Settings" -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("⊿自動校準") // "Auto Calibration" -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("設置⊿高度") // "Set Delta Height" -#define MSG_DELTA_DIAG_ROD _UxGT("⊿斜柱") // "Diag Rod" -#define MSG_DELTA_HEIGHT _UxGT("⊿高度") // "Height" -#define MSG_DELTA_RADIUS _UxGT("⊿半徑") // "Radius" +#define MSG_DELTA_CALIBRATE_X _UxGT("校準X") //"Calibrate X" +#define MSG_DELTA_CALIBRATE_Y _UxGT("校準Y") //"Calibrate Y" +#define MSG_DELTA_CALIBRATE_Z _UxGT("校準Z") //"Calibrate Z" +#define MSG_DELTA_CALIBRATE_CENTER _UxGT("校準中心") //"Calibrate Center" + #define MSG_INFO_MENU _UxGT("關於印表機") //"About Printer" #define MSG_INFO_PRINTER_MENU _UxGT("印表機訊息") //"Printer Info" -#define MSG_3POINT_LEVELING _UxGT("三點調平") // "3-Point Leveling" -#define MSG_LINEAR_LEVELING _UxGT("線性調平") // "Linear Leveling" -#define MSG_BILINEAR_LEVELING _UxGT("雙線性調平") // "Bilinear Leveling" -#define MSG_UBL_LEVELING _UxGT("統一熱床調平(UBL)") // "Unified Bed Leveling" -#define MSG_MESH_LEVELING _UxGT("網格調平") // "Mesh Leveling" #define MSG_INFO_STATS_MENU _UxGT("印表機統計") //"Printer Stats" #define MSG_INFO_BOARD_MENU _UxGT("主板訊息") //"Board Info" #define MSG_INFO_THERMISTOR_MENU _UxGT("溫度計") //"Thermistors" #define MSG_INFO_EXTRUDERS _UxGT("擠出機") //"Extruders" #define MSG_INFO_BAUDRATE _UxGT("傳輸率") //"Baud" #define MSG_INFO_PROTOCOL _UxGT("協議") //"Protocol" -#define MSG_CASE_LIGHT _UxGT("外殼燈") // "Case light" -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("燈亮度") // "Light BRIGHTNESS" #if LCD_WIDTH > 19 #define MSG_INFO_PRINT_COUNT _UxGT("列印計數") //"Print Count" @@ -341,19 +200,11 @@ #define MSG_INFO_MIN_TEMP _UxGT("最低溫度") //"Min Temp" #define MSG_INFO_MAX_TEMP _UxGT("最高溫度") //"Max Temp" #define MSG_INFO_PSU _UxGT("電源供應") //"Power Supply" -#define MSG_DRIVE_STRENGTH _UxGT("驅動力度") // "Drive Strength" -#define MSG_DAC_PERCENT _UxGT("驅動 %") // "Driver %" -#define MSG_DAC_EEPROM_WRITE _UxGT("保存驅動設置") // "DAC EEPROM Write" -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("列印已暫停") // "PRINT PAUSED" -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("裝載絲料") // "LOAD FILAMENT" -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("卸載絲料") // "UNLOAD FILAMENT" -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("恢複選項:") // "RESUME OPTIONS:" -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("清除更多") // "Purge more" + +#define MSG_FILAMENT_CHANGE_HEADER _UxGT("PRINT PAUSED") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("擠出更多") //"Extrude more" #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("恢復列印") //"Resume print" -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" 噴嘴: ") // " Nozzle: " -#define MSG_ERR_HOMING_FAILED _UxGT("歸原位失敗") // "Homing failed" -#define MSG_ERR_PROBING_FAILED _UxGT("探針探測失敗") // "Probing failed" -#define MSG_M600_TOO_COLD _UxGT("M600: 太涼") // "M600: Too cold" #if LCD_HEIGHT >= 4 #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("等待開始") //"Wait for start" @@ -361,27 +212,26 @@ #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("變更") //"change" #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("等待") //"Wait for" #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("卸下絲料") //"filament unload" +#define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("") //"" #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("插入絲料") //"Insert filament" #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("並按鍵") //"and press button" #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("繼續 ...") //"to continue..." -#define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("按下按鈕來") // "Press button to" -#define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("加熱噴嘴.") // "heat nozzle." -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("加熱噴嘴") // "Heating nozzle" -#define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("請等待 ...") // "Please wait..." #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("等待") //"Wait for" #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("進料") //"filament load" -#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("等待") // "Wait for" -#define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("絲料清除") // "filament purge" +#define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("") //"" +#define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("等待") //"Wait for" +#define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("絲料擠出") //"filament extrude" +#define MSG_FILAMENT_CHANGE_EXTRUDE_3 _UxGT("") //"" #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("等待列印") //"Wait for print" #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("恢復") //"to resume" +#define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("") //"" #else // LCD_HEIGHT < 4 #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("請等待 ...") //"Please wait..." #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("退出中 ...") //"Ejecting..." #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("插入並點擊") //"Insert and Click" -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("加熱中 ...") // "Heating..." #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("載入中 ...") //"Loading..." -#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("清除中 ...") // "Purging..." +#define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("擠出中 ...") //"Extruding..." #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("恢復中 ...") //"Resuming..." #endif // LCD_HEIGHT < 4 diff --git a/Marlin/least_squares_fit.cpp b/Marlin/least_squares_fit.cpp index 9e59804..66821ce 100644 --- a/Marlin/least_squares_fit.cpp +++ b/Marlin/least_squares_fit.cpp @@ -59,7 +59,7 @@ int finish_incremental_LSF(struct linear_fit_data *lsf) { lsf->xzbar = lsf->xzbar / N - lsf->xbar * lsf->zbar; const float DD = lsf->x2bar * lsf->y2bar - sq(lsf->xybar); - if (ABS(DD) <= 1e-10 * (lsf->max_absx + lsf->max_absy)) + if (FABS(DD) <= 1e-10 * (lsf->max_absx + lsf->max_absy)) return 1; lsf->A = (lsf->yzbar * lsf->xybar - lsf->xzbar * lsf->y2bar) / DD; diff --git a/Marlin/least_squares_fit.h b/Marlin/least_squares_fit.h index 68aa62b..9ed923a 100644 --- a/Marlin/least_squares_fit.h +++ b/Marlin/least_squares_fit.h @@ -65,8 +65,8 @@ void inline incremental_WLSF(struct linear_fit_data *lsf, const float &x, const lsf->xzbar += w * x * z; lsf->yzbar += w * y * z; lsf->N += w; - lsf->max_absx = MAX(ABS(w * x), lsf->max_absx); - lsf->max_absy = MAX(ABS(w * y), lsf->max_absy); + lsf->max_absx = max(FABS(w * x), lsf->max_absx); + lsf->max_absy = max(FABS(w * y), lsf->max_absy); } void inline incremental_LSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z) { @@ -79,8 +79,8 @@ void inline incremental_LSF(struct linear_fit_data *lsf, const float &x, const f lsf->xybar += x * y; lsf->xzbar += x * z; lsf->yzbar += y * z; - lsf->max_absx = MAX(ABS(x), lsf->max_absx); - lsf->max_absy = MAX(ABS(y), lsf->max_absy); + lsf->max_absx = max(FABS(x), lsf->max_absx); + lsf->max_absy = max(FABS(y), lsf->max_absy); lsf->N += 1.0; } diff --git a/Marlin/leds.h b/Marlin/leds.h index f5e74b3..a0cf28b 100644 --- a/Marlin/leds.h +++ b/Marlin/leds.h @@ -70,21 +70,6 @@ typedef struct LEDColor { #endif #endif {} - LEDColor(const uint8_t (&rgbw)[4]) : r(rgbw[0]), g(rgbw[1]), b(rgbw[2]) - #if HAS_WHITE_LED - , w(rgbw[3]) - #if ENABLED(NEOPIXEL_LED) - , i(NEOPIXEL_BRIGHTNESS) - #endif - #endif - {} - LEDColor& operator=(const uint8_t (&rgbw)[4]) { - r = rgbw[0]; g = rgbw[1]; b = rgbw[2]; - #if HAS_WHITE_LED - w = rgbw[3]; - #endif - return *this; - } LEDColor& operator=(const LEDColor &right) { if (this != &right) memcpy(this, &right, sizeof(LEDColor)); return *this; diff --git a/Marlin/macros.h b/Marlin/macros.h index a081744..253ba60 100644 --- a/Marlin/macros.h +++ b/Marlin/macros.h @@ -23,19 +23,10 @@ #ifndef MACROS_H #define MACROS_H -#define XYZ 3 -#define XYZE 4 -#define ABC 3 -#define ABCD 4 -#define ABCE 4 -#define ABCDE 5 - -/** - * For use in macros that take a single axis letter - * The axis order in all axis related arrays is X, Y, Z, E - * For Hangprinter it is A, B, C, D, E - */ -#define _AXIS(A) (A##_AXIS) +#define NUM_AXIS 4 +#define XYZE 4 +#define ABC 3 +#define XYZ 3 #define _XMIN_ 100 #define _YMIN_ 200 @@ -52,12 +43,55 @@ #define _O2 __attribute__((optimize("O2"))) #define _O3 __attribute__((optimize("O3"))) +// 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 + // Clock speed factors #define CYCLES_PER_MICROSECOND (F_CPU / 1000000L) // 16 or 20 #define INT0_PRESCALER 8 -// Nanoseconds per cycle -#define NANOSECONDS_PER_CYCLE (1000000000.0 / F_CPU) +// Highly granular delays for step pulses, etc. +#define DELAY_0_NOP NOOP +#define DELAY_1_NOP __asm__("nop\n\t") +#define DELAY_2_NOP DELAY_1_NOP; DELAY_1_NOP +#define DELAY_3_NOP DELAY_1_NOP; DELAY_2_NOP +#define DELAY_4_NOP DELAY_1_NOP; DELAY_3_NOP +#define DELAY_5_NOP DELAY_1_NOP; DELAY_4_NOP + +#define DELAY_NOPS(X) \ + switch (X) { \ + case 20: DELAY_1_NOP; case 19: DELAY_1_NOP; \ + case 18: DELAY_1_NOP; case 17: DELAY_1_NOP; \ + case 16: DELAY_1_NOP; case 15: DELAY_1_NOP; \ + case 14: DELAY_1_NOP; case 13: DELAY_1_NOP; \ + case 12: DELAY_1_NOP; case 11: DELAY_1_NOP; \ + case 10: DELAY_1_NOP; case 9: DELAY_1_NOP; \ + case 8: DELAY_1_NOP; case 7: DELAY_1_NOP; \ + case 6: DELAY_1_NOP; case 5: DELAY_1_NOP; \ + case 4: DELAY_1_NOP; case 3: DELAY_1_NOP; \ + case 2: DELAY_1_NOP; case 1: DELAY_1_NOP; \ + } + +#define DELAY_10_NOP DELAY_5_NOP; DELAY_5_NOP +#define DELAY_20_NOP DELAY_10_NOP; DELAY_10_NOP + +#if CYCLES_PER_MICROSECOND == 16 + #define DELAY_1US DELAY_10_NOP; DELAY_5_NOP; DELAY_1_NOP +#else + #define DELAY_1US DELAY_20_NOP +#endif +#define DELAY_2US DELAY_1US; DELAY_1US +#define DELAY_3US DELAY_1US; DELAY_2US +#define DELAY_4US DELAY_1US; DELAY_3US +#define DELAY_5US DELAY_1US; DELAY_4US +#define DELAY_6US DELAY_1US; DELAY_5US +#define DELAY_7US DELAY_1US; DELAY_6US +#define DELAY_8US DELAY_1US; DELAY_7US +#define DELAY_9US DELAY_1US; DELAY_8US +#define DELAY_10US DELAY_1US; DELAY_9US // Remove compiler warning on an unused variable #define UNUSED(x) (void) (x) @@ -66,34 +100,25 @@ #define STRINGIFY_(M) #M #define STRINGIFY(M) STRINGIFY_(M) -#define A(CODE) " " CODE "\n\t" -#define L(CODE) CODE ":\n\t" - // Macros for bit masks -#undef _BV -#define _BV(b) (1 << (b)) -#define TEST(n,b) !!((n)&_BV(b)) +#define TEST(n,b) (((n)&_BV(b))!=0) #define SBI(n,b) (n |= _BV(b)) #define CBI(n,b) (n &= ~_BV(b)) -#define SET_BIT_TO(N,B,TF) do{ if (TF) SBI(N,B); else CBI(N,B); }while(0) - -#define _BV32(b) (1UL << (b)) -#define TEST32(n,b) !!((n)&_BV32(b)) -#define SBI32(n,b) (n |= _BV32(b)) -#define CBI32(n,b) (n &= ~_BV32(b)) +#define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (_BV(b)) // Macro to check that a number if a power if 2 #define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1))) // Macros for maths shortcuts -#undef M_PI -#define M_PI 3.14159265358979323846f -#define RADIANS(d) ((d)*M_PI/180.0f) -#define DEGREES(r) ((r)*180.0f/M_PI) +#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 HYPOT2(x,y) (sq(x)+sq(y)) -#define CIRCLE_AREA(R) (M_PI * sq(float(R))) -#define CIRCLE_CIRC(R) (2 * M_PI * (float(R))) +#define CIRCLE_AREA(R) (M_PI * sq(R)) +#define CIRCLE_CIRC(R) (2.0 * M_PI * (R)) #define SIGN(a) ((a>0)-(a<0)) #define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1))) @@ -101,7 +126,6 @@ // Macros to contrain values #define NOLESS(v,n) do{ if (v < n) v = n; }while(0) #define NOMORE(v,n) do{ if (v > n) v = n; }while(0) -#define LIMIT(v,n1,n2) do{ if (v < n1) v = n1; else if (v > n2) v = n2; }while(0) // Macros to support option testing #define _CAT(a, ...) a ## __VA_ARGS__ @@ -109,11 +133,9 @@ #define SWITCH_ENABLED_true 1 #define SWITCH_ENABLED_0 0 #define SWITCH_ENABLED_1 1 -#define SWITCH_ENABLED_0x0 0 -#define SWITCH_ENABLED_0x1 1 #define SWITCH_ENABLED_ 1 #define ENABLED(b) _CAT(SWITCH_ENABLED_, b) -#define DISABLED(b) !ENABLED(b) +#define DISABLED(b) (!_CAT(SWITCH_ENABLED_, b)) #define WITHIN(V,L,H) ((V) >= (L) && (V) <= (H)) #define NUMERIC(a) WITHIN(a, '0', '9') @@ -122,7 +144,7 @@ #define DECIMAL_SIGNED(a) (DECIMAL(a) || (a) == '-' || (a) == '+') #define COUNT(a) (sizeof(a)/sizeof(*a)) #define ZERO(a) memset(a,0,sizeof(a)) -#define COPY(a,b) memcpy(a,b,MIN(sizeof(a),sizeof(b))) +#define COPY(a,b) memcpy(a,b,min(sizeof(a),sizeof(b))) // Macros for initializing arrays #define ARRAY_6(v1, v2, v3, v4, v5, v6, ...) { v1, v2, v3, v4, v5, v6 } @@ -166,74 +188,38 @@ #define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0) #define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON)) -#define MMM_TO_MMS(MM_M) ((MM_M)/60.0f) -#define MMS_TO_MMM(MM_S) ((MM_S)*60.0f) +#define MMM_TO_MMS(MM_M) ((MM_M)/60.0) +#define MMS_TO_MMM(MM_S) ((MM_S)*60.0) #define NOOP do{} while(0) #define CEILING(x,y) (((x) + (y) - 1) / (y)) -// Avoid double evaluation of arguments on MIN/MAX/ABS -#undef MIN -#undef MAX -#undef ABS -#ifdef __cplusplus +#define MIN3(a, b, c) min(min(a, b), c) +#define MIN4(a, b, c, d) min(MIN3(a, b, c), d) +#define MIN5(a, b, c, d, e) min(MIN4(a, b, c, d), e) +#define MAX3(a, b, c) max(max(a, b), c) +#define MAX4(a, b, c, d) max(MAX3(a, b, c), d) +#define MAX5(a, b, c, d, e) max(MAX4(a, b, c, d), e) - // C++11 solution that is standards compliant. Return type is deduced automatically - template static inline constexpr auto MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) { - return lhs < rhs ? lhs : rhs; - } - template static inline constexpr auto MAX(const L lhs, const R rhs) -> decltype(lhs + rhs){ - return lhs > rhs ? lhs : rhs; - } - template static inline constexpr const T ABS(const T v) { - return v >= 0 ? v : -v; - } -#else - - // Using GCC extensions, but Travis GCC version does not like it and gives - // "error: statement-expressions are not allowed outside functions nor in template-argument lists" - #define MIN(a, b) \ - ({__typeof__(a) _a = (a); \ - __typeof__(b) _b = (b); \ - _a < _b ? _a : _b;}) - - #define MAX(a, b) \ - ({__typeof__(a) _a = (a); \ - __typeof__(b) _b = (b); \ - _a > _b ? _a : _b;}) - - #define ABS(a) \ - ({__typeof__(a) _a = (a); \ - _a >= 0 ? _a : -_a;}) - -#endif - -#define MIN3(a, b, c) MIN(MIN(a, b), c) -#define MIN4(a, b, c, d) MIN(MIN3(a, b, c), d) -#define MIN5(a, b, c, d, e) MIN(MIN4(a, b, c, d), e) -#define MAX3(a, b, c) MAX(MAX(a, b), c) -#define MAX4(a, b, c, d) MAX(MAX3(a, b, c), d) -#define MAX5(a, b, c, d, e) MAX(MAX4(a, b, c, d), e) - -#define UNEAR_ZERO(x) ((x) < 0.000001f) -#define NEAR_ZERO(x) WITHIN(x, -0.000001f, 0.000001f) +#define UNEAR_ZERO(x) ((x) < 0.000001) +#define NEAR_ZERO(x) WITHIN(x, -0.000001, 0.000001) #define NEAR(x,y) NEAR_ZERO((x)-(y)) -#define RECIPROCAL(x) (NEAR_ZERO(x) ? 0.0f : 1.0f / (x)) -#define FIXFLOAT(f) (f + (f < 0.0f ? -0.00005f : 0.00005f)) +#define RECIPROCAL(x) (NEAR_ZERO(x) ? 0.0 : 1.0 / (x)) +#define FIXFLOAT(f) (f + 0.00001) // // Maths macros that can be overridden by HAL // -#define ATAN2(y, x) atan2f(y, x) -#define POW(x, y) powf(x, y) -#define SQRT(x) sqrtf(x) -#define RSQRT(x) (1 / sqrtf(x)) -#define CEIL(x) ceilf(x) -#define FLOOR(x) floorf(x) -#define LROUND(x) lroundf(x) -#define FMOD(x, y) fmodf(x, y) +#define ATAN2(y, x) atan2(y, x) +#define FABS(x) fabs(x) +#define POW(x, y) pow(x, y) +#define SQRT(x) sqrt(x) +#define CEIL(x) ceil(x) +#define FLOOR(x) floor(x) +#define LROUND(x) lround(x) +#define FMOD(x, y) fmod(x, y) #define HYPOT(x,y) SQRT(HYPOT2(x,y)) -#endif // MACROS_H +#endif //__MACROS_H diff --git a/Marlin/mesh_bed_leveling.cpp b/Marlin/mesh_bed_leveling.cpp index cc2ee6a..2734459 100644 --- a/Marlin/mesh_bed_leveling.cpp +++ b/Marlin/mesh_bed_leveling.cpp @@ -20,16 +20,14 @@ * */ -#include "MarlinConfig.h" +#include "mesh_bed_leveling.h" #if ENABLED(MESH_BED_LEVELING) - #include "mesh_bed_leveling.h" - #include "Marlin.h" - #include "serial.h" - mesh_bed_leveling mbl; + bool mesh_bed_leveling::has_mesh; + float mesh_bed_leveling::z_offset, mesh_bed_leveling::z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], mesh_bed_leveling::index_to_xpos[GRID_MAX_POINTS_X], @@ -44,17 +42,9 @@ } void mesh_bed_leveling::reset() { + has_mesh = false; z_offset = 0; ZERO(z_values); } - void mesh_bed_leveling::report_mesh() { - SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(GRID_MAX_POINTS_X) "," STRINGIFY(GRID_MAX_POINTS_Y)); - SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(z_offset, 5); - SERIAL_PROTOCOLLNPGM("\nMeasured points:"); - print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5, - [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; } - ); - } - #endif // MESH_BED_LEVELING diff --git a/Marlin/mesh_bed_leveling.h b/Marlin/mesh_bed_leveling.h index cb95ad7..87afeb5 100644 --- a/Marlin/mesh_bed_leveling.h +++ b/Marlin/mesh_bed_leveling.h @@ -20,101 +20,92 @@ * */ -#ifndef _MESH_BED_LEVELING_H_ -#define _MESH_BED_LEVELING_H_ +#include "Marlin.h" -#include "MarlinConfig.h" +#if ENABLED(MESH_BED_LEVELING) -enum MeshLevelingState : char { - MeshReport, - MeshStart, - MeshNext, - MeshSet, - MeshSetZOffset, - MeshReset -}; + enum MeshLevelingState { + MeshReport, + MeshStart, + MeshNext, + MeshSet, + MeshSetZOffset, + MeshReset + }; -#define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X)) / (GRID_MAX_POINTS_X - 1)) -#define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y)) / (GRID_MAX_POINTS_Y - 1)) + #define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X)) / (GRID_MAX_POINTS_X - 1)) + #define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y)) / (GRID_MAX_POINTS_Y - 1)) -class mesh_bed_leveling { -public: - static float z_offset, - z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], - index_to_xpos[GRID_MAX_POINTS_X], - index_to_ypos[GRID_MAX_POINTS_Y]; + class mesh_bed_leveling { + public: + static bool has_mesh; + static float z_offset, + z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], + index_to_xpos[GRID_MAX_POINTS_X], + index_to_ypos[GRID_MAX_POINTS_Y]; - mesh_bed_leveling(); + mesh_bed_leveling(); - static void report_mesh(); + static void reset(); - static void reset(); + static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; } - FORCE_INLINE static bool has_mesh() { - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (z_values[x][y]) return true; - return false; - } + static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) { + px = index % (GRID_MAX_POINTS_X); + py = index / (GRID_MAX_POINTS_X); + if (py & 1) px = (GRID_MAX_POINTS_X - 1) - px; // Zig zag + } - static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; } + static void set_zigzag_z(const int8_t index, const float &z) { + int8_t px, py; + zigzag(index, px, py); + set_z(px, py, z); + } - static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) { - px = index % (GRID_MAX_POINTS_X); - py = index / (GRID_MAX_POINTS_X); - if (py & 1) px = (GRID_MAX_POINTS_X - 1) - px; // Zig zag - } + static int8_t cell_index_x(const float &x) { + int8_t cx = (x - (MESH_MIN_X)) * (1.0 / (MESH_X_DIST)); + return constrain(cx, 0, (GRID_MAX_POINTS_X) - 2); + } - static void set_zigzag_z(const int8_t index, const float &z) { - int8_t px, py; - zigzag(index, px, py); - set_z(px, py, z); - } + static int8_t cell_index_y(const float &y) { + int8_t cy = (y - (MESH_MIN_Y)) * (1.0 / (MESH_Y_DIST)); + return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 2); + } - static int8_t cell_index_x(const float &x) { - int8_t cx = (x - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)); - return constrain(cx, 0, (GRID_MAX_POINTS_X) - 2); - } + static int8_t probe_index_x(const float &x) { + int8_t px = (x - (MESH_MIN_X) + 0.5 * (MESH_X_DIST)) * (1.0 / (MESH_X_DIST)); + return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; + } - static int8_t cell_index_y(const float &y) { - int8_t cy = (y - (MESH_MIN_Y)) * (1.0f / (MESH_Y_DIST)); - return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 2); - } + static int8_t probe_index_y(const float &y) { + int8_t py = (y - (MESH_MIN_Y) + 0.5 * (MESH_Y_DIST)) * (1.0 / (MESH_Y_DIST)); + return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; + } - static int8_t probe_index_x(const float &x) { - int8_t px = (x - (MESH_MIN_X) + 0.5f * (MESH_X_DIST)) * (1.0f / (MESH_X_DIST)); - return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; - } + static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { + const float delta_z = (z2 - z1) / (a2 - a1), + delta_a = a0 - a1; + return z1 + delta_a * delta_z; + } - static int8_t probe_index_y(const float &y) { - int8_t py = (y - (MESH_MIN_Y) + 0.5f * (MESH_Y_DIST)) * (1.0f / (MESH_Y_DIST)); - return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; - } - - static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { - const float delta_z = (z2 - z1) / (a2 - a1), - delta_a = a0 - a1; - return z1 + delta_a * delta_z; - } - - static float get_z(const float &x0, const float &y0 - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , const float &factor - #endif - ) { - const int8_t cx = cell_index_x(x0), cy = cell_index_y(y0); - const float z1 = calc_z0(x0, index_to_xpos[cx], z_values[cx][cy], index_to_xpos[cx + 1], z_values[cx + 1][cy]), - z2 = calc_z0(x0, index_to_xpos[cx], z_values[cx][cy + 1], index_to_xpos[cx + 1], z_values[cx + 1][cy + 1]), - z0 = calc_z0(y0, index_to_ypos[cy], z1, index_to_ypos[cy + 1], z2); - - return z_offset + z0 + static float get_z(const float &x0, const float &y0 #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - * factor + , const float &factor #endif - ; - } -}; + ) { + const int8_t cx = cell_index_x(x0), cy = cell_index_y(y0); + const float z1 = calc_z0(x0, index_to_xpos[cx], z_values[cx][cy], index_to_xpos[cx + 1], z_values[cx + 1][cy]), + z2 = calc_z0(x0, index_to_xpos[cx], z_values[cx][cy + 1], index_to_xpos[cx + 1], z_values[cx + 1][cy + 1]), + z0 = calc_z0(y0, index_to_ypos[cy], z1, index_to_ypos[cy + 1], z2); -extern mesh_bed_leveling mbl; + return z_offset + z0 + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + * factor + #endif + ; + } + }; -#endif // _MESH_BED_LEVELING_H_ + extern mesh_bed_leveling mbl; + +#endif // MESH_BED_LEVELING diff --git a/Marlin/neopixel.cpp b/Marlin/neopixel.cpp index 8daca3b..8d8a544 100644 --- a/Marlin/neopixel.cpp +++ b/Marlin/neopixel.cpp @@ -30,10 +30,6 @@ #include "neopixel.h" -#if ENABLED(NEOPIXEL_STARTUP_TEST) - #include "utility.h" -#endif - Adafruit_NeoPixel pixels(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800); void set_neopixel_color(const uint32_t color) { diff --git a/Marlin/nozzle.cpp b/Marlin/nozzle.cpp index 3e2607c..da43e26 100644 --- a/Marlin/nozzle.cpp +++ b/Marlin/nozzle.cpp @@ -78,7 +78,7 @@ do_blocking_move_to(start.x, start.y, start.z); const uint8_t zigs = objects << 1; - const bool horiz = ABS(diffx) >= ABS(diffy); // Do a horizontal wipe? + const bool horiz = FABS(diffx) >= FABS(diffy); // Do a horizontal wipe? const float P = (horiz ? diffx : diffy) / zigs; // Period of each zig / zag const point_t *side; for (uint8_t j = 0; j < strokes; j++) { @@ -161,11 +161,9 @@ #if ENABLED(NOZZLE_PARK_FEATURE) - constexpr float npp[] = NOZZLE_PARK_POINT; - static_assert(COUNT(npp) == XYZ, "NOZZLE_PARK_POINT requires X, Y, and Z values."); - - void Nozzle::park(const uint8_t &z_action, const point_t &park/*=NOZZLE_PARK_POINT*/) { - const float fr_xy = NOZZLE_PARK_XY_FEEDRATE, fr_z = NOZZLE_PARK_Z_FEEDRATE; + void Nozzle::park(const uint8_t &z_action, const point_t &park /*= NOZZLE_PARK_POINT*/) { + const float fr_xy = NOZZLE_PARK_XY_FEEDRATE; + const float fr_z = NOZZLE_PARK_Z_FEEDRATE; switch (z_action) { case 1: // Go to Z-park height @@ -173,11 +171,11 @@ break; case 2: // Raise by Z-park height - do_blocking_move_to_z(MIN(current_position[Z_AXIS] + park.z, Z_MAX_POS), fr_z); + do_blocking_move_to_z(min(current_position[Z_AXIS] + park.z, Z_MAX_POS), fr_z); break; default: // Raise to at least the Z-park height - do_blocking_move_to_z(MAX(park.z, current_position[Z_AXIS]), fr_z); + do_blocking_move_to_z(max(park.z, current_position[Z_AXIS]), fr_z); } do_blocking_move_to_xy(park.x, park.y, fr_xy); diff --git a/Marlin/nozzle.h b/Marlin/nozzle.h index e564081..d6cf968 100644 --- a/Marlin/nozzle.h +++ b/Marlin/nozzle.h @@ -86,7 +86,7 @@ class Nozzle { #if ENABLED(NOZZLE_PARK_FEATURE) - static void park(const uint8_t &z_action, const point_t &park=NOZZLE_PARK_POINT) _Os; + static void park(const uint8_t &z_action, const point_t &park = NOZZLE_PARK_POINT) _Os; #endif }; diff --git a/Marlin/pca9632.cpp b/Marlin/pca9632.cpp index 4c339f4..2b4ee7f 100644 --- a/Marlin/pca9632.cpp +++ b/Marlin/pca9632.cpp @@ -100,9 +100,9 @@ static void PCA9632_WriteAllRegisters(const byte addr, const byte regadd, const #endif void pca9632_set_led_color(const LEDColor &color) { - Wire.begin(); if (!PCA_init) { PCA_init = 1; + Wire.begin(); PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE1, PCA9632_MODE1_VALUE); PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE2, PCA9632_MODE2_VALUE); } diff --git a/Marlin/pins.h b/Marlin/pins.h index a76ea52..01eee57 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -35,237 +35,221 @@ #ifndef __PINS_H__ #define __PINS_H__ -#if MB(RAMPS_13_EFB) || MB(RAMPS_14_EFB) || MB(RAMPS_PLUS_EFB) - #define IS_RAMPS_EFB -#elif MB(RAMPS_13_EEB) || MB(RAMPS_14_EEB) || MB(RAMPS_PLUS_EEB) - #define IS_RAMPS_EEB -#elif MB(RAMPS_13_EFF) || MB(RAMPS_14_EFF) || MB(RAMPS_PLUS_EFF) - #define IS_RAMPS_EFF -#elif MB(RAMPS_13_EEF) || MB(RAMPS_14_EEF) || MB(RAMPS_PLUS_EEF) - #define IS_RAMPS_EEF -#elif MB(RAMPS_13_SF) || MB(RAMPS_14_SF) || MB(RAMPS_PLUS_SF) - #define IS_RAMPS_SF -#endif - // // RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560 // #if MB(RAMPS_OLD) - #include "pins_RAMPS_OLD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_RAMPS_OLD.h" #elif MB(RAMPS_13_EFB) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_EFB + #include "pins_RAMPS_13.h" #elif MB(RAMPS_13_EEB) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_EEB + #include "pins_RAMPS_13.h" #elif MB(RAMPS_13_EFF) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_EFF + #include "pins_RAMPS_13.h" #elif MB(RAMPS_13_EEF) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_EEF + #include "pins_RAMPS_13.h" #elif MB(RAMPS_13_SF) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_SF + #include "pins_RAMPS_13.h" #elif MB(RAMPS_14_EFB) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_EFB + #include "pins_RAMPS.h" #elif MB(RAMPS_14_EEB) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_EEB + #include "pins_RAMPS.h" #elif MB(RAMPS_14_EFF) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_EFF + #include "pins_RAMPS.h" #elif MB(RAMPS_14_EEF) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_EEF + #include "pins_RAMPS.h" #elif MB(RAMPS_14_SF) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_SF + #include "pins_RAMPS.h" #elif MB(RAMPS_PLUS_EFB) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_EFB + #include "pins_RAMPS_PLUS.h" #elif MB(RAMPS_PLUS_EEB) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_EEB + #include "pins_RAMPS_PLUS.h" #elif MB(RAMPS_PLUS_EFF) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_EFF + #include "pins_RAMPS_PLUS.h" #elif MB(RAMPS_PLUS_EEF) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_EEF + #include "pins_RAMPS_PLUS.h" #elif MB(RAMPS_PLUS_SF) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #define IS_RAMPS_SF + #include "pins_RAMPS_PLUS.h" // // RAMPS Derivatives - ATmega1280, ATmega2560 // #elif MB(3DRAG) - #include "pins_3DRAG.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_3DRAG.h" // ATmega1280, ATmega2560 #elif MB(K8200) - #include "pins_K8200.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) + #include "pins_K8200.h" // ATmega1280, ATmega2560 (3DRAG) #elif MB(K8400) - #include "pins_K8400.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) + #include "pins_K8400.h" // ATmega1280, ATmega2560 (3DRAG) #elif MB(BAM_DICE) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_RAMPS.h" // ATmega1280, ATmega2560 #elif MB(BAM_DICE_DUE) - #include "pins_BAM_DICE_DUE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_BAM_DICE_DUE.h" // ATmega1280, ATmega2560 #elif MB(MKS_BASE) - #include "pins_MKS_BASE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_BASE_15) - #include "pins_MKS_BASE_15.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_BASE_HEROIC) - #include "pins_MKS_BASE_HEROIC.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_GEN_13) - #include "pins_MKS_GEN_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_MKS_BASE.h" // ATmega1280, ATmega2560 +#elif MB(MKS_13) + #include "pins_MKS_13.h" // ATmega1280, ATmega2560 #elif MB(MKS_GEN_L) - #include "pins_MKS_GEN_L.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_MKS_GEN_L.h" // ATmega1280, ATmega2560 #elif MB(ZRIB_V20) - #include "pins_ZRIB_V20.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (MKS_GEN_13) + #include "pins_ZRIB_V20.h" // ATmega1280, ATmega2560 (MKS_13) #elif MB(FELIX2) - #include "pins_FELIX2.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_FELIX2.h" // ATmega1280, ATmega2560 #elif MB(RIGIDBOARD) - #include "pins_RIGIDBOARD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_RIGIDBOARD.h" // ATmega1280, ATmega2560 #elif MB(RIGIDBOARD_V2) - #include "pins_RIGIDBOARD_V2.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_RIGIDBOARD_V2.h" // ATmega1280, ATmega2560 #elif MB(SAINSMART_2IN1) - #include "pins_SAINSMART_2IN1.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_SAINSMART_2IN1.h" // ATmega1280, ATmega2560 #elif MB(ULTIMAKER) - #include "pins_ULTIMAKER.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_ULTIMAKER.h" // ATmega1280, ATmega2560 #elif MB(ULTIMAKER_OLD) - #include "pins_ULTIMAKER_OLD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_ULTIMAKER_OLD.h" // ATmega1280, ATmega2560 #elif MB(AZTEEG_X3) - #include "pins_AZTEEG_X3.h" // ATmega2560 env:megaatmega2560 + #include "pins_AZTEEG_X3.h" // ATmega2560 #elif MB(AZTEEG_X3_PRO) - #include "pins_AZTEEG_X3_PRO.h" // ATmega2560 env:megaatmega2560 + #include "pins_AZTEEG_X3_PRO.h" // ATmega2560 #elif MB(ULTIMAIN_2) - #include "pins_ULTIMAIN_2.h" // ATmega2560 env:megaatmega2560 + #include "pins_ULTIMAIN_2.h" // ATmega2560 #elif MB(RUMBA) - #include "pins_RUMBA.h" // ATmega2560 env:megaatmega2560 + #include "pins_RUMBA.h" // ATmega2560 #elif MB(BQ_ZUM_MEGA_3D) - #include "pins_BQ_ZUM_MEGA_3D.h" // ATmega2560 env:megaatmega2560 + #include "pins_BQ_ZUM_MEGA_3D.h" // ATmega2560 #elif MB(MAKEBOARD_MINI) - #include "pins_MAKEBOARD_MINI.h" // ATmega2560 env:megaatmega2560 -#elif MB(TRIGORILLA_13) - #include "pins_TRIGORILLA_13.h" // ATmega2560 env:megaatmega2560 -#elif MB(TRIGORILLA_14) - #include "pins_TRIGORILLA_14.h" // ATmega2560 env:megaatmega2560 -#elif MB(RAMPS_ENDER_4) - #include "pins_RAMPS_ENDER_4.h" // ATmega2560 env:megaatmega2560 + #include "pins_MAKEBOARD_MINI.h" // ATmega2560 // // Other ATmega1280, ATmega2560 // #elif MB(CNCONTROLS_11) - #include "pins_CNCONTROLS_11.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_CNCONTROLS_11.h" // ATmega1280, ATmega2560 #elif MB(CNCONTROLS_12) - #include "pins_CNCONTROLS_12.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_CNCONTROLS_12.h" // ATmega1280, ATmega2560 #elif MB(MIGHTYBOARD_REVE) - #include "pins_MIGHTYBOARD_REVE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_MIGHTYBOARD_REVE.h" // ATmega1280, ATmega2560 #elif MB(CHEAPTRONIC) - #include "pins_CHEAPTRONIC.h" // ATmega2560 env:megaatmega2560 + #include "pins_CHEAPTRONIC.h" // ATmega2560 #elif MB(CHEAPTRONIC_V2) - #include "pins_CHEAPTRONICv2.h" // ATmega2560 env:megaatmega2560 + #include "pins_CHEAPTRONICv2.h" // ATmega2560 #elif MB(MEGATRONICS) - #include "pins_MEGATRONICS.h" // ATmega2560 env:megaatmega2560 + #include "pins_MEGATRONICS.h" // ATmega2560 #elif MB(MEGATRONICS_2) - #include "pins_MEGATRONICS_2.h" // ATmega2560 env:megaatmega2560 + #include "pins_MEGATRONICS_2.h" // ATmega2560 #elif MB(MEGATRONICS_3) || MB(MEGATRONICS_31) - #include "pins_MEGATRONICS_3.h" // ATmega2560 env:megaatmega2560 + #include "pins_MEGATRONICS_3.h" // ATmega2560 #elif MB(RAMBO) - #include "pins_RAMBO.h" // ATmega2560 env:rambo + #include "pins_RAMBO.h" // ATmega2560 #elif MB(MINIRAMBO) || MB(MINIRAMBO_10A) - #include "pins_MINIRAMBO.h" // ATmega2560 env:rambo -#elif MB(EINSY_RAMBO) - #include "pins_EINSY_RAMBO.h" // ATmega2560 env:rambo -#elif MB(EINSY_RETRO) - #include "pins_EINSY_RETRO.h" // ATmega2560 env:rambo + #include "pins_MINIRAMBO.h" // ATmega2560 #elif MB(ELEFU_3) - #include "pins_ELEFU_3.h" // ATmega2560 env:megaatmega2560 + #include "pins_ELEFU_3.h" // ATmega2560 #elif MB(LEAPFROG) - #include "pins_LEAPFROG.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_LEAPFROG.h" // ATmega1280, ATmega2560 #elif MB(MEGACONTROLLER) - #include "pins_MEGACONTROLLER.h" // ATmega2560 env:megaatmega2560 + #include "pins_MEGACONTROLLER.h" // ATmega2560 #elif MB(SCOOVO_X9H) - #include "pins_SCOOVO_X9H.h" // ATmega2560 env:rambo + #include "pins_SCOOVO_X9H.h" // ATmega2560 #elif MB(GT2560_REV_A) - #include "pins_GT2560_REV_A.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_GT2560_REV_A.h" // ATmega1280, ATmega2560 #elif MB(GT2560_REV_A_PLUS) - #include "pins_GT2560_REV_A_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "pins_GT2560_REV_A_PLUS.h" // ATmega1280, ATmega2560 +#elif MB(SILVER_GATE) + #include "pins_SILVER_GATE.h" // ATmega2561 // // ATmega1281, ATmega2561 // #elif MB(MINITRONICS) - #include "pins_MINITRONICS.h" // ATmega1281 env:megaatmega1280 -#elif MB(SILVER_GATE) - #include "pins_SILVER_GATE.h" // ATmega2561 env:megaatmega2560 + #include "pins_MINITRONICS.h" // ATmega1281 // // Sanguinololu and Derivatives - ATmega644P, ATmega1284P // #elif MB(SANGUINOLOLU_11) - #include "pins_SANGUINOLOLU_11.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_SANGUINOLOLU_11.h" // ATmega644P, ATmega1284P #elif MB(SANGUINOLOLU_12) - #include "pins_SANGUINOLOLU_12.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_SANGUINOLOLU_12.h" // ATmega644P, ATmega1284P #elif MB(MELZI) - #include "pins_MELZI.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_MELZI.h" // ATmega644P, ATmega1284P #elif MB(MELZI_MAKR3D) - #include "pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P #elif MB(MELZI_CREALITY) - #include "pins_MELZI_CREALITY.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_MALYAN) - #include "pins_MELZI_MALYAN.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_TRONXY) - #include "pins_MELZI_TRONXY.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_MELZI_CREALITY.h" // ATmega644P, ATmega1284P #elif MB(STB_11) - #include "pins_STB_11.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_STB_11.h" // ATmega644P, ATmega1284P #elif MB(AZTEEG_X1) - #include "pins_AZTEEG_X1.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_AZTEEG_X1.h" // ATmega644P, ATmega1284P // // Other ATmega644P, ATmega644, ATmega1284P // #elif MB(GEN3_MONOLITHIC) - #include "pins_GEN3_MONOLITHIC.h" // ATmega644P env:sanguino_atmega644p + #include "pins_GEN3_MONOLITHIC.h" // ATmega644P #elif MB(GEN3_PLUS) - #include "pins_GEN3_PLUS.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_GEN3_PLUS.h" // ATmega644P, ATmega1284P #elif MB(GEN6) - #include "pins_GEN6.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_GEN6.h" // ATmega644P, ATmega1284P #elif MB(GEN6_DELUXE) - #include "pins_GEN6_DELUXE.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_GEN6_DELUXE.h" // ATmega644P, ATmega1284P #elif MB(GEN7_CUSTOM) - #include "pins_GEN7_CUSTOM.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_GEN7_CUSTOM.h" // ATmega644P, ATmega644, ATmega1284P #elif MB(GEN7_12) - #include "pins_GEN7_12.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_GEN7_12.h" // ATmega644P, ATmega644, ATmega1284P #elif MB(GEN7_13) - #include "pins_GEN7_13.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_GEN7_13.h" // ATmega644P, ATmega644, ATmega1284P #elif MB(GEN7_14) - #include "pins_GEN7_14.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_GEN7_14.h" // ATmega644P, ATmega644, ATmega1284P #elif MB(OMCA_A) - #include "pins_OMCA_A.h" // ATmega644 env:sanguino_atmega644p + #include "pins_OMCA_A.h" // ATmega644 #elif MB(OMCA) - #include "pins_OMCA.h" // ATmega644P, ATmega644 env:sanguino_atmega644p + #include "pins_OMCA.h" // ATmega644P, ATmega644 #elif MB(ANET_10) - #include "pins_ANET_10.h" // ATmega1284P env:sanguino_atmega1284p + #include "pins_ANET_10.h" // ATmega1284P #elif MB(SETHI) - #include "pins_SETHI.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "pins_SETHI.h" // ATmega644P, ATmega644, ATmega1284P // // Teensyduino - AT90USB1286, AT90USB1286P // #elif MB(TEENSYLU) - #include "pins_TEENSYLU.h" // AT90USB1286, AT90USB1286P env:at90USB1286_CDC + #include "pins_TEENSYLU.h" // AT90USB1286, AT90USB1286P #elif MB(PRINTRBOARD) - #include "pins_PRINTRBOARD.h" // AT90USB1286 env:at90USB1286_DFU + #include "pins_PRINTRBOARD.h" // AT90USB1286 #elif MB(PRINTRBOARD_REVF) - #include "pins_PRINTRBOARD_REVF.h" // AT90USB1286 env:at90USB1286_DFU + #include "pins_PRINTRBOARD_REVF.h" // AT90USB1286 #elif MB(BRAINWAVE) - #include "pins_BRAINWAVE.h" // AT90USB646 env:at90USB1286_CDC + #include "pins_BRAINWAVE.h" // AT90USB646 #elif MB(BRAINWAVE_PRO) - #include "pins_BRAINWAVE_PRO.h" // AT90USB1286 env:at90USB1286_CDC + #include "pins_BRAINWAVE_PRO.h" // AT90USB1286 #elif MB(SAV_MKI) - #include "pins_SAV_MKI.h" // AT90USB1286 env:at90USB1286_CDC + #include "pins_SAV_MKI.h" // AT90USB1286 #elif MB(TEENSY2) - #include "pins_TEENSY2.h" // AT90USB1286 env:teensy20 + #include "pins_TEENSY2.h" // AT90USB1286 #elif MB(5DPRINT) - #include "pins_5DPRINT.h" // AT90USB1286 ?env:at90USB1286_DFU + #include "pins_5DPRINT.h" // AT90USB1286 #elif MB(TRIGORILLA) - #include "pins_TRIGORILLA_14.h" - + #include "pins_TRIGORILLA.h" #else #error "Unknown MOTHERBOARD value set in Configuration.h" #endif @@ -289,46 +273,6 @@ #ifndef Z_MS2_PIN #define Z_MS2_PIN -1 #endif -#ifndef Z_MS3_PIN - #define Z_MS3_PIN -1 -#endif -#ifndef E0_MS1_PIN - #define E0_MS1_PIN -1 -#endif -#ifndef E0_MS2_PIN - #define E0_MS2_PIN -1 -#endif -#ifndef E1_MS1_PIN - #define E1_MS1_PIN -1 -#endif -#ifndef E1_MS2_PIN - #define E1_MS2_PIN -1 -#endif -#ifndef E2_MS1_PIN - #define E2_MS1_PIN -1 -#endif -#ifndef E2_MS2_PIN - #define E2_MS2_PIN -1 -#endif -#ifndef E3_MS1_PIN - #define E3_MS1_PIN -1 -#endif -#ifndef E3_MS2_PIN - #define E3_MS2_PIN -1 -#endif -#ifndef E3_MS3_PIN - #define E3_MS3_PIN -1 -#endif -#ifndef E4_MS1_PIN - #define E4_MS1_PIN -1 -#endif -#ifndef E4_MS2_PIN - #define E4_MS2_PIN -1 -#endif -#ifndef E4_MS3_PIN - #define E4_MS3_PIN -1 -#endif - #ifndef E0_STEP_PIN #define E0_STEP_PIN -1 #endif @@ -338,6 +282,12 @@ #ifndef E0_ENABLE_PIN #define E0_ENABLE_PIN -1 #endif +#ifndef E0_MS1_PIN + #define E0_MS1_PIN -1 +#endif +#ifndef E0_MS2_PIN + #define E0_MS2_PIN -1 +#endif #ifndef E1_STEP_PIN #define E1_STEP_PIN -1 #endif @@ -347,6 +297,12 @@ #ifndef E1_ENABLE_PIN #define E1_ENABLE_PIN -1 #endif +#ifndef E1_MS1_PIN + #define E1_MS1_PIN -1 +#endif +#ifndef E1_MS2_PIN + #define E1_MS2_PIN -1 +#endif #ifndef E2_STEP_PIN #define E2_STEP_PIN -1 #endif @@ -375,31 +331,6 @@ #define E4_ENABLE_PIN -1 #endif -#ifndef X_CS_PIN - #define X_CS_PIN -1 -#endif -#ifndef Y_CS_PIN - #define Y_CS_PIN -1 -#endif -#ifndef Z_CS_PIN - #define Z_CS_PIN -1 -#endif -#ifndef E0_CS_PIN - #define E0_CS_PIN -1 -#endif -#ifndef E1_CS_PIN - #define E1_CS_PIN -1 -#endif -#ifndef E2_CS_PIN - #define E2_CS_PIN -1 -#endif -#ifndef E3_CS_PIN - #define E3_CS_PIN -1 -#endif -#ifndef E4_CS_PIN - #define E4_CS_PIN -1 -#endif - #ifndef FAN_PIN #define FAN_PIN -1 #endif @@ -487,54 +418,30 @@ #define MAX_EXTRUDERS 5 #endif +// Marlin needs to account for pins that equal -1 +#define marlinAnalogInputToDigitalPin(p) ((p) == -1 ? -1 : analogInputToDigitalPin(p)) + // // Assign auto fan pins if needed // -#ifndef E0_AUTO_FAN_PIN - #ifdef ORIG_E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN ORIG_E0_AUTO_FAN_PIN - #else - #define E0_AUTO_FAN_PIN -1 - #endif +#if !defined(E0_AUTO_FAN_PIN) && defined(ORIG_E0_AUTO_FAN_PIN) + #define E0_AUTO_FAN_PIN ORIG_E0_AUTO_FAN_PIN #endif -#ifndef E1_AUTO_FAN_PIN - #ifdef ORIG_E1_AUTO_FAN_PIN - #define E1_AUTO_FAN_PIN ORIG_E1_AUTO_FAN_PIN - #else - #define E1_AUTO_FAN_PIN -1 - #endif +#if !defined(E1_AUTO_FAN_PIN) && defined(ORIG_E1_AUTO_FAN_PIN) + #define E1_AUTO_FAN_PIN ORIG_E1_AUTO_FAN_PIN #endif -#ifndef E2_AUTO_FAN_PIN - #ifdef ORIG_E2_AUTO_FAN_PIN - #define E2_AUTO_FAN_PIN ORIG_E2_AUTO_FAN_PIN - #else - #define E2_AUTO_FAN_PIN -1 - #endif +#if !defined(E2_AUTO_FAN_PIN) && defined(ORIG_E2_AUTO_FAN_PIN) + #define E2_AUTO_FAN_PIN ORIG_E2_AUTO_FAN_PIN #endif -#ifndef E3_AUTO_FAN_PIN - #ifdef ORIG_E3_AUTO_FAN_PIN - #define E3_AUTO_FAN_PIN ORIG_E3_AUTO_FAN_PIN - #else - #define E3_AUTO_FAN_PIN -1 - #endif +#if !defined(E3_AUTO_FAN_PIN) && defined(ORIG_E3_AUTO_FAN_PIN) + #define E3_AUTO_FAN_PIN ORIG_E3_AUTO_FAN_PIN #endif -#ifndef E4_AUTO_FAN_PIN - #ifdef ORIG_E4_AUTO_FAN_PIN - #define E4_AUTO_FAN_PIN ORIG_E4_AUTO_FAN_PIN - #else - #define E4_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef CHAMBER_AUTO_FAN_PIN - #ifdef ORIG_CHAMBER_AUTO_FAN_PIN - #define CHAMBER_AUTO_FAN_PIN ORIG_CHAMBER_AUTO_FAN_PIN - #else - #define CHAMBER_AUTO_FAN_PIN -1 - #endif +#if !defined(E4_AUTO_FAN_PIN) && defined(ORIG_E4_AUTO_FAN_PIN) + #define E4_AUTO_FAN_PIN ORIG_E4_AUTO_FAN_PIN #endif // 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, E0_CS_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 @@ -544,32 +451,29 @@ // Tools 0 and 1 use E0 #if EXTRUDERS > 2 // Tools 2 and 3 use E1 #undef _E1_PINS - #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN, + #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, #if EXTRUDERS > 4 // Tools 4 and 5 use E2 #undef _E2_PINS - #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN, + #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, #endif #endif #elif EXTRUDERS > 1 #undef _E1_PINS - #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_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, E2_MS1_PIN, E2_MS2_PIN, E2_CS_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, E3_MS1_PIN, E3_MS2_PIN, E3_MS3_PIN, E3_CS_PIN, + #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, #if EXTRUDERS > 4 #undef _E4_PINS - #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN, E4_MS3_PIN, E4_CS_PIN, + #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, #endif // EXTRUDERS > 4 #endif // EXTRUDERS > 3 #endif // EXTRUDERS > 2 #endif // EXTRUDERS > 1 -// Marlin needs to account for pins that equal -1 -#define marlinAnalogInputToDigitalPin(p) ((p) == -1 ? -1 : analogInputToDigitalPin(p)) - #define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN), #define _H1_PINS #define _H2_PINS @@ -593,16 +497,16 @@ #endif // HOTENDS > 2 #elif ENABLED(MIXING_EXTRUDER) #undef _E1_PINS - #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN, + #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, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN, + #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, E3_MS1_PIN, E3_MS2_PIN, E3_CS_PIN, + #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, #if MIXING_STEPPERS > 4 #undef _E4_PINS - #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN, E4_CS_PIN, + #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, #endif // MIXING_STEPPERS > 4 #endif // MIXING_STEPPERS > 3 #endif // MIXING_STEPPERS > 2 @@ -698,7 +602,6 @@ // Dual X-carriage, Dual Y, Dual Z support // -#define _D_PINS #define _X2_PINS #define _Y2_PINS #define _Z2_PINS @@ -706,77 +609,21 @@ #define __EPIN(p,q) E##p##_##q##_PIN #define _EPIN(p,q) __EPIN(p,q) -// The HANGPRINTER A, B, C, D axes -#if ENABLED(HANGPRINTER) - #define A_ENABLE_PIN X_ENABLE_PIN - #define A_DIR_PIN X_DIR_PIN - #define A_STEP_PIN X_STEP_PIN - #define A_MS1_PIN X_MS1_PIN - - #define B_ENABLE_PIN Y_ENABLE_PIN - #define B_DIR_PIN Y_DIR_PIN - #define B_STEP_PIN Y_STEP_PIN - #define B_MS1_PIN Y_MS1_PIN - - #define C_ENABLE_PIN Z_ENABLE_PIN - #define C_DIR_PIN Z_DIR_PIN - #define C_STEP_PIN Z_STEP_PIN - #define C_MS1_PIN Z_MS1_PIN - - #ifndef D_STEP_PIN - #define D_STEP_PIN _EPIN(E_STEPPERS, STEP) - #define D_DIR_PIN _EPIN(E_STEPPERS, DIR) - #define D_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE) - #ifndef D_CS_PIN - #define D_CS_PIN _EPIN(E_STEPPERS, CS) - #endif - #ifndef D_MS1_PIN - #define D_MS1_PIN _EPIN(E_STEPPERS, MS1) - #endif - #if E_STEPPERS >= MAX_EXTRUDERS || !PIN_EXISTS(D_ENABLE) - #error "No E stepper plug left for D Axis!" - #endif - #endif - #undef _D_PINS - #define ___D_PINS D_STEP_PIN, D_DIR_PIN, D_ENABLE_PIN, - #ifdef D_CS_PIN - #define __D_PINS ___D_PINS D_CS_PIN, - #else - #define __D_PINS ___D_PINS - #endif - #ifdef D_MS1_PIN - #define _D_PINS __D_PINS D_MS1_PIN, - #else - #define _D_PINS __D_PINS - #endif - #define X2_E_INDEX INCREMENT(E_STEPPERS) -#else - #define X2_E_INDEX E_STEPPERS -#endif - // 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(X2_E_INDEX, STEP) - #define X2_DIR_PIN _EPIN(X2_E_INDEX, DIR) - #define X2_ENABLE_PIN _EPIN(X2_E_INDEX, ENABLE) - #ifndef X2_CS_PIN - #define X2_CS_PIN _EPIN(X2_E_INDEX, CS) - #endif - #if X2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(X2_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) + #if E_STEPPERS > 4 || !PIN_EXISTS(X2_ENABLE) #error "No E stepper plug left for X2!" #endif #endif #undef _X2_PINS - #define __X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN, - #ifdef X2_CS_PIN - #define _X2_PINS __X2_PINS X2_CS_PIN, - #else - #define _X2_PINS __X2_PINS - #endif - #define Y2_E_INDEX INCREMENT(X2_E_INDEX) + #define _X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN, + #define Y2_E_INDEX INCREMENT(E_STEPPERS) #else - #define Y2_E_INDEX X2_E_INDEX + #define Y2_E_INDEX E_STEPPERS #endif // The Y2 axis, if any, should be the next open extruder port @@ -785,20 +632,12 @@ #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) - #ifndef Y2_CS_PIN - #define Y2_CS_PIN _EPIN(Y2_E_INDEX, CS) - #endif - #if Y2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Y2_ENABLE) + #if Y2_E_INDEX > 4 || !PIN_EXISTS(Y2_ENABLE) #error "No E stepper plug left for Y2!" #endif #endif #undef _Y2_PINS - #define __Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN, - #ifdef Y2_CS_PIN - #define _Y2_PINS __Y2_PINS Y2_CS_PIN, - #else - #define _Y2_PINS __Y2_PINS - #endif + #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 @@ -810,30 +649,23 @@ #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) - #ifndef Z2_CS_PIN - #define Z2_CS_PIN _EPIN(Z2_E_INDEX, CS) - #endif - #if Z2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z2_ENABLE) + #if Z2_E_INDEX > 4 || !PIN_EXISTS(Z2_ENABLE) #error "No E stepper plug left for Z2!" #endif #endif #undef _Z2_PINS - #define __Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN, - #ifdef Z2_CS_PIN - #define _Z2_PINS __Z2_PINS Z2_CS_PIN, - #else - #define _Z2_PINS __Z2_PINS - #endif + #define _Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN, #endif #define SENSITIVE_PINS { 0, 1, \ - X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, X_MS1_PIN, X_MS2_PIN, X_CS_PIN, \ - Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Y_MS1_PIN, Y_MS2_PIN, Y_CS_PIN, \ - Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MS1_PIN, Z_MS2_PIN, Z_MS3_PIN, Z_CS_PIN, Z_MIN_PROBE_PIN, \ + X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, \ + Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, \ + Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MIN_PROBE_PIN, \ PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLER_FAN_PIN, \ _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS BED_PINS \ _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS \ - _D_PINS _X2_PINS _Y2_PINS _Z2_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)) diff --git a/Marlin/pinsDebug.h b/Marlin/pinsDebug.h index ba6241f..239e9c4 100644 --- a/Marlin/pinsDebug.h +++ b/Marlin/pinsDebug.h @@ -1,6 +1,6 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm @@ -20,16 +20,12 @@ * */ +bool endstop_monitor_flag = false; + #define NAME_FORMAT "%-35s" // one place to specify the format of all the sources of names // "-" left justify, "28" minimum width of name, pad with blanks -#if AVR_ATmega1284_FAMILY - #define DIGITAL_PIN_TO_ANALOG_PIN(P) int(analogInputToDigitalPin(0) - (P)) - #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(7) && (P) <= analogInputToDigitalPin(0)) -#else - #define DIGITAL_PIN_TO_ANALOG_PIN(P) int((P) - analogInputToDigitalPin(0)) - #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7))) -#endif +#define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7))) /** * This routine minimizes RAM usage by creating a FLASH resident array to @@ -47,8 +43,8 @@ #define _ADD_PIN_2(PIN_NAME, ENTRY_NAME) static const char ENTRY_NAME[] PROGMEM = { PIN_NAME }; #define _ADD_PIN(PIN_NAME, COUNTER) _ADD_PIN_2(PIN_NAME, entry_NAME_##COUNTER) -#define REPORT_NAME_DIGITAL(COUNTER, NAME) _ADD_PIN(#NAME, COUNTER) -#define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(#NAME, COUNTER) +#define REPORT_NAME_DIGITAL(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER) +#define REPORT_NAME_ANALOG(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER) #include "pinsDebug_list.h" #line 51 @@ -70,12 +66,12 @@ #define _ADD_PIN_2(ENTRY_NAME, NAME, IS_DIGITAL) { ENTRY_NAME, NAME, IS_DIGITAL }, #define _ADD_PIN(NAME, COUNTER, IS_DIGITAL) _ADD_PIN_2(entry_NAME_##COUNTER, NAME, IS_DIGITAL) -#define REPORT_NAME_DIGITAL(COUNTER, NAME) _ADD_PIN(NAME, COUNTER, true) -#define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(analogInputToDigitalPin(NAME), COUNTER, false) +#define REPORT_NAME_DIGITAL(NAME, COUNTER) _ADD_PIN(NAME, COUNTER, true) +#define REPORT_NAME_ANALOG(NAME, COUNTER) _ADD_PIN(analogInputToDigitalPin(NAME), COUNTER, false) typedef struct { const char * const name; - pin_t pin; + uint8_t pin; bool is_digital; } PinInfo; @@ -478,9 +474,9 @@ inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = f for (uint8_t y = 0; y < 28; y++) { // always print pin name temp_char = pgm_read_byte(name_mem_pointer + y); if (temp_char != 0) - SERIAL_CHAR(temp_char); + MYSERIAL.write(temp_char); else { - for (uint8_t i = 0; i < 28 - y; i++) SERIAL_CHAR(' '); + for (uint8_t i = 0; i < 28 - y; i++) MYSERIAL.write(' '); break; } } diff --git a/Marlin/pinsDebug_Teensyduino.h b/Marlin/pinsDebug_Teensyduino.h index 3e08bbb..797a2cd 100644 --- a/Marlin/pinsDebug_Teensyduino.h +++ b/Marlin/pinsDebug_Teensyduino.h @@ -29,7 +29,7 @@ #define __PINSDEBUG_TEENSYDUINO_H__ #undef NUM_DIGITAL_PINS -#define NUM_DIGITAL_PINS 48 // Teensy says 46 but FASTIO is 48 +#define NUM_DIGITAL_PINS 48 // Teensy says 46 but FASTIO is 48 // "digitalPinToPort" function just returns the pin number so need to create our own. // Can't use the name "digitalPinToPort" for our own because it interferes with the @@ -42,6 +42,7 @@ #define PE 5 #define PF 6 + const uint8_t PROGMEM digital_pin_to_port_PGM_Teensy[] = { PD, // 0 - PD0 - INT0 - PWM PD, // 1 - PD1 - INT1 - PWM diff --git a/Marlin/pinsDebug_list.h b/Marlin/pinsDebug_list.h index b72c26d..e6de27a 100644 --- a/Marlin/pinsDebug_list.h +++ b/Marlin/pinsDebug_list.h @@ -25,1009 +25,820 @@ // Following this pattern is a must. // If the new pin name is over 28 characters long then pinsDebug.h will need to be modified. -// Pin lists 1.1.x and 2.0.x synchronized 2018-02-17 +// Pin list updated from 18 FEB 2017 RCBugfix branch - max length of pin name is 24 -#line 31 // set __LINE__ to a known value for both passes +#line 0 // set __LINE__ to a known value for both passes -// -// Analog Pin Assignments -// - -#if defined(EXT_AUX_A0) && EXT_AUX_A0 >= 0 && EXT_AUX_A0 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0) -#endif -#if defined(EXT_AUX_A1) && EXT_AUX_A1 >= 0 && EXT_AUX_A1 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A1) -#endif -#if defined(EXT_AUX_A2) && EXT_AUX_A2 >= 0 && EXT_AUX_A2 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A2) -#endif -#if defined(EXT_AUX_A3) && EXT_AUX_A3 >= 0 && EXT_AUX_A3 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A3) -#endif -#if defined(EXT_AUX_A4) && EXT_AUX_A4 >= 0 && EXT_AUX_A4 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A4) -#endif -#if PIN_EXISTS(FILWIDTH) && FILWIDTH_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, FILWIDTH_PIN) -#endif -#if PIN_EXISTS(MAIN_VOLTAGE_MEASURE) && MAIN_VOLTAGE_MEASURE_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, MAIN_VOLTAGE_MEASURE_PIN) -#endif -#if !defined(ARDUINO_ARCH_SAM) //TC1 & TC2 are macros in the SAM tool chain - #if defined(TC1) && TC1 >= 0 && TC1 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TC1) - #endif - #if defined(TC2) && TC2 >= 0 && TC2 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TC2) - #endif -#endif -#if PIN_EXISTS(TEMP_0) && TEMP_0_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_0_PIN) -#endif -#if PIN_EXISTS(TEMP_1) && TEMP_1_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_1_PIN) -#endif -#if PIN_EXISTS(TEMP_2) && TEMP_2_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_2_PIN) -#endif -#if PIN_EXISTS(TEMP_3) && TEMP_3_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_3_PIN) -#endif -#if PIN_EXISTS(TEMP_4) && TEMP_4_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_4_PIN) -#endif -#if PIN_EXISTS(TEMP_BED) && TEMP_BED_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_BED_PIN) -#endif -#if PIN_EXISTS(TEMP_CHAMBER) && TEMP_CHAMBER_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_CHAMBER_PIN) -#endif #if PIN_EXISTS(ADC_KEYPAD) && ADC_KEYPAD_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, ADC_KEYPAD_PIN) + REPORT_NAME_ANALOG(ADC_KEYPAD_PIN, __LINE__ ) #endif - -// -// Digital Pin Assignments -// - #if defined(__FD) && __FD >= 0 - REPORT_NAME_DIGITAL(__LINE__, __FD) + REPORT_NAME_DIGITAL(__FD, __LINE__ ) #endif #if defined(__FS) && __FS >= 0 - REPORT_NAME_DIGITAL(__LINE__, __FS) + REPORT_NAME_DIGITAL(__FS, __LINE__ ) #endif #if defined(__GD) && __GD >= 0 - REPORT_NAME_DIGITAL(__LINE__, __GD) + REPORT_NAME_DIGITAL(__GD, __LINE__ ) #endif #if defined(__GS) && __GS >= 0 - REPORT_NAME_DIGITAL(__LINE__, __GS) + REPORT_NAME_DIGITAL(__GS, __LINE__ ) +#endif +#if PIN_EXISTS(ADC_KEYPAD) + REPORT_NAME_ANALOG(ADC_KEYPAD_PIN, __LINE__ ) #endif #if PIN_EXISTS(AVR_MISO) - REPORT_NAME_DIGITAL(__LINE__, AVR_MISO_PIN) + REPORT_NAME_DIGITAL(AVR_MISO_PIN, __LINE__ ) #endif #if PIN_EXISTS(AVR_MOSI) - REPORT_NAME_DIGITAL(__LINE__, AVR_MOSI_PIN) + REPORT_NAME_DIGITAL(AVR_MOSI_PIN, __LINE__ ) #endif #if PIN_EXISTS(AVR_SCK) - REPORT_NAME_DIGITAL(__LINE__, AVR_SCK_PIN) -#endif -#if PIN_EXISTS(ALARM) - REPORT_NAME_DIGITAL(__LINE__, ALARM_PIN) + REPORT_NAME_DIGITAL(AVR_SCK_PIN, __LINE__ ) #endif #if PIN_EXISTS(AVR_SS) - REPORT_NAME_DIGITAL(__LINE__, AVR_SS_PIN) + REPORT_NAME_DIGITAL(AVR_SS_PIN, __LINE__ ) #endif #if PIN_EXISTS(BEEPER) - REPORT_NAME_DIGITAL(__LINE__, BEEPER_PIN) -#endif -#if defined(BTN_BACK) && BTN_BACK >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_BACK) + REPORT_NAME_DIGITAL(BEEPER_PIN, __LINE__ ) #endif #if defined(BTN_CENTER) && BTN_CENTER >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_CENTER) + REPORT_NAME_DIGITAL(BTN_CENTER, __LINE__ ) #endif #if defined(BTN_DOWN) && BTN_DOWN >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_DOWN) + REPORT_NAME_DIGITAL(BTN_DOWN, __LINE__ ) #endif #if defined(BTN_DWN) && BTN_DWN >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_DWN) + REPORT_NAME_DIGITAL(BTN_DWN, __LINE__ ) #endif #if defined(BTN_EN1) && BTN_EN1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_EN1) + REPORT_NAME_DIGITAL(BTN_EN1, __LINE__ ) #endif #if defined(BTN_EN2) && BTN_EN2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_EN2) + REPORT_NAME_DIGITAL(BTN_EN2, __LINE__ ) #endif #if defined(BTN_ENC) && BTN_ENC >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_ENC) + REPORT_NAME_DIGITAL(BTN_ENC, __LINE__ ) #endif #if defined(BTN_HOME) && BTN_HOME >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_HOME) + REPORT_NAME_DIGITAL(BTN_HOME, __LINE__ ) #endif #if defined(BTN_LEFT) && BTN_LEFT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_LEFT) + REPORT_NAME_DIGITAL(BTN_LEFT, __LINE__ ) #endif #if defined(BTN_LFT) && BTN_LFT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_LFT) + REPORT_NAME_DIGITAL(BTN_LFT, __LINE__ ) #endif #if defined(BTN_RIGHT) && BTN_RIGHT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_RIGHT) + REPORT_NAME_DIGITAL(BTN_RIGHT, __LINE__ ) #endif #if defined(BTN_RT) && BTN_RT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_RT) + REPORT_NAME_DIGITAL(BTN_RT, __LINE__ ) #endif #if defined(BTN_UP) && BTN_UP >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_UP) + REPORT_NAME_DIGITAL(BTN_UP, __LINE__ ) #endif #if PIN_EXISTS(CASE_LIGHT) - REPORT_NAME_DIGITAL(__LINE__, CASE_LIGHT_PIN) -#endif -#if PIN_EXISTS(CHAMBER_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, CHAMBER_AUTO_FAN_PIN) + REPORT_NAME_DIGITAL(CASE_LIGHT_PIN, __LINE__ ) #endif #if PIN_EXISTS(CONTROLLER_FAN) - REPORT_NAME_DIGITAL(__LINE__, CONTROLLER_FAN_PIN) + REPORT_NAME_DIGITAL(CONTROLLER_FAN_PIN, __LINE__ ) #endif #if PIN_EXISTS(CUTOFF_RESET) - REPORT_NAME_DIGITAL(__LINE__, CUTOFF_RESET_PIN) + REPORT_NAME_DIGITAL(CUTOFF_RESET_PIN, __LINE__ ) #endif #if PIN_EXISTS(CUTOFF_TEST) - REPORT_NAME_DIGITAL(__LINE__, CUTOFF_TEST_PIN) -#endif -#if defined(D57) && D57 >= 0 - REPORT_NAME_DIGITAL(__LINE__, D57) -#endif -#if defined(D58) && D58 >= 0 - REPORT_NAME_DIGITAL(__LINE__, D58) + REPORT_NAME_DIGITAL(CUTOFF_TEST_PIN, __LINE__ ) #endif #if PIN_EXISTS(DAC_DISABLE) - REPORT_NAME_DIGITAL(__LINE__, DAC_DISABLE_PIN) + REPORT_NAME_DIGITAL(DAC_DISABLE_PIN, __LINE__ ) #endif -#if defined(DAC0_SYNC) && DAC0_SYNC >= 0 - REPORT_NAME_DIGITAL(__LINE__, DAC0_SYNC) -#endif -#if defined(DAC1_SYNC) && DAC1_SYNC >= 0 - REPORT_NAME_DIGITAL(__LINE__, DAC1_SYNC) +#if defined(DAC_STEPPER_VREF) && DAC_STEPPER_VREF >= 0 + REPORT_NAME_DIGITAL(DAC_STEPPER_VREF, __LINE__ ) #endif #if PIN_EXISTS(DEBUG) - REPORT_NAME_DIGITAL(__LINE__, DEBUG_PIN) + REPORT_NAME_DIGITAL(DEBUG_PIN, __LINE__ ) #endif #if defined(DIGIPOTS_I2C_SCL) && DIGIPOTS_I2C_SCL >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SCL) + REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SCL, __LINE__ ) #endif #if defined(DIGIPOTS_I2C_SDA_E0) && DIGIPOTS_I2C_SDA_E0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_E0) + REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_E0, __LINE__ ) #endif #if defined(DIGIPOTS_I2C_SDA_E1) && DIGIPOTS_I2C_SDA_E1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_E1) + REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_E1, __LINE__ ) #endif #if defined(DIGIPOTS_I2C_SDA_X) && DIGIPOTS_I2C_SDA_X >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_X) + REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_X, __LINE__ ) #endif #if defined(DIGIPOTS_I2C_SDA_Y) && DIGIPOTS_I2C_SDA_Y >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_Y) + REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_Y, __LINE__ ) #endif #if defined(DIGIPOTS_I2C_SDA_Z) && DIGIPOTS_I2C_SDA_Z >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_Z) + REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_Z, __LINE__ ) #endif #if PIN_EXISTS(DIGIPOTSS) - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTSS_PIN) + REPORT_NAME_DIGITAL(DIGIPOTSS_PIN, __LINE__ ) #endif #if defined(DOGLCD_A0) && DOGLCD_A0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_A0) + REPORT_NAME_DIGITAL(DOGLCD_A0, __LINE__ ) #endif #if defined(DOGLCD_CS) && DOGLCD_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_CS) + REPORT_NAME_DIGITAL(DOGLCD_CS, __LINE__ ) #endif #if defined(DOGLCD_MOSI) && DOGLCD_MOSI >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_MOSI) + REPORT_NAME_DIGITAL(DOGLCD_MOSI, __LINE__ ) #endif #if defined(DOGLCD_SCK) && DOGLCD_SCK >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_SCK) -#endif -#if defined(TMC_SW_MISO) && TMC_SW_MISO >= 0 - REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MISO) -#endif -#if defined(TMC_SW_MOSI) && TMC_SW_MOSI >= 0 - REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MOSI) -#endif -#if defined(TMC_SW_SCK) && TMC_SW_SCK >= 0 - REPORT_NAME_DIGITAL(__LINE__, TMC_SW_SCK) -#endif -#if PIN_EXISTS(E_MUX0) - REPORT_NAME_DIGITAL(__LINE__, E_MUX0_PIN) -#endif -#if PIN_EXISTS(E_MUX1) - REPORT_NAME_DIGITAL(__LINE__, E_MUX1_PIN) -#endif -#if PIN_EXISTS(E_MUX2) - REPORT_NAME_DIGITAL(__LINE__, E_MUX2_PIN) -#endif -#if PIN_EXISTS(E_STOP) - REPORT_NAME_DIGITAL(__LINE__, E_STOP_PIN) + REPORT_NAME_DIGITAL(DOGLCD_SCK, __LINE__ ) #endif #if PIN_EXISTS(E0_ATT) - REPORT_NAME_DIGITAL(__LINE__, E0_ATT_PIN) + REPORT_NAME_DIGITAL(E0_ATT_PIN, __LINE__ ) #endif #if PIN_EXISTS(E0_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E0_AUTO_FAN_PIN) + REPORT_NAME_DIGITAL(E0_AUTO_FAN_PIN, __LINE__ ) #endif #if PIN_EXISTS(E0_CS) - REPORT_NAME_DIGITAL(__LINE__, E0_CS_PIN) + REPORT_NAME_DIGITAL(E0_CS_PIN, __LINE__ ) #endif #if PIN_EXISTS(E0_DIR) - REPORT_NAME_DIGITAL(__LINE__, E0_DIR_PIN) + REPORT_NAME_DIGITAL(E0_DIR_PIN, __LINE__ ) #endif #if PIN_EXISTS(E0_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E0_ENABLE_PIN) + REPORT_NAME_DIGITAL(E0_ENABLE_PIN, __LINE__ ) #endif #if PIN_EXISTS(E0_MS1) - REPORT_NAME_DIGITAL(__LINE__, E0_MS1_PIN) + REPORT_NAME_DIGITAL(E0_MS1_PIN, __LINE__ ) #endif #if PIN_EXISTS(E0_MS2) - REPORT_NAME_DIGITAL(__LINE__, E0_MS2_PIN) + REPORT_NAME_DIGITAL(E0_MS2_PIN, __LINE__ ) #endif #if PIN_EXISTS(E0_STEP) - REPORT_NAME_DIGITAL(__LINE__, E0_STEP_PIN) + REPORT_NAME_DIGITAL(E0_STEP_PIN, __LINE__ ) #endif #if PIN_EXISTS(E1_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E1_AUTO_FAN_PIN) + REPORT_NAME_DIGITAL(E1_AUTO_FAN_PIN, __LINE__ ) #endif #if PIN_EXISTS(E1_CS) - REPORT_NAME_DIGITAL(__LINE__, E1_CS_PIN) + REPORT_NAME_DIGITAL(E1_CS_PIN, __LINE__ ) #endif #if PIN_EXISTS(E1_DIR) - REPORT_NAME_DIGITAL(__LINE__, E1_DIR_PIN) + REPORT_NAME_DIGITAL(E1_DIR_PIN, __LINE__ ) #endif #if PIN_EXISTS(E1_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E1_ENABLE_PIN) + REPORT_NAME_DIGITAL(E1_ENABLE_PIN, __LINE__ ) #endif #if PIN_EXISTS(E1_MS1) - REPORT_NAME_DIGITAL(__LINE__, E1_MS1_PIN) + REPORT_NAME_DIGITAL(E1_MS1_PIN, __LINE__ ) #endif #if PIN_EXISTS(E1_MS2) - REPORT_NAME_DIGITAL(__LINE__, E1_MS2_PIN) + REPORT_NAME_DIGITAL(E1_MS2_PIN, __LINE__ ) #endif #if PIN_EXISTS(E1_STEP) - REPORT_NAME_DIGITAL(__LINE__, E1_STEP_PIN) + REPORT_NAME_DIGITAL(E1_STEP_PIN, __LINE__ ) #endif #if PIN_EXISTS(E2_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E2_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E2_CS) - REPORT_NAME_DIGITAL(__LINE__, E2_CS_PIN) + REPORT_NAME_DIGITAL(E2_AUTO_FAN_PIN, __LINE__ ) #endif #if PIN_EXISTS(E2_DIR) - REPORT_NAME_DIGITAL(__LINE__, E2_DIR_PIN) + REPORT_NAME_DIGITAL(E2_DIR_PIN, __LINE__ ) #endif #if PIN_EXISTS(E2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E2_ENABLE_PIN) -#endif -#if PIN_EXISTS(E2_MS1) - REPORT_NAME_DIGITAL(__LINE__, E2_MS1_PIN) -#endif -#if PIN_EXISTS(E2_MS2) - REPORT_NAME_DIGITAL(__LINE__, E2_MS2_PIN) + REPORT_NAME_DIGITAL(E2_ENABLE_PIN, __LINE__ ) #endif #if PIN_EXISTS(E2_STEP) - REPORT_NAME_DIGITAL(__LINE__, E2_STEP_PIN) + REPORT_NAME_DIGITAL(E2_STEP_PIN, __LINE__ ) #endif #if PIN_EXISTS(E3_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E3_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E3_CS) - REPORT_NAME_DIGITAL(__LINE__, E3_CS_PIN) + REPORT_NAME_DIGITAL(E3_AUTO_FAN_PIN, __LINE__ ) #endif #if PIN_EXISTS(E3_DIR) - REPORT_NAME_DIGITAL(__LINE__, E3_DIR_PIN) + REPORT_NAME_DIGITAL(E3_DIR_PIN, __LINE__ ) #endif #if PIN_EXISTS(E3_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E3_ENABLE_PIN) -#endif -#if PIN_EXISTS(E3_MS1) - REPORT_NAME_DIGITAL(__LINE__, E3_MS1_PIN) -#endif -#if PIN_EXISTS(E3_MS2) - REPORT_NAME_DIGITAL(__LINE__, E3_MS2_PIN) -#endif -#if PIN_EXISTS(E3_MS3) - REPORT_NAME_DIGITAL(__LINE__, E3_MS3_PIN) + REPORT_NAME_DIGITAL(E3_ENABLE_PIN, __LINE__ ) #endif #if PIN_EXISTS(E3_STEP) - REPORT_NAME_DIGITAL(__LINE__, E3_STEP_PIN) + REPORT_NAME_DIGITAL(E3_STEP_PIN, __LINE__ ) #endif #if PIN_EXISTS(E4_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E4_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E4_CS) - REPORT_NAME_DIGITAL(__LINE__, E4_CS_PIN) + REPORT_NAME_DIGITAL(E4_AUTO_FAN_PIN, __LINE__ ) #endif #if PIN_EXISTS(E4_DIR) - REPORT_NAME_DIGITAL(__LINE__, E4_DIR_PIN) + REPORT_NAME_DIGITAL(E4_DIR_PIN, __LINE__ ) #endif #if PIN_EXISTS(E4_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E4_ENABLE_PIN) -#endif -#if PIN_EXISTS(E4_MS1) - REPORT_NAME_DIGITAL(__LINE__, E4_MS1_PIN) -#endif -#if PIN_EXISTS(E4_MS2) - REPORT_NAME_DIGITAL(__LINE__, E4_MS2_PIN) -#endif -#if PIN_EXISTS(E4_MS3) - REPORT_NAME_DIGITAL(__LINE__, E4_MS3_PIN) + REPORT_NAME_DIGITAL(E4_ENABLE_PIN, __LINE__ ) #endif #if PIN_EXISTS(E4_STEP) - REPORT_NAME_DIGITAL(__LINE__, E4_STEP_PIN) + REPORT_NAME_DIGITAL(E4_STEP_PIN, __LINE__ ) #endif -#if defined(ENET_CRS) && ENET_CRS >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_CRS) +#if defined(EXT_AUX_A0) && EXT_AUX_A0 >= 0 && EXT_AUX_A0 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(EXT_AUX_A0, __LINE__ ) #endif -#if defined(ENET_MDIO) && ENET_MDIO >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_MDIO) +#if defined(EXT_AUX_A0) && EXT_AUX_A0 >= 0 && EXT_AUX_A0 >= NUM_ANALOG_INPUTS + REPORT_NAME_DIGITAL(EXT_AUX_A0, __LINE__ ) #endif -#if defined(ENET_MOC) && ENET_MOC >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_MOC) -#endif -#if defined(ENET_RX_ER) && ENET_RX_ER >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_RX_ER) -#endif -#if defined(ENET_RXD0) && ENET_RXD0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_RXD0) -#endif -#if defined(ENET_RXD1) && ENET_RXD1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_RXD1) -#endif -#if defined(ENET_TX_EN) && ENET_TX_EN >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_TX_EN) -#endif -#if defined(ENET_TXD0) && ENET_TXD0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_TXD0) -#endif -#if defined(ENET_TXD1) && ENET_TXD1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_TXD1) -#endif -#if PIN_EXISTS(EXP_VOLTAGE_LEVEL) - REPORT_NAME_DIGITAL(__LINE__, EXP_VOLTAGE_LEVEL_PIN) -#endif - #if defined(EXT_AUX_A0_IO) && EXT_AUX_A0_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A0_IO) + REPORT_NAME_DIGITAL(EXT_AUX_A0_IO, __LINE__ ) +#endif +#if defined(EXT_AUX_A1) && EXT_AUX_A1 >= 0 && EXT_AUX_A1 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(EXT_AUX_A1, __LINE__ ) +#endif +#if defined(EXT_AUX_A1) && EXT_AUX_A1 >= 0 && EXT_AUX_A1 >= NUM_ANALOG_INPUTS + REPORT_NAME_DIGITAL(EXT_AUX_A1, __LINE__ ) #endif #if defined(EXT_AUX_A1_IO) && EXT_AUX_A1_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A1_IO) + REPORT_NAME_DIGITAL(EXT_AUX_A1_IO, __LINE__ ) +#endif +#if defined(EXT_AUX_A2) && EXT_AUX_A2 >= 0 && EXT_AUX_A2 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(EXT_AUX_A2, __LINE__ ) +#endif +#if defined(EXT_AUX_A2) && EXT_AUX_A2 >= 0 && EXT_AUX_A2 >= NUM_ANALOG_INPUTS + REPORT_NAME_DIGITAL(EXT_AUX_A2, __LINE__ ) #endif #if defined(EXT_AUX_A2_IO) && EXT_AUX_A2_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A2_IO) + REPORT_NAME_DIGITAL(EXT_AUX_A2_IO, __LINE__ ) +#endif +#if defined(EXT_AUX_A3) && EXT_AUX_A3 >= 0 && EXT_AUX_A3 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(EXT_AUX_A3, __LINE__ ) +#endif +#if defined(EXT_AUX_A3) && EXT_AUX_A3 >= 0 && EXT_AUX_A3 >= NUM_ANALOG_INPUTS + REPORT_NAME_DIGITAL(EXT_AUX_A3, __LINE__ ) #endif #if defined(EXT_AUX_A3_IO) && EXT_AUX_A3_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A3_IO) + REPORT_NAME_DIGITAL(EXT_AUX_A3_IO, __LINE__ ) +#endif +#if defined(EXT_AUX_A4) && EXT_AUX_A4 >= 0 && EXT_AUX_A4 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(EXT_AUX_A4, __LINE__ ) +#endif +#if defined(EXT_AUX_A4) && EXT_AUX_A4 >= 0 && EXT_AUX_A4 >= NUM_ANALOG_INPUTS + REPORT_NAME_DIGITAL(EXT_AUX_A4, __LINE__ ) #endif #if defined(EXT_AUX_A4_IO) && EXT_AUX_A4_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A4_IO) + REPORT_NAME_DIGITAL(EXT_AUX_A4_IO, __LINE__ ) #endif #if defined(EXT_AUX_PWM_D24) && EXT_AUX_PWM_D24 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_PWM_D24) + REPORT_NAME_DIGITAL(EXT_AUX_PWM_D24, __LINE__ ) #endif #if defined(EXT_AUX_RX1_D2) && EXT_AUX_RX1_D2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_RX1_D2) + REPORT_NAME_DIGITAL(EXT_AUX_RX1_D2, __LINE__ ) #endif #if defined(EXT_AUX_SCL_D0) && EXT_AUX_SCL_D0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_SCL_D0) + REPORT_NAME_DIGITAL(EXT_AUX_SCL_D0, __LINE__ ) #endif #if defined(EXT_AUX_SDA_D1) && EXT_AUX_SDA_D1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_SDA_D1) + REPORT_NAME_DIGITAL(EXT_AUX_SDA_D1, __LINE__ ) #endif #if defined(EXT_AUX_TX1_D3) && EXT_AUX_TX1_D3 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_TX1_D3) + REPORT_NAME_DIGITAL(EXT_AUX_TX1_D3, __LINE__ ) #endif #if defined(EXTRUDER_0_AUTO_FAN) && EXTRUDER_0_AUTO_FAN >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXTRUDER_0_AUTO_FAN) + REPORT_NAME_DIGITAL(EXTRUDER_0_AUTO_FAN, __LINE__ ) #endif #if defined(EXTRUDER_1_AUTO_FAN) && EXTRUDER_1_AUTO_FAN >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXTRUDER_1_AUTO_FAN) + REPORT_NAME_DIGITAL(EXTRUDER_1_AUTO_FAN, __LINE__ ) #endif #if PIN_EXISTS(FAN) - REPORT_NAME_DIGITAL(__LINE__, FAN_PIN) + REPORT_NAME_DIGITAL(FAN_PIN, __LINE__ ) #endif #if PIN_EXISTS(FAN1) - REPORT_NAME_DIGITAL(__LINE__, FAN1_PIN) + REPORT_NAME_DIGITAL(FAN1_PIN, __LINE__ ) #endif #if PIN_EXISTS(FAN2) - REPORT_NAME_DIGITAL(__LINE__, FAN2_PIN) -#endif -#if PIN_EXISTS(FAN3) - REPORT_NAME_DIGITAL(__LINE__, FAN3_PIN) + REPORT_NAME_DIGITAL(FAN2_PIN, __LINE__ ) #endif #if PIN_EXISTS(FIL_RUNOUT) - REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT_PIN) + REPORT_NAME_DIGITAL(FIL_RUNOUT_PIN, __LINE__ ) #endif -#if PIN_EXISTS(FIL_RUNOUT2) - REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT2_PIN) -#endif -#if PIN_EXISTS(FIL_RUNOUT3) - REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT3_PIN) -#endif -#if PIN_EXISTS(FIL_RUNOUT4) - REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT4_PIN) -#endif -#if PIN_EXISTS(FIL_RUNOUT5) - REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT5_PIN) +#if PIN_EXISTS(FILWIDTH) && FILWIDTH_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(FILWIDTH_PIN, __LINE__ ) #endif #if PIN_EXISTS(HEATER_0) - REPORT_NAME_DIGITAL(__LINE__, HEATER_0_PIN) + REPORT_NAME_DIGITAL(HEATER_0_PIN, __LINE__ ) #endif #if PIN_EXISTS(HEATER_1) - REPORT_NAME_DIGITAL(__LINE__, HEATER_1_PIN) + REPORT_NAME_DIGITAL(HEATER_1_PIN, __LINE__ ) #endif #if PIN_EXISTS(HEATER_2) - REPORT_NAME_DIGITAL(__LINE__, HEATER_2_PIN) + REPORT_NAME_DIGITAL(HEATER_2_PIN, __LINE__ ) #endif #if PIN_EXISTS(HEATER_3) - REPORT_NAME_DIGITAL(__LINE__, HEATER_3_PIN) + REPORT_NAME_DIGITAL(HEATER_3_PIN, __LINE__ ) #endif #if PIN_EXISTS(HEATER_4) - REPORT_NAME_DIGITAL(__LINE__, HEATER_4_PIN) + REPORT_NAME_DIGITAL(HEATER_4_PIN, __LINE__ ) #endif #if PIN_EXISTS(HEATER_5) - REPORT_NAME_DIGITAL(__LINE__, HEATER_5_PIN) + REPORT_NAME_DIGITAL(HEATER_5_PIN, __LINE__ ) #endif #if PIN_EXISTS(HEATER_6) - REPORT_NAME_DIGITAL(__LINE__, HEATER_6_PIN) + REPORT_NAME_DIGITAL(HEATER_6_PIN, __LINE__ ) #endif #if PIN_EXISTS(HEATER_7) - REPORT_NAME_DIGITAL(__LINE__, HEATER_7_PIN) + REPORT_NAME_DIGITAL(HEATER_7_PIN, __LINE__ ) #endif #if PIN_EXISTS(HEATER_BED) - REPORT_NAME_DIGITAL(__LINE__, HEATER_BED_PIN) + REPORT_NAME_DIGITAL(HEATER_BED_PIN, __LINE__ ) #endif #if PIN_EXISTS(HOME) - REPORT_NAME_DIGITAL(__LINE__, HOME_PIN) + REPORT_NAME_DIGITAL(HOME_PIN, __LINE__ ) #endif #if PIN_EXISTS(I2C_SCL) - REPORT_NAME_DIGITAL(__LINE__, I2C_SCL_PIN) + REPORT_NAME_DIGITAL(I2C_SCL_PIN, __LINE__ ) #endif #if PIN_EXISTS(I2C_SDA) - REPORT_NAME_DIGITAL(__LINE__, I2C_SDA_PIN) + REPORT_NAME_DIGITAL(I2C_SDA_PIN, __LINE__ ) #endif #if PIN_EXISTS(KILL) - REPORT_NAME_DIGITAL(__LINE__, KILL_PIN) + REPORT_NAME_DIGITAL(KILL_PIN, __LINE__ ) #endif #if PIN_EXISTS(LCD_BACKLIGHT) - REPORT_NAME_DIGITAL(__LINE__, LCD_BACKLIGHT_PIN) + REPORT_NAME_DIGITAL(LCD_BACKLIGHT_PIN, __LINE__ ) +#endif +#if defined(LCD_CONTRAST) && LCD_CONTRAST >= 0 + REPORT_NAME_DIGITAL(LCD_CONTRAST, __LINE__ ) #endif #if defined(LCD_PINS_D4) && LCD_PINS_D4 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D4) + REPORT_NAME_DIGITAL(LCD_PINS_D4, __LINE__ ) #endif #if defined(LCD_PINS_D5) && LCD_PINS_D5 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D5) + REPORT_NAME_DIGITAL(LCD_PINS_D5, __LINE__ ) #endif #if defined(LCD_PINS_D6) && LCD_PINS_D6 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D6) + REPORT_NAME_DIGITAL(LCD_PINS_D6, __LINE__ ) #endif #if defined(LCD_PINS_D7) && LCD_PINS_D7 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D7) + REPORT_NAME_DIGITAL(LCD_PINS_D7, __LINE__ ) #endif #if defined(LCD_PINS_ENABLE) && LCD_PINS_ENABLE >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_ENABLE) + REPORT_NAME_DIGITAL(LCD_PINS_ENABLE, __LINE__ ) #endif #if defined(LCD_PINS_RS) && LCD_PINS_RS >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_RS) + REPORT_NAME_DIGITAL(LCD_PINS_RS, __LINE__ ) #endif #if defined(LCD_SDSS) && LCD_SDSS >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_SDSS) -#endif -#if PIN_EXISTS(LED_GREEN) - REPORT_NAME_DIGITAL(__LINE__, LED_GREEN_PIN) + REPORT_NAME_DIGITAL(LCD_SDSS, __LINE__ ) #endif #if PIN_EXISTS(LED) - REPORT_NAME_DIGITAL(__LINE__, LED_PIN) + REPORT_NAME_DIGITAL(LED_PIN, __LINE__ ) #endif -#if PIN_EXISTS(LED_RED) - REPORT_NAME_DIGITAL(__LINE__, LED_RED_PIN) -#endif -#if PIN_EXISTS(MAX) - REPORT_NAME_DIGITAL(__LINE__, MAX_PIN) -#endif -#if PIN_EXISTS(MAX6675_DO) - REPORT_NAME_DIGITAL(__LINE__, MAX6675_DO_PIN) -#endif -#if PIN_EXISTS(MAX6675_SCK) - REPORT_NAME_DIGITAL(__LINE__, MAX6675_SCK_PIN) +#if PIN_EXISTS(MAIN_VOLTAGE_MEASURE) && MAIN_VOLTAGE_MEASURE_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(MAIN_VOLTAGE_MEASURE_PIN, __LINE__ ) #endif #if defined(MAX6675_SS) && MAX6675_SS >= 0 - REPORT_NAME_DIGITAL(__LINE__, MAX6675_SS) + REPORT_NAME_DIGITAL(MAX6675_SS, __LINE__ ) #endif -// #if defined(MISO) && MISO >= 0 -// REPORT_NAME_DIGITAL(__LINE__, MISO) -// #endif #if PIN_EXISTS(MISO) - REPORT_NAME_DIGITAL(__LINE__, MISO_PIN) + REPORT_NAME_DIGITAL(MISO_PIN, __LINE__ ) #endif #if PIN_EXISTS(MOSFET_A) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_A_PIN) + REPORT_NAME_DIGITAL(MOSFET_A_PIN, __LINE__ ) #endif #if PIN_EXISTS(MOSFET_B) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_B_PIN) + REPORT_NAME_DIGITAL(MOSFET_B_PIN, __LINE__ ) #endif #if PIN_EXISTS(MOSFET_C) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_C_PIN) + REPORT_NAME_DIGITAL(MOSFET_C_PIN, __LINE__ ) #endif #if PIN_EXISTS(MOSFET_D) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_D_PIN) + REPORT_NAME_DIGITAL(MOSFET_D_PIN, __LINE__ ) #endif -// #if defined(MOSI) && MOSI >= 0 -// REPORT_NAME_DIGITAL(__LINE__, MOSI) -// #endif #if PIN_EXISTS(MOSI) - REPORT_NAME_DIGITAL(__LINE__, MOSI_PIN) + REPORT_NAME_DIGITAL(MOSI_PIN, __LINE__ ) #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_E_PIN) + REPORT_NAME_DIGITAL(MOTOR_CURRENT_PWM_E_PIN, __LINE__ ) #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_XY_PIN) + REPORT_NAME_DIGITAL(MOTOR_CURRENT_PWM_XY_PIN, __LINE__ ) #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_Z_PIN) -#endif -#if PIN_EXISTS(MOTOR_FAULT) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_FAULT_PIN) + REPORT_NAME_DIGITAL(MOTOR_CURRENT_PWM_Z_PIN, __LINE__ ) #endif #if PIN_EXISTS(ORIG_E0_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E0_AUTO_FAN_PIN) + REPORT_NAME_DIGITAL(ORIG_E0_AUTO_FAN_PIN, __LINE__ ) #endif #if PIN_EXISTS(ORIG_E1_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E1_AUTO_FAN_PIN) + REPORT_NAME_DIGITAL(ORIG_E1_AUTO_FAN_PIN, __LINE__ ) #endif #if PIN_EXISTS(ORIG_E2_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E2_AUTO_FAN_PIN) + REPORT_NAME_DIGITAL(ORIG_E2_AUTO_FAN_PIN, __LINE__ ) #endif #if PIN_EXISTS(ORIG_E3_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E3_AUTO_FAN_PIN) + REPORT_NAME_DIGITAL(ORIG_E3_AUTO_FAN_PIN, __LINE__ ) #endif #if PIN_EXISTS(ORIG_E4_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E4_AUTO_FAN_PIN) + REPORT_NAME_DIGITAL(ORIG_E4_AUTO_FAN_PIN, __LINE__ ) #endif #if PIN_EXISTS(PHOTOGRAPH) - REPORT_NAME_DIGITAL(__LINE__, PHOTOGRAPH_PIN) + REPORT_NAME_DIGITAL(PHOTOGRAPH_PIN, __LINE__ ) #endif #if PIN_EXISTS(PS_ON) - REPORT_NAME_DIGITAL(__LINE__, PS_ON_PIN) + REPORT_NAME_DIGITAL(PS_ON_PIN, __LINE__ ) #endif #if PIN_EXISTS(PWM_1) - REPORT_NAME_DIGITAL(__LINE__, PWM_1_PIN) + REPORT_NAME_DIGITAL(PWM_1_PIN, __LINE__ ) #endif #if PIN_EXISTS(PWM_2) - REPORT_NAME_DIGITAL(__LINE__, PWM_2_PIN) -#endif -#if defined(REF_CLK) && REF_CLK >= 0 - REPORT_NAME_DIGITAL(__LINE__, REF_CLK) + REPORT_NAME_DIGITAL(PWM_2_PIN, __LINE__ ) #endif #if PIN_EXISTS(RAMPS_D10) - REPORT_NAME_DIGITAL(__LINE__, RAMPS_D10_PIN) + REPORT_NAME_DIGITAL(RAMPS_D10_PIN, __LINE__ ) #endif #if PIN_EXISTS(RAMPS_D8) - REPORT_NAME_DIGITAL(__LINE__, RAMPS_D8_PIN) + REPORT_NAME_DIGITAL(RAMPS_D8_PIN, __LINE__ ) #endif #if PIN_EXISTS(RAMPS_D9) - REPORT_NAME_DIGITAL(__LINE__, RAMPS_D9_PIN) + REPORT_NAME_DIGITAL(RAMPS_D9_PIN, __LINE__ ) #endif #if PIN_EXISTS(RGB_LED_R) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_R_PIN) + REPORT_NAME_DIGITAL(RGB_LED_R_PIN, __LINE__ ) #endif #if PIN_EXISTS(RGB_LED_G) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_G_PIN) + REPORT_NAME_DIGITAL(RGB_LED_G_PIN, __LINE__ ) #endif #if PIN_EXISTS(RGB_LED_B) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_B_PIN) + REPORT_NAME_DIGITAL(RGB_LED_B_PIN, __LINE__ ) #endif #if PIN_EXISTS(RGB_LED_W) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_W_PIN) + REPORT_NAME_DIGITAL(RGB_LED_W_PIN, __LINE__ ) #endif #if PIN_EXISTS(RX_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, RX_ENABLE_PIN) + REPORT_NAME_DIGITAL(RX_ENABLE_PIN, __LINE__ ) #endif #if PIN_EXISTS(SAFETY_TRIGGERED) - REPORT_NAME_DIGITAL(__LINE__, SAFETY_TRIGGERED_PIN) + REPORT_NAME_DIGITAL(SAFETY_TRIGGERED_PIN, __LINE__ ) #endif -// #if defined(SCK) && SCK >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SCK) -// #endif #if PIN_EXISTS(SCK) - REPORT_NAME_DIGITAL(__LINE__, SCK_PIN) + REPORT_NAME_DIGITAL(SCK_PIN, __LINE__ ) +#endif +#if defined(SCL) && SCL >= 0 + REPORT_NAME_DIGITAL(SCL, __LINE__ ) #endif -// #if defined(SCL) && SCL >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SCL) -// #endif #if PIN_EXISTS(SD_DETECT) - REPORT_NAME_DIGITAL(__LINE__, SD_DETECT_PIN) + REPORT_NAME_DIGITAL(SD_DETECT_PIN, __LINE__ ) +#endif +#if defined(SDA) && SDA >= 0 + REPORT_NAME_DIGITAL(SDA, __LINE__ ) #endif -// #if defined(SDA) && SDA >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SDA) -// #endif #if defined(SDPOWER) && SDPOWER >= 0 - REPORT_NAME_DIGITAL(__LINE__, SDPOWER) + REPORT_NAME_DIGITAL(SDPOWER, __LINE__ ) #endif #if defined(SDSS) && SDSS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SDSS) -#endif -#if defined(SERVO0) && SERVO0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, SERVO0) + REPORT_NAME_DIGITAL(SDSS, __LINE__ ) #endif #if PIN_EXISTS(SERVO0) - REPORT_NAME_DIGITAL(__LINE__, SERVO0_PIN) + REPORT_NAME_DIGITAL(SERVO0_PIN, __LINE__ ) #endif #if PIN_EXISTS(SERVO1) - REPORT_NAME_DIGITAL(__LINE__, SERVO1_PIN) + REPORT_NAME_DIGITAL(SERVO1_PIN, __LINE__ ) #endif #if PIN_EXISTS(SERVO2) - REPORT_NAME_DIGITAL(__LINE__, SERVO2_PIN) + REPORT_NAME_DIGITAL(SERVO2_PIN, __LINE__ ) #endif #if PIN_EXISTS(SERVO3) - REPORT_NAME_DIGITAL(__LINE__, SERVO3_PIN) + REPORT_NAME_DIGITAL(SERVO3_PIN, __LINE__ ) #endif #if defined(SHIFT_CLK) && SHIFT_CLK >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_CLK) + REPORT_NAME_DIGITAL(SHIFT_CLK, __LINE__ ) #endif #if defined(SHIFT_EN) && SHIFT_EN >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_EN) + REPORT_NAME_DIGITAL(SHIFT_EN, __LINE__ ) #endif #if defined(SHIFT_LD) && SHIFT_LD >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_LD) + REPORT_NAME_DIGITAL(SHIFT_LD, __LINE__ ) #endif #if defined(SHIFT_OUT) && SHIFT_OUT >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_OUT) + REPORT_NAME_DIGITAL(SHIFT_OUT, __LINE__ ) #endif #if PIN_EXISTS(SLED) - REPORT_NAME_DIGITAL(__LINE__, SLED_PIN) + REPORT_NAME_DIGITAL(SLED_PIN, __LINE__ ) #endif #if PIN_EXISTS(SLEEP_WAKE) - REPORT_NAME_DIGITAL(__LINE__, SLEEP_WAKE_PIN) + REPORT_NAME_DIGITAL(SLEEP_WAKE_PIN, __LINE__ ) #endif #if PIN_EXISTS(SOL0) - REPORT_NAME_DIGITAL(__LINE__, SOL0_PIN) + REPORT_NAME_DIGITAL(SOL0_PIN, __LINE__ ) #endif #if PIN_EXISTS(SOL1) - REPORT_NAME_DIGITAL(__LINE__, SOL1_PIN) + REPORT_NAME_DIGITAL(SOL1_PIN, __LINE__ ) #endif #if PIN_EXISTS(SOL2) - REPORT_NAME_DIGITAL(__LINE__, SOL2_PIN) + REPORT_NAME_DIGITAL(SOL2_PIN, __LINE__ ) #endif #if PIN_EXISTS(SOL3) - REPORT_NAME_DIGITAL(__LINE__, SOL3_PIN) + REPORT_NAME_DIGITAL(SOL3_PIN, __LINE__ ) #endif #if PIN_EXISTS(SOL4) - REPORT_NAME_DIGITAL(__LINE__, SOL4_PIN) + REPORT_NAME_DIGITAL(SOL4_PIN, __LINE__ ) #endif #if defined(SPARE_IO) && SPARE_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPARE_IO) -#endif -#if defined(SPI_CHAN_DAC) && SPI_CHAN_DAC >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_CHAN_DAC) -#endif -#if defined(SPI_CHAN_EEPROM1) && SPI_CHAN_EEPROM1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_CHAN_EEPROM1) -#endif -#if defined(SPI_EEPROM) && SPI_EEPROM >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_EEPROM) -#endif -#if defined(SPI_EEPROM1_CS) && SPI_EEPROM1_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_EEPROM1_CS) -#endif -#if defined(SPI_EEPROM2_CS) && SPI_EEPROM2_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_EEPROM2_CS) -#endif -#if defined(SPI_FLASH_CS) && SPI_FLASH_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_FLASH_CS) + REPORT_NAME_DIGITAL(SPARE_IO, __LINE__ ) #endif #if PIN_EXISTS(SPINDLE_DIR) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_DIR_PIN) -#endif -#if PIN_EXISTS(SPINDLE_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_ENABLE_PIN) + REPORT_NAME_DIGITAL(SPINDLE_DIR_PIN, __LINE__ ) #endif #if PIN_EXISTS(SPINDLE_LASER_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_LASER_ENABLE_PIN) + REPORT_NAME_DIGITAL(SPINDLE_LASER_ENABLE_PIN, __LINE__ ) #endif #if PIN_EXISTS(SPINDLE_LASER_PWM) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_LASER_PWM_PIN) + REPORT_NAME_DIGITAL(SPINDLE_LASER_PWM_PIN, __LINE__ ) #endif #if PIN_EXISTS(SR_CLK) - REPORT_NAME_DIGITAL(__LINE__, SR_CLK_PIN) + REPORT_NAME_DIGITAL(SR_CLK_PIN, __LINE__ ) #endif #if PIN_EXISTS(SR_DATA) - REPORT_NAME_DIGITAL(__LINE__, SR_DATA_PIN) + REPORT_NAME_DIGITAL(SR_DATA_PIN, __LINE__ ) #endif #if PIN_EXISTS(SR_STROBE) - REPORT_NAME_DIGITAL(__LINE__, SR_STROBE_PIN) + REPORT_NAME_DIGITAL(SR_STROBE_PIN, __LINE__ ) #endif #if PIN_EXISTS(SS) - REPORT_NAME_DIGITAL(__LINE__, SS_PIN) + REPORT_NAME_DIGITAL(SS_PIN, __LINE__ ) #endif #if PIN_EXISTS(STAT_LED_BLUE) - REPORT_NAME_DIGITAL(__LINE__, STAT_LED_BLUE_PIN) -#endif -#if defined(STAT_LED_RED_LED) && STAT_LED_RED_LED >= 0 - REPORT_NAME_DIGITAL(__LINE__, STAT_LED_RED_LED) + REPORT_NAME_DIGITAL(STAT_LED_BLUE_PIN, __LINE__ ) #endif #if PIN_EXISTS(STAT_LED_RED) - REPORT_NAME_DIGITAL(__LINE__, STAT_LED_RED_PIN) + REPORT_NAME_DIGITAL(STAT_LED_RED_PIN, __LINE__ ) #endif #if PIN_EXISTS(STEPPER_RESET) - REPORT_NAME_DIGITAL(__LINE__, STEPPER_RESET_PIN) + REPORT_NAME_DIGITAL(STEPPER_RESET_PIN, __LINE__ ) #endif #if PIN_EXISTS(SUICIDE) - REPORT_NAME_DIGITAL(__LINE__, SUICIDE_PIN) + REPORT_NAME_DIGITAL(SUICIDE_PIN, __LINE__ ) #endif -#if defined(THERMO_CS1) && THERMO_CS1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, THERMO_CS1) +#if defined(TC1) && TC1 >= 0 && TC1 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TC1, __LINE__ ) #endif -#if defined(THERMO_CS2) && THERMO_CS2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, THERMO_CS2) +#if defined(TC2) && TC2 >= 0 && TC2 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TC2, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_0) && TEMP_0_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_0_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_1) && TEMP_1_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_1_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_2) && TEMP_2_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_2_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_3) && TEMP_3_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_3_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_4) && TEMP_4_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_4_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_BED) && TEMP_BED_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_BED_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_CHAMBER) && TEMP_CHAMBER_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_CHAMBER_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_X) && TEMP_X_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_X_PIN, __LINE__ ) #endif #if PIN_EXISTS(THERMO_DO) - REPORT_NAME_DIGITAL(__LINE__, THERMO_DO_PIN) + REPORT_NAME_DIGITAL(THERMO_DO_PIN, __LINE__ ) #endif #if PIN_EXISTS(THERMO_SCK) - REPORT_NAME_DIGITAL(__LINE__, THERMO_SCK_PIN) + REPORT_NAME_DIGITAL(THERMO_SCK_PIN, __LINE__ ) #endif #if PIN_EXISTS(TLC_BLANK) - REPORT_NAME_DIGITAL(__LINE__, TLC_BLANK_PIN) + REPORT_NAME_DIGITAL(TLC_BLANK_PIN, __LINE__ ) #endif #if PIN_EXISTS(TLC_CLOCK) - REPORT_NAME_DIGITAL(__LINE__, TLC_CLOCK_PIN) + REPORT_NAME_DIGITAL(TLC_CLOCK_PIN, __LINE__ ) #endif #if PIN_EXISTS(TLC_DATA) - REPORT_NAME_DIGITAL(__LINE__, TLC_DATA_PIN) + REPORT_NAME_DIGITAL(TLC_DATA_PIN, __LINE__ ) #endif #if PIN_EXISTS(TLC_XLAT) - REPORT_NAME_DIGITAL(__LINE__, TLC_XLAT_PIN) + REPORT_NAME_DIGITAL(TLC_XLAT_PIN, __LINE__ ) #endif #if PIN_EXISTS(TOOL_0) - REPORT_NAME_DIGITAL(__LINE__, TOOL_0_PIN) + REPORT_NAME_DIGITAL(TOOL_0_PIN, __LINE__ ) #endif #if PIN_EXISTS(TOOL_0_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_0_PWM_PIN) + REPORT_NAME_DIGITAL(TOOL_0_PWM_PIN, __LINE__ ) #endif #if PIN_EXISTS(TOOL_1) - REPORT_NAME_DIGITAL(__LINE__, TOOL_1_PIN) + REPORT_NAME_DIGITAL(TOOL_1_PIN, __LINE__ ) #endif #if PIN_EXISTS(TOOL_1_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_1_PWM_PIN) + REPORT_NAME_DIGITAL(TOOL_1_PWM_PIN, __LINE__ ) #endif #if PIN_EXISTS(TOOL_2) - REPORT_NAME_DIGITAL(__LINE__, TOOL_2_PIN) + REPORT_NAME_DIGITAL(TOOL_2_PIN, __LINE__ ) #endif #if PIN_EXISTS(TOOL_2_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_2_PWM_PIN) + REPORT_NAME_DIGITAL(TOOL_2_PWM_PIN, __LINE__ ) #endif #if PIN_EXISTS(TOOL_3) - REPORT_NAME_DIGITAL(__LINE__, TOOL_3_PIN) + REPORT_NAME_DIGITAL(TOOL_3_PIN, __LINE__ ) #endif #if PIN_EXISTS(TOOL_3_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_3_PWM_PIN) + REPORT_NAME_DIGITAL(TOOL_3_PWM_PIN, __LINE__ ) #endif #if PIN_EXISTS(TOOL_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_PWM_PIN) + REPORT_NAME_DIGITAL(TOOL_PWM_PIN, __LINE__ ) #endif #if PIN_EXISTS(TX_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, TX_ENABLE_PIN) + REPORT_NAME_DIGITAL(TX_ENABLE_PIN, __LINE__ ) #endif #if defined(UI1) && UI1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, UI1) + REPORT_NAME_DIGITAL(UI1, __LINE__ ) #endif #if defined(UI2) && UI2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, UI2) + REPORT_NAME_DIGITAL(UI2, __LINE__ ) #endif #if defined(UNUSED_PWM) && UNUSED_PWM >= 0 - REPORT_NAME_DIGITAL(__LINE__, UNUSED_PWM) + REPORT_NAME_DIGITAL(UNUSED_PWM, __LINE__ ) #endif #if PIN_EXISTS(X_ATT) - REPORT_NAME_DIGITAL(__LINE__, X_ATT_PIN) + REPORT_NAME_DIGITAL(X_ATT_PIN, __LINE__ ) #endif #if PIN_EXISTS(X_CS) - REPORT_NAME_DIGITAL(__LINE__, X_CS_PIN) + REPORT_NAME_DIGITAL(X_CS_PIN, __LINE__ ) #endif #if PIN_EXISTS(X_DIR) - REPORT_NAME_DIGITAL(__LINE__, X_DIR_PIN) + REPORT_NAME_DIGITAL(X_DIR_PIN, __LINE__ ) #endif #if PIN_EXISTS(X_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, X_ENABLE_PIN) + REPORT_NAME_DIGITAL(X_ENABLE_PIN, __LINE__ ) #endif #if PIN_EXISTS(X_MAX) - REPORT_NAME_DIGITAL(__LINE__, X_MAX_PIN) + REPORT_NAME_DIGITAL(X_MAX_PIN, __LINE__ ) #endif #if PIN_EXISTS(X_MIN) - REPORT_NAME_DIGITAL(__LINE__, X_MIN_PIN) + REPORT_NAME_DIGITAL(X_MIN_PIN, __LINE__ ) #endif #if PIN_EXISTS(X_MS1) - REPORT_NAME_DIGITAL(__LINE__, X_MS1_PIN) + REPORT_NAME_DIGITAL(X_MS1_PIN, __LINE__ ) #endif #if PIN_EXISTS(X_MS2) - REPORT_NAME_DIGITAL(__LINE__, X_MS2_PIN) + REPORT_NAME_DIGITAL(X_MS2_PIN, __LINE__ ) #endif #if PIN_EXISTS(X_STEP) - REPORT_NAME_DIGITAL(__LINE__, X_STEP_PIN) + REPORT_NAME_DIGITAL(X_STEP_PIN, __LINE__ ) #endif #if PIN_EXISTS(X_STOP) - REPORT_NAME_DIGITAL(__LINE__, X_STOP_PIN) + REPORT_NAME_DIGITAL(X_STOP_PIN, __LINE__ ) #endif #if PIN_EXISTS(X2_DIR) - REPORT_NAME_DIGITAL(__LINE__, X2_DIR_PIN) + REPORT_NAME_DIGITAL(X2_DIR_PIN, __LINE__ ) #endif #if PIN_EXISTS(X2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, X2_ENABLE_PIN) + REPORT_NAME_DIGITAL(X2_ENABLE_PIN, __LINE__ ) #endif #if PIN_EXISTS(X2_STEP) - REPORT_NAME_DIGITAL(__LINE__, X2_STEP_PIN) + REPORT_NAME_DIGITAL(X2_STEP_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y_ATT) - REPORT_NAME_DIGITAL(__LINE__, Y_ATT_PIN) + REPORT_NAME_DIGITAL(Y_ATT_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y_CS) - REPORT_NAME_DIGITAL(__LINE__, Y_CS_PIN) + REPORT_NAME_DIGITAL(Y_CS_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y_DIR) - REPORT_NAME_DIGITAL(__LINE__, Y_DIR_PIN) + REPORT_NAME_DIGITAL(Y_DIR_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Y_ENABLE_PIN) + REPORT_NAME_DIGITAL(Y_ENABLE_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y_MAX) - REPORT_NAME_DIGITAL(__LINE__, Y_MAX_PIN) + REPORT_NAME_DIGITAL(Y_MAX_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y_MIN) - REPORT_NAME_DIGITAL(__LINE__, Y_MIN_PIN) + REPORT_NAME_DIGITAL(Y_MIN_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y_MS1) - REPORT_NAME_DIGITAL(__LINE__, Y_MS1_PIN) + REPORT_NAME_DIGITAL(Y_MS1_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y_MS2) - REPORT_NAME_DIGITAL(__LINE__, Y_MS2_PIN) + REPORT_NAME_DIGITAL(Y_MS2_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y_STEP) - REPORT_NAME_DIGITAL(__LINE__, Y_STEP_PIN) + REPORT_NAME_DIGITAL(Y_STEP_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y_STOP) - REPORT_NAME_DIGITAL(__LINE__, Y_STOP_PIN) + REPORT_NAME_DIGITAL(Y_STOP_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y2_DIR) - REPORT_NAME_DIGITAL(__LINE__, Y2_DIR_PIN) + REPORT_NAME_DIGITAL(Y2_DIR_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Y2_ENABLE_PIN) + REPORT_NAME_DIGITAL(Y2_ENABLE_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y2_STEP) - REPORT_NAME_DIGITAL(__LINE__, Y2_STEP_PIN) + REPORT_NAME_DIGITAL(Y2_STEP_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z_ATT) - REPORT_NAME_DIGITAL(__LINE__, Z_ATT_PIN) + REPORT_NAME_DIGITAL(Z_ATT_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z_CS) - REPORT_NAME_DIGITAL(__LINE__, Z_CS_PIN) + REPORT_NAME_DIGITAL(Z_CS_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z_DIR) - REPORT_NAME_DIGITAL(__LINE__, Z_DIR_PIN) + REPORT_NAME_DIGITAL(Z_DIR_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Z_ENABLE_PIN) + REPORT_NAME_DIGITAL(Z_ENABLE_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z_MAX) - REPORT_NAME_DIGITAL(__LINE__, Z_MAX_PIN) + REPORT_NAME_DIGITAL(Z_MAX_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z_MIN) - REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PIN) + REPORT_NAME_DIGITAL(Z_MIN_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z_MIN_PROBE) - REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PROBE_PIN) + REPORT_NAME_DIGITAL(Z_MIN_PROBE_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z_MS1) - REPORT_NAME_DIGITAL(__LINE__, Z_MS1_PIN) + REPORT_NAME_DIGITAL(Z_MS1_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z_MS2) - REPORT_NAME_DIGITAL(__LINE__, Z_MS2_PIN) -#endif -#if PIN_EXISTS(Z_PROBE) - REPORT_NAME_DIGITAL(__LINE__, Z_PROBE_PIN) + REPORT_NAME_DIGITAL(Z_MS2_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z_STEP) - REPORT_NAME_DIGITAL(__LINE__, Z_STEP_PIN) + REPORT_NAME_DIGITAL(Z_STEP_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z_STOP) - REPORT_NAME_DIGITAL(__LINE__, Z_STOP_PIN) -#endif -#if PIN_EXISTS(Z2_CS) - REPORT_NAME_DIGITAL(__LINE__, Z2_CS_PIN) + REPORT_NAME_DIGITAL(Z_STOP_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z2_DIR) - REPORT_NAME_DIGITAL(__LINE__, Z2_DIR_PIN) + REPORT_NAME_DIGITAL(Z2_DIR_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Z2_ENABLE_PIN) -#endif -#if PIN_EXISTS(Z2_MS1) - REPORT_NAME_DIGITAL(__LINE__, Z2_MS1_PIN) -#endif -#if PIN_EXISTS(Z2_MS2) - REPORT_NAME_DIGITAL(__LINE__, Z2_MS2_PIN) -#endif -#if PIN_EXISTS(Z2_MS3) - REPORT_NAME_DIGITAL(__LINE__, Z2_MS3_PIN) + REPORT_NAME_DIGITAL(Z2_ENABLE_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z2_STEP) - REPORT_NAME_DIGITAL(__LINE__, Z2_STEP_PIN) -#endif -#if PIN_EXISTS(ZRIB_V20_D6) - REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D6_PIN) -#endif -#if PIN_EXISTS(ZRIB_V20_D9) - REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D9_PIN) + REPORT_NAME_DIGITAL(Z2_STEP_PIN, __LINE__ ) #endif #if PIN_EXISTS(X_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, X_SERIAL_TX_PIN) + REPORT_NAME_DIGITAL(X_SERIAL_TX_PIN, __LINE__ ) #endif #if PIN_EXISTS(X_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, X_SERIAL_RX_PIN) + REPORT_NAME_DIGITAL(X_SERIAL_RX_PIN, __LINE__ ) #endif #if PIN_EXISTS(X2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, X2_SERIAL_TX_PIN) + REPORT_NAME_DIGITAL(X2_SERIAL_TX_PIN, __LINE__ ) #endif #if PIN_EXISTS(X2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, X2_SERIAL_RX_PIN) + REPORT_NAME_DIGITAL(X2_SERIAL_RX_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Y_SERIAL_TX_PIN) + REPORT_NAME_DIGITAL(Y_SERIAL_TX_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Y_SERIAL_RX_PIN) + REPORT_NAME_DIGITAL(Y_SERIAL_RX_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Y2_SERIAL_TX_PIN) + REPORT_NAME_DIGITAL(Y2_SERIAL_TX_PIN, __LINE__ ) #endif #if PIN_EXISTS(Y2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Y2_SERIAL_RX_PIN) + REPORT_NAME_DIGITAL(Y2_SERIAL_RX_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Z_SERIAL_TX_PIN) + REPORT_NAME_DIGITAL(Z_SERIAL_TX_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Z_SERIAL_RX_PIN) + REPORT_NAME_DIGITAL(Z_SERIAL_RX_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Z2_SERIAL_TX_PIN) + REPORT_NAME_DIGITAL(Z2_SERIAL_TX_PIN, __LINE__ ) #endif #if PIN_EXISTS(Z2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Z2_SERIAL_RX_PIN) + REPORT_NAME_DIGITAL(Z2_SERIAL_RX_PIN, __LINE__ ) #endif #if PIN_EXISTS(E0_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_TX_PIN) + REPORT_NAME_DIGITAL(E0_SERIAL_TX_PIN, __LINE__ ) #endif #if PIN_EXISTS(E0_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_RX_PIN) + REPORT_NAME_DIGITAL(E0_SERIAL_RX_PIN, __LINE__ ) #endif #if PIN_EXISTS(E1_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_TX_PIN) + REPORT_NAME_DIGITAL(E1_SERIAL_TX_PIN, __LINE__ ) #endif #if PIN_EXISTS(E1_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_RX_PIN) + REPORT_NAME_DIGITAL(E1_SERIAL_RX_PIN, __LINE__ ) #endif #if PIN_EXISTS(E2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_TX_PIN) + REPORT_NAME_DIGITAL(E2_SERIAL_TX_PIN, __LINE__ ) #endif #if PIN_EXISTS(E2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_RX_PIN) + REPORT_NAME_DIGITAL(E2_SERIAL_RX_PIN, __LINE__ ) #endif #if PIN_EXISTS(E3_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_TX_PIN) + REPORT_NAME_DIGITAL(E3_SERIAL_TX_PIN, __LINE__ ) #endif #if PIN_EXISTS(E3_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_RX_PIN) + REPORT_NAME_DIGITAL(E3_SERIAL_RX_PIN, __LINE__ ) #endif #if PIN_EXISTS(E4_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_TX_PIN) + REPORT_NAME_DIGITAL(E4_SERIAL_TX_PIN, __LINE__ ) #endif #if PIN_EXISTS(E4_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_RX_PIN) + REPORT_NAME_DIGITAL(E4_SERIAL_RX_PIN, __LINE__ ) #endif diff --git a/Marlin/pins_3DRAG.h b/Marlin/pins_3DRAG.h index 61cdb56..feadea4 100644 --- a/Marlin/pins_3DRAG.h +++ b/Marlin/pins_3DRAG.h @@ -153,11 +153,11 @@ #define Z_DIR_PIN 28 #define Z_ENABLE_PIN 24 #define Z_STEP_PIN 26 - #define SPINDLE_LASER_PWM_PIN 46 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 62 // Pin should have a pullup! + #define SPINDLE_LASER_PWM_PIN 46 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENABLE_PIN 62 // Pin should have a pullup! #define SPINDLE_DIR_PIN 48 #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // use expansion header if no LCD in use - #define SPINDLE_LASER_ENABLE_PIN 16 // Pin should have a pullup/pulldown! + #define SPINDLE_LASER_ENABLE_PIN 16 // Pin should have a pullup/pulldown! #define SPINDLE_DIR_PIN 17 #endif #endif diff --git a/Marlin/pins_5DPRINT.h b/Marlin/pins_5DPRINT.h index 415cc23..f5e0f4d 100644 --- a/Marlin/pins_5DPRINT.h +++ b/Marlin/pins_5DPRINT.h @@ -74,14 +74,6 @@ #define DEFAULT_MACHINE_NAME "Makibox" #define BOARD_NAME "5DPrint D8" -// -// Servos -// -#define SERVO0_PIN 41 -#define SERVO1_PIN 42 -#define SERVO2_PIN 43 -#define SERVO3_PIN 44 - // // Limit Switches // @@ -108,9 +100,7 @@ #define E0_DIR_PIN 35 // A7 #define E0_ENABLE_PIN 11 // C1 -// -// Digital Microstepping -// + #define X_MS1_PIN 25 // B5 #define X_MS2_PIN 26 // B6 #define Y_MS1_PIN 9 // E1 @@ -132,14 +122,9 @@ #define HEATER_0_PIN 15 // C5 #define HEATER_BED_PIN 14 // C4 -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif +#define FAN_PIN 16 // C6 PWM3A // // Misc. Functions // #define SDSS 20 // B0 - -//DIGIPOTS slave addresses -#define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for DIGIPOT 0x2C (0x58 <- 0x2C << 1) diff --git a/Marlin/pins_ANET_10.h b/Marlin/pins_ANET_10.h index a8cbd5f..fcac4c0 100644 --- a/Marlin/pins_ANET_10.h +++ b/Marlin/pins_ANET_10.h @@ -86,10 +86,10 @@ * Anet Users / Skynet SW on Facebook - https://www.facebook.com/skynet3ddevelopment/ * * Many thanks to Hans Raaf (@oderwat) for developing the Anet-specific software and supporting the Anet community. - */ +*/ #ifndef __AVR_ATmega1284P__ - #error "Oops! Make sure you have 'Anet V1.0', 'Anet V1.0 (Optiboot)' or 'Sanguino' selected in the 'Tools -> Boards' menu and ATmega1284P selected in 'Tools -> Processor' menu." + #error "Oops! Make sure you have 'Anet V1.0', 'Anet V1.0 (Optiboot)' or 'Sanguino' selected from the 'Tools -> Boards' menu." #endif #ifndef BOARD_NAME @@ -125,18 +125,15 @@ // // Temperature Sensors // -#define TEMP_0_PIN 7 // Analog Input (pin 33 extruder) -#define TEMP_BED_PIN 6 // Analog Input (pin 34 bed) +#define TEMP_0_PIN 7 // Analog Input (pin 33 extruder) +#define TEMP_BED_PIN 6 // Analog Input (pin 34 bed) // // Heaters / Fans // -#define HEATER_0_PIN 13 // (extruder) -#define HEATER_BED_PIN 12 // (bed) - -#ifndef FAN_PIN - #define FAN_PIN 4 -#endif +#define HEATER_0_PIN 13 // (extruder) +#define HEATER_BED_PIN 12 // (bed) +#define FAN_PIN 4 // // Misc. Functions @@ -153,10 +150,10 @@ * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER */ -#if ENABLED(ULTRA_LCD) +#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) #define LCD_SDSS 28 #if ENABLED(ADC_KEYPAD) - #define SERVO0_PIN 27 // free for BLTouch/3D-Touch + #define SERVO0_PIN 27 // free for BLTouch/3D-Touch #define LCD_PINS_RS 28 #define LCD_PINS_ENABLE 29 #define LCD_PINS_D4 10 @@ -171,7 +168,7 @@ // Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics // display using an adapter board // https://go.aisler.net/benlye/anet-lcd-adapter/pcb // See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748 - #define SERVO0_PIN 29 // free for BLTouch/3D-Touch + #define SERVO0_PIN 29 // free for BLTouch/3D-Touch #define BEEPER_PIN 17 #define LCD_PINS_RS 27 #define LCD_PINS_ENABLE 28 @@ -179,21 +176,15 @@ #define BTN_EN1 11 #define BTN_EN2 10 #define BTN_ENC 16 - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(0) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(63) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) - #endif + #define ST7920_DELAY_1 DELAY_0_NOP + #define ST7920_DELAY_2 DELAY_1_NOP + #define ST7920_DELAY_3 DELAY_2_NOP #define STD_ENCODER_PULSES_PER_STEP 4 #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 #endif #else #define SERVO0_PIN 27 -#endif +#endif // ULTRA_LCD && NEWPANEL /** * ==================================================================== @@ -204,7 +195,7 @@ * published by oderwat on Thingiverse at https://www.thingiverse.com/thing:2103748. * * Using that adapter requires changing the pin definition as follows: - * #define SERVO0_PIN 27 // free for BLTouch/3D-Touch + * #define SERVO0_PIN 27 // free for BLTouch/3D-Touch * #define BEEPER_PIN 28 * #define LCD_PINS_RS 30 * #define LCD_PINS_ENABLE 29 diff --git a/Marlin/pins_AZTEEG_X3.h b/Marlin/pins_AZTEEG_X3.h index 0abc9b8..86ccbd9 100644 --- a/Marlin/pins_AZTEEG_X3.h +++ b/Marlin/pins_AZTEEG_X3.h @@ -32,8 +32,8 @@ #error "Azteeg X3 supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) - #define CASE_LIGHT_PIN 6 // Define before RAMPS pins include +#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) + #define CASE_LIGHT_PIN 6 // must define it here or else RAMPS will define it #endif #define BOARD_NAME "Azteeg X3" @@ -44,8 +44,8 @@ // #undef SERVO0_PIN #undef SERVO1_PIN -#define SERVO0_PIN 44 // SERVO1 port -#define SERVO1_PIN 55 // SERVO2 port +#define SERVO0_PIN 44 // SERVO1 port +#define SERVO1_PIN 55 // SERVO2 port // // LCD / Controller @@ -91,9 +91,9 @@ #undef SCL #if SERVO0_PIN == 7 #undef SERVO0_PIN - #define SERVO0_PIN 11 + #def SERVO0_PIN 11 #endif - #define SPINDLE_LASER_PWM_PIN 7 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 20 // Pin should have a pullup! + #define SPINDLE_LASER_PWM_PIN 7 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENABLE_PIN 20 // Pin should have a pullup! #define SPINDLE_DIR_PIN 21 #endif diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index fa17120..0e76a2a 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -24,32 +24,22 @@ * AZTEEG_X3_PRO (Arduino Mega) pin assignments */ -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." -#endif - #if HOTENDS > 5 || E_STEPPERS > 5 #error "Azteeg X3 Pro supports up to 5 hotends / E-steppers. Comment out this line to continue." #endif +#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) + #define CASE_LIGHT_PIN 44 // must define it here or else RAMPS will define it +#endif + + #define BOARD_NAME "Azteeg X3 Pro" -// -// RAMPS pins overrides -// -#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) - #define CASE_LIGHT_PIN 44 -#endif - -#ifndef FAN_PIN - #define FAN_PIN 6 -#endif - #include "pins_RAMPS.h" -// DIGIPOT slave addresses -#define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT 0x2C (0x58 <- 0x2C << 1) -#define DIGIPOT_I2C_ADDRESS_B 0x2E // unshifted slave address for second DIGIPOT 0x2E (0x5C <- 0x2E << 1) +#ifndef __AVR_ATmega2560__ + #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." +#endif // // Servos @@ -123,8 +113,11 @@ #define HEATER_6_PIN 6 #define HEATER_7_PIN 11 +#undef FAN_PIN +#define FAN_PIN 6 // Part Cooling System + #ifndef CONTROLLER_FAN_PIN - #define CONTROLLER_FAN_PIN 4 // Pin used for the fan to cool motherboard (-1 to disable) + #define CONTROLLER_FAN_PIN 4 // Pin used for the fan to cool motherboard (-1 to disable) #endif // Fans/Water Pump to cool the hotend cool side. @@ -145,7 +138,7 @@ #undef BEEPER_PIN #define BEEPER_PIN 12 // 33 isn't physically available to the LCD display #else - #define STAT_LED_RED_PIN 32 + #define STAT_LED_RED_PIN 32 #define STAT_LED_BLUE_PIN 35 #endif @@ -153,9 +146,9 @@ // Misc. Functions // #if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN - #undef DOGLCD_A0 // Steal pin 44 for the case light; if you have a Viki2 and have connected it - #define DOGLCD_A0 57 // following the Panucatt wiring diagram, you may need to tweak these pin assignments - // as the wiring diagram uses pin 44 for DOGLCD_A0 + #undef DOGLCD_A0 // Steal pin 44 for the case light; if you have a Viki2 and have connected it + #define DOGLCD_A0 57 // following the Panucatt wiring diagram, you may need to tweak these pin assignments + // as the wiring diagram uses pin 44 for DOGLCD_A0 #endif // @@ -165,13 +158,13 @@ #undef SPINDLE_LASER_ENABLE_PIN #undef SPINDLE_DIR_PIN -#if ENABLED(SPINDLE_LASER_ENABLE) // EXP2 header +#if ENABLED(SPINDLE_LASER_ENABLE) // use EXP2 header #if ENABLED(VIKI2) || ENABLED(miniVIKI) #undef BTN_EN2 - #define BTN_EN2 31 // need 7 for the spindle speed PWM + #define BTN_EN2 31 // need 7 for the spindle speed PWM #endif - #define SPINDLE_LASER_PWM_PIN 7 // must have a hardware PWM - #define SPINDLE_LASER_ENABLE_PIN 20 // Pin should have a pullup! + #define SPINDLE_LASER_PWM_PIN 7 // must have a hardware PWM + #define SPINDLE_LASER_ENABLE_PIN 20 // Pin should have a pullup! #define SPINDLE_DIR_PIN 21 #endif diff --git a/Marlin/pins_BAM_DICE_DUE.h b/Marlin/pins_BAM_DICE_DUE.h index d763392..2b34cdd 100644 --- a/Marlin/pins_BAM_DICE_DUE.h +++ b/Marlin/pins_BAM_DICE_DUE.h @@ -33,9 +33,9 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENABLE_PIN 66 // Pin should have a pullup/pulldown! +#define SPINDLE_LASER_ENABLE_PIN 66 // Pin should have a pullup/pulldown! #define SPINDLE_DIR_PIN 67 -#define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM #include "pins_RAMPS.h" diff --git a/Marlin/pins_BQ_ZUM_MEGA_3D.h b/Marlin/pins_BQ_ZUM_MEGA_3D.h index f80379e..f20f9b5 100644 --- a/Marlin/pins_BQ_ZUM_MEGA_3D.h +++ b/Marlin/pins_BQ_ZUM_MEGA_3D.h @@ -49,13 +49,13 @@ // // Misc. Functions // -#define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM +#define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup/pulldown! +#define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM #define SPINDLE_DIR_PIN 42 #include "pins_RAMPS_13.h" @@ -64,16 +64,16 @@ // Limit Switches // #undef X_MAX_PIN -#define X_MAX_PIN 79 // 2 +#define X_MAX_PIN 79 // 2 // // Z Probe (when not Z_MIN_PIN) // #undef Z_MIN_PROBE_PIN -#define Z_MIN_PROBE_PIN 19 // IND_S_5V +#define Z_MIN_PROBE_PIN 19 // IND_S_5V #undef Z_ENABLE_PIN -#define Z_ENABLE_PIN 77 // 62 +#define Z_ENABLE_PIN 77 // 62 // // Steppers @@ -93,8 +93,8 @@ // // Misc. Functions // -#undef PS_ON_PIN // 12 -#define PS_ON_PIN 81 // External Power Supply +#undef PS_ON_PIN // 12 +#define PS_ON_PIN 81 // External Power Supply // This board has headers for Z-min, Z-max and IND_S_5V *but* as the bq team @@ -104,8 +104,8 @@ #ifdef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN #undef Z_MIN_PIN #undef Z_MAX_PIN - #define Z_MIN_PIN 19 // IND_S_5V - #define Z_MAX_PIN 18 // Z-MIN Label + #define Z_MIN_PIN 19 // IND_S_5V + #define Z_MAX_PIN 18 // Z-MIN Label #endif diff --git a/Marlin/pins_BRAINWAVE.h b/Marlin/pins_BRAINWAVE.h index a43c6be..9326197 100644 --- a/Marlin/pins_BRAINWAVE.h +++ b/Marlin/pins_BRAINWAVE.h @@ -115,9 +115,7 @@ #define HEATER_0_PIN 32 // A4 Extruder #define HEATER_BED_PIN 18 // E6 Bed -#ifndef FAN_PIN - #define FAN_PIN 31 // A3 Fan -#endif +#define FAN_PIN 31 // A3 Fan // // Misc. Functions diff --git a/Marlin/pins_BRAINWAVE_PRO.h b/Marlin/pins_BRAINWAVE_PRO.h index 49c8ab6..872d868 100644 --- a/Marlin/pins_BRAINWAVE_PRO.h +++ b/Marlin/pins_BRAINWAVE_PRO.h @@ -125,9 +125,7 @@ // #define HEATER_0_PIN 27 // B7 #define HEATER_BED_PIN 26 // B6 Bed -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 Fan, PWM3A -#endif +#define FAN_PIN 16 // C6 Fan, PWM3A // // Misc. Functions diff --git a/Marlin/pins_CHEAPTRONIC.h b/Marlin/pins_CHEAPTRONIC.h index e8f2c5f..6d1e45d 100644 --- a/Marlin/pins_CHEAPTRONIC.h +++ b/Marlin/pins_CHEAPTRONIC.h @@ -69,8 +69,8 @@ // // Heaters / Fans // -#define HEATER_0_PIN 19 // EXTRUDER 1 -#define HEATER_1_PIN 23 // EXTRUDER 2 +#define HEATER_0_PIN 19 // EXTRUDER 1 +#define HEATER_1_PIN 23 // EXTRUDER 2 #define HEATER_BED_PIN 22 // diff --git a/Marlin/pins_CHEAPTRONICv2.h b/Marlin/pins_CHEAPTRONICv2.h index eea57d2..b30d6d3 100644 --- a/Marlin/pins_CHEAPTRONICv2.h +++ b/Marlin/pins_CHEAPTRONICv2.h @@ -31,7 +31,6 @@ #endif #define BOARD_NAME "Cheaptronic v2.0" - // // Limit Switches // @@ -75,38 +74,16 @@ #define TEMP_0_PIN 15 #define TEMP_1_PIN 13 #define TEMP_2_PIN 14 -#define TEMP_3_PIN 11 // should be used for chamber temperature control +#define TEMP_3_PIN 11 #define TEMP_BED_PIN 12 // // Heaters / Fans // -#define HEATER_0_PIN 6 -#define HEATER_1_PIN 7 -#define HEATER_2_PIN 8 -#define HEATER_BED_PIN 9 -#ifndef FAN_PIN - #define FAN_PIN 3 -#endif -#define FAN2_PIN 58 // additional fan or light control output - -// -// Other board specific pins -// -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 37 // board input labeled as F-DET -#endif -#define Z_MIN_PROBE_PIN 36 // additional external board input labeled as E-SENS (should be used for Z-probe) -#define LED_PIN 13 -#define SPINDLE_ENABLE_PIN 4 // additional PWM pin 1 at JP1 connector - should be used for laser control too -#define EXT_2 5 // additional PWM pin 2 at JP1 connector -#define EXT_3 2 // additional PWM pin 3 at JP1 connector -#define PS_ON_PIN 45 -#define KILL_PIN 46 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 11 // shared with TEMP_3 analog input -#endif +#define HEATER_0_PIN 6 +#define HEATER_1_PIN 7 +#define HEATER_2_PIN 8 +#define HEATER_BED_PIN 9 // // LCD @@ -128,3 +105,16 @@ #define BTN_EN1 11 #define BTN_EN2 12 #define BTN_ENC 43 + +// +// Other board specific pins +// +#define LED_PIN 13 +#define SPINDLE_ENABLE_PIN 4 +#define FAN_PIN 3 +#define PS_ON_PIN 45 +#define KILL_PIN 46 + +#ifndef FILWIDTH_PIN + #define FILWIDTH_PIN 37 // should be Analog Input (0-15) +#endif diff --git a/Marlin/pins_CNCONTROLS_11.h b/Marlin/pins_CNCONTROLS_11.h index 0a32d04..265d1b6 100644 --- a/Marlin/pins_CNCONTROLS_11.h +++ b/Marlin/pins_CNCONTROLS_11.h @@ -65,9 +65,7 @@ #define HEATER_3_PIN 46 #define HEATER_BED_PIN 2 -#ifndef FAN_PIN - //#define FAN_PIN 7 // common PWM pin for all tools -#endif +//#define FAN_PIN 7 // common PWM pin for all tools #define ORIG_E0_AUTO_FAN_PIN 7 #define ORIG_E1_AUTO_FAN_PIN 7 @@ -86,7 +84,7 @@ //#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 +//#define TOOL_PWM_PIN 7 // common PWM pin for all tools // Common I/O diff --git a/Marlin/pins_CNCONTROLS_12.h b/Marlin/pins_CNCONTROLS_12.h index f073b19..50c87cd 100644 --- a/Marlin/pins_CNCONTROLS_12.h +++ b/Marlin/pins_CNCONTROLS_12.h @@ -65,9 +65,7 @@ #define HEATER_3_PIN 3 #define HEATER_BED_PIN 24 -#ifndef FAN_PIN - #define FAN_PIN 5 // 5 is PWMtool3 -> 7 is common PWM pin for all tools -#endif +#define FAN_PIN 5 // 5 is PWMtool3 -> 7 is common PWM pin for all tools #define ORIG_E0_AUTO_FAN_PIN 7 #define ORIG_E1_AUTO_FAN_PIN 7 @@ -83,9 +81,9 @@ // Tools //#define TOOL_0_PIN 56 -//#define TOOL_0_PWM_PIN 10 // red warning led at dual extruder +//#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_1_PWM_PIN 8 // lights at dual extruder //#define TOOL_2_PIN 4 //#define TOOL_2_PWM_PIN 5 //#define TOOL_3_PIN 14 @@ -93,9 +91,7 @@ // Common I/O -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 18 -#endif +#define FIL_RUNOUT_PIN 18 //#define PWM_1_PIN 12 //#define PWM_2_PIN 13 //#define SPARE_IO 17 @@ -126,4 +122,4 @@ //#define UI2 37 #define STAT_LED_BLUE_PIN -1 -#define STAT_LED_RED_PIN 10 // TOOL_0_PWM_PIN +#define STAT_LED_RED_PIN 10 // TOOL_0_PWM_PIN diff --git a/Marlin/pins_ELEFU_3.h b/Marlin/pins_ELEFU_3.h index 79a4bce..51bd078 100644 --- a/Marlin/pins_ELEFU_3.h +++ b/Marlin/pins_ELEFU_3.h @@ -85,20 +85,18 @@ // // Heaters / Fans // -#define HEATER_0_PIN 45 // 12V PWM1 -#define HEATER_1_PIN 46 // 12V PWM2 -#define HEATER_2_PIN 17 // 12V PWM3 -#define HEATER_BED_PIN 44 // DOUBLE 12V PWM +#define HEATER_0_PIN 45 // 12V PWM1 +#define HEATER_1_PIN 46 // 12V PWM2 +#define HEATER_2_PIN 17 // 12V PWM3 +#define HEATER_BED_PIN 44 // DOUBLE 12V PWM -#ifndef FAN_PIN - #define FAN_PIN 16 // 5V PWM -#endif +#define FAN_PIN 16 // 5V PWM // // Misc. Functions // -#define PS_ON_PIN 10 // Set to -1 if using a manual switch on the PWRSW Connector -#define SLEEP_WAKE_PIN 26 // This feature still needs work +#define PS_ON_PIN 10 // Set to -1 if using a manual switch on the PWRSW Connector +#define SLEEP_WAKE_PIN 26 // This feature still needs work #define PHOTOGRAPH_PIN 29 // @@ -124,28 +122,28 @@ #define TLC_XLAT_PIN 22 #define TLC_DATA_PIN 24 - // We also need to define pin to port number mapping for the 2560 to match the pins listed above. - // If you change the TLC pins, update this as well per the 2560 datasheet! This currently only works with the RA Board. - #define TLC_CLOCK_BIT 3 - #define TLC_CLOCK_PORT &PORTA + // We also need to define pin to port number mapping for the 2560 to match the pins listed above. If you change the TLC pins, update this as well per the 2560 datasheet! + // This currently only works with the RA Board. + #define TLC_CLOCK_BIT 3 // bit 3 on port A + #define TLC_CLOCK_PORT &PORTA // bit 3 on port A - #define TLC_BLANK_BIT 1 - #define TLC_BLANK_PORT &PORTA + #define TLC_BLANK_BIT 1 // bit 1 on port A + #define TLC_BLANK_PORT &PORTA // bit 1 on port A - #define TLC_DATA_BIT 2 - #define TLC_DATA_PORT &PORTA + #define TLC_DATA_BIT 2 // bit 2 on port A + #define TLC_DATA_PORT &PORTA // bit 2 on port A - #define TLC_XLAT_BIT 0 - #define TLC_XLAT_PORT &PORTA + #define TLC_XLAT_BIT 0 // bit 0 on port A + #define TLC_XLAT_PORT &PORTA // bit 0 on port A - // Change this to match your situation. Lots of TLCs takes up the arduino SRAM very quickly, so be careful + // change this to match your situation. Lots of TLCs takes up the arduino SRAM very quickly, so be careful // Leave it at at least 1 if you have enabled RA_LIGHTING // The number of TLC5947 boards chained together for use with the animation, additional ones will repeat the animation on them, but are not individually addressable and mimic those before them. You can leave the default at 2 even if you only have 1 TLC5947 module. - #define NUM_TLCS 2 + #define NUM_TLCS 2 // These TRANS_ARRAY values let you change the order the LEDs on the lighting modules will animate for chase functions. // Modify them according to your specific situation. // NOTE: the array should be 8 long for every TLC you have. These defaults assume (2) TLCs. - #define TRANS_ARRAY { 0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8 } // forward - //#define TRANS_ARRAY { 7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10, 11, 12, 13, 14, 15 } // backward + #define TRANS_ARRAY {0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8} //forwards + //#define TRANS_ARRAY {7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10, 11, 12, 13, 14, 15} //backwards #endif // RA_DISCO diff --git a/Marlin/pins_GEN3_MONOLITHIC.h b/Marlin/pins_GEN3_MONOLITHIC.h index 5d64e94..dae4046 100644 --- a/Marlin/pins_GEN3_MONOLITHIC.h +++ b/Marlin/pins_GEN3_MONOLITHIC.h @@ -68,11 +68,11 @@ // #define X_STEP_PIN 15 #define X_DIR_PIN 18 -#define X_ENABLE_PIN 24 // actually uses Y_enable_pin +#define X_ENABLE_PIN 24 // actually uses Y_enable_pin #define Y_STEP_PIN 23 #define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 // shared with X_enable_pin +#define Y_ENABLE_PIN 24 // shared with X_enable_pin #define Z_STEP_PIN 27 #define Z_DIR_PIN 28 @@ -95,6 +95,7 @@ // // Misc. Functions // -#define PS_ON_PIN 14 // Alex, does this work on the card? +#define PS_ON_PIN 14 // Alex, does this work on the card? // Alex extras from Gen3+ + diff --git a/Marlin/pins_GEN7_12.h b/Marlin/pins_GEN7_12.h index 1afaae9..b0f178f 100644 --- a/Marlin/pins_GEN7_12.h +++ b/Marlin/pins_GEN7_12.h @@ -60,7 +60,7 @@ #endif #ifndef GEN7_VERSION - #define GEN7_VERSION 12 // v1.x + #define GEN7_VERSION 12 // v1.x #endif // @@ -112,8 +112,8 @@ #define HEATER_0_PIN 4 #define HEATER_BED_PIN 3 -#if !defined(FAN_PIN) && GEN7_VERSION < 13 // Gen7 v1.3 removed the fan pin - #define FAN_PIN 31 +#if GEN7_VERSION < 13 // Gen7 v1.3 removed the fan pin + #define FAN_PIN 31 #endif // @@ -122,9 +122,9 @@ #define PS_ON_PIN 15 #if GEN7_VERSION < 13 - #define CASE_LIGHT_PIN 16 // MUST BE HARDWARE PWM + #define CASE_LIGHT_PIN 16 // MUST BE HARDWARE PWM #else // Gen7 v1.3 removed the I2C connector & signals so need to get PWM off the PC power supply header - #define CASE_LIGHT_PIN 15 // MUST BE HARDWARE PWM + #define CASE_LIGHT_PIN 15 // MUST BE HARDWARE PWM #endif // All these generations of Gen7 supply thermistor power @@ -140,10 +140,10 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup/pulldown! +#define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup/pulldown! #define SPINDLE_DIR_PIN 11 #if GEN7_VERSION < 13 - #define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM #else // Gen7 v1.3 removed the I2C connector & signals so need to get PWM off the PC power supply header - #define SPINDLE_LASER_PWM_PIN 15 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_PWM_PIN 15 // MUST BE HARDWARE PWM #endif diff --git a/Marlin/pins_GEN7_13.h b/Marlin/pins_GEN7_13.h index 749a6c3..03ea131 100644 --- a/Marlin/pins_GEN7_13.h +++ b/Marlin/pins_GEN7_13.h @@ -51,5 +51,5 @@ #define BOARD_NAME "Gen7 v1.3" -#define GEN7_VERSION 13 // 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 dedd227..9d4e16a 100644 --- a/Marlin/pins_GEN7_14.h +++ b/Marlin/pins_GEN7_14.h @@ -57,7 +57,7 @@ #define BOARD_NAME "Gen7 v1.4" -#define GEN7_VERSION 14 // v1.4 +#define GEN7_VERSION 14 // v1.4 // // Limit switches @@ -113,6 +113,6 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENABLE_PIN 20 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENABLE_PIN 20 // Pin should have a pullup/pulldown! +#define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM #define SPINDLE_DIR_PIN 21 diff --git a/Marlin/pins_GEN7_CUSTOM.h b/Marlin/pins_GEN7_CUSTOM.h index fdfb6b5..d64e94e 100644 --- a/Marlin/pins_GEN7_CUSTOM.h +++ b/Marlin/pins_GEN7_CUSTOM.h @@ -133,6 +133,6 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENABLE_PIN 5 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENABLE_PIN 5 // Pin should have a pullup/pulldown! +#define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM #define SPINDLE_DIR_PIN 6 diff --git a/Marlin/pins_GT2560_REV_A.h b/Marlin/pins_GT2560_REV_A.h index 63f166a..cb48920 100644 --- a/Marlin/pins_GT2560_REV_A.h +++ b/Marlin/pins_GT2560_REV_A.h @@ -81,9 +81,7 @@ #define HEATER_0_PIN 2 #define HEATER_1_PIN 3 #define HEATER_BED_PIN 4 -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif +#define FAN_PIN 7 // // Misc. Functions @@ -92,7 +90,7 @@ #define SDSS 53 #define LED_PIN 13 #define PS_ON_PIN 12 -#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing +#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing #define KILL_PIN -1 #if ENABLED(ULTRA_LCD) diff --git a/Marlin/pins_LEAPFROG.h b/Marlin/pins_LEAPFROG.h index 9a31520..a7fffa5 100644 --- a/Marlin/pins_LEAPFROG.h +++ b/Marlin/pins_LEAPFROG.h @@ -47,21 +47,21 @@ #define X_DIR_PIN 63 #define X_ENABLE_PIN 29 -#define Y_STEP_PIN 14 // A6 -#define Y_DIR_PIN 15 // A0 +#define Y_STEP_PIN 14 // A6 +#define Y_DIR_PIN 15 // A0 #define Y_ENABLE_PIN 39 -#define Z_STEP_PIN 31 // A2 -#define Z_DIR_PIN 32 // A6 -#define Z_ENABLE_PIN 30 // A1 +#define Z_STEP_PIN 31 // A2 +#define Z_DIR_PIN 32 // A6 +#define Z_ENABLE_PIN 30 // A1 -#define E0_STEP_PIN 34 // 34 -#define E0_DIR_PIN 35 // 35 -#define E0_ENABLE_PIN 33 // 33 +#define E0_STEP_PIN 34 // 34 +#define E0_DIR_PIN 35 // 35 +#define E0_ENABLE_PIN 33 // 33 -#define E1_STEP_PIN 37 // 37 -#define E1_DIR_PIN 40 // 40 -#define E1_ENABLE_PIN 36 // 36 +#define E1_STEP_PIN 37 // 37 +#define E1_DIR_PIN 40 // 40 +#define E1_ENABLE_PIN 36 // 36 // // Temperature Sensors @@ -74,9 +74,9 @@ // Heaters / Fans // #define HEATER_0_PIN 9 -#define HEATER_1_PIN 8 // 12 -#define HEATER_2_PIN 11 // 13 -#define HEATER_BED_PIN 10 // 14/15 +#define HEATER_1_PIN 8 // 12 +#define HEATER_2_PIN 11 // 13 +#define HEATER_BED_PIN 10 // 14/15 #define FAN_PIN 7 diff --git a/Marlin/pins_MEGACONTROLLER.h b/Marlin/pins_MEGACONTROLLER.h index 709dc41..c4a1070 100644 --- a/Marlin/pins_MEGACONTROLLER.h +++ b/Marlin/pins_MEGACONTROLLER.h @@ -62,17 +62,17 @@ // // Steppers // -#define X_STEP_PIN 62 // A8 -#define X_DIR_PIN 63 // A9 -#define X_ENABLE_PIN 61 // A7 +#define X_STEP_PIN 62 // A8 +#define X_DIR_PIN 63 // A9 +#define X_ENABLE_PIN 61 // A7 -#define Y_STEP_PIN 65 // A11 -#define Y_DIR_PIN 66 // A12 -#define Y_ENABLE_PIN 64 // A10 +#define Y_STEP_PIN 65 // A11 +#define Y_DIR_PIN 66 // A12 +#define Y_ENABLE_PIN 64 // A10 -#define Z_STEP_PIN 68 // A14 -#define Z_DIR_PIN 69 // A15 -#define Z_ENABLE_PIN 67 // A13 +#define Z_STEP_PIN 68 // A14 +#define Z_DIR_PIN 69 // A15 +#define Z_ENABLE_PIN 67 // A13 #define E0_STEP_PIN 23 #define E0_DIR_PIN 24 @@ -112,9 +112,7 @@ #define HEATER_1_PIN 34 #define HEATER_BED_PIN 28 -#ifndef FAN_PIN - #define FAN_PIN 39 -#endif +#define FAN_PIN 39 #define FAN1_PIN 35 #define FAN2_PIN 36 @@ -135,12 +133,11 @@ // LCD / Controller // #if ENABLED(MINIPANEL) - #define BEEPER_PIN 46 // Pins for DOGM SPI LCD Support #define DOGLCD_A0 47 #define DOGLCD_CS 45 - #define LCD_BACKLIGHT_PIN 44 // backlight LED on PA3 + #define LCD_BACKLIGHT_PIN 44 // backlight LED on PA3 #define KILL_PIN 12 // GLCD features @@ -155,12 +152,11 @@ #define BTN_ENC 10 #define SD_DETECT_PIN 49 - #endif // MINIPANEL // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 7 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENABLE_PIN 7 // Pin should have a pullup! #define SPINDLE_DIR_PIN 8 diff --git a/Marlin/pins_MEGATRONICS.h b/Marlin/pins_MEGATRONICS.h index 8b608ef..702cf98 100644 --- a/Marlin/pins_MEGATRONICS.h +++ b/Marlin/pins_MEGATRONICS.h @@ -53,13 +53,13 @@ #define X_DIR_PIN 28 #define X_ENABLE_PIN 24 -#define Y_STEP_PIN 60 // A6 -#define Y_DIR_PIN 61 // A7 +#define Y_STEP_PIN 60 // A6 +#define Y_DIR_PIN 61 // A7 #define Y_ENABLE_PIN 22 -#define Z_STEP_PIN 54 // A0 -#define Z_DIR_PIN 55 // A1 -#define Z_ENABLE_PIN 56 // A2 +#define Z_STEP_PIN 54 // A0 +#define Z_DIR_PIN 55 // A1 +#define Z_ENABLE_PIN 56 // A2 #define E0_STEP_PIN 31 #define E0_DIR_PIN 32 @@ -87,9 +87,7 @@ #define HEATER_1_PIN 8 #define HEATER_BED_PIN 10 -#ifndef FAN_PIN - #define FAN_PIN 7 // IO pin. Buffer needed -#endif +#define FAN_PIN 7 // IO pin. Buffer needed // // Misc. Functions @@ -125,6 +123,6 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_PWM_PIN 3 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 4 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 3 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENABLE_PIN 4 // Pin should have a pullup! #define SPINDLE_DIR_PIN 11 diff --git a/Marlin/pins_MEGATRONICS_2.h b/Marlin/pins_MEGATRONICS_2.h index 9bd8b45..2609d20 100644 --- a/Marlin/pins_MEGATRONICS_2.h +++ b/Marlin/pins_MEGATRONICS_2.h @@ -53,13 +53,13 @@ #define X_DIR_PIN 27 #define X_ENABLE_PIN 25 -#define Y_STEP_PIN 4 // A6 -#define Y_DIR_PIN 54 // A0 +#define Y_STEP_PIN 4 // A6 +#define Y_DIR_PIN 54 // A0 #define Y_ENABLE_PIN 5 -#define Z_STEP_PIN 56 // A2 -#define Z_DIR_PIN 60 // A6 -#define Z_ENABLE_PIN 55 // A1 +#define Z_STEP_PIN 56 // A2 +#define Z_DIR_PIN 60 // A6 +#define Z_ENABLE_PIN 55 // A1 #define E0_STEP_PIN 35 #define E0_DIR_PIN 36 @@ -69,8 +69,8 @@ #define E1_DIR_PIN 39 #define E1_ENABLE_PIN 28 -#define E2_STEP_PIN 23 // ? schematic says 24 -#define E2_DIR_PIN 24 // ? schematic says 23 +#define E2_STEP_PIN 23 // ? schematic says 24 +#define E2_DIR_PIN 24 // ? schematic says 23 #define E2_ENABLE_PIN 22 // @@ -101,9 +101,7 @@ #define HEATER_1_PIN 8 #define HEATER_BED_PIN 10 -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif +#define FAN_PIN 7 #define FAN1_PIN 6 // @@ -140,6 +138,6 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_PWM_PIN 3 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 16 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 11 +#define SPINDLE_LASER_PWM_PIN 3 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENABLE_PIN 16 // Pin should have a pullup! +#define SPINDLE_DIR_PIN 11 diff --git a/Marlin/pins_MEGATRONICS_3.h b/Marlin/pins_MEGATRONICS_3.h index 119c63a..7b66361 100644 --- a/Marlin/pins_MEGATRONICS_3.h +++ b/Marlin/pins_MEGATRONICS_3.h @@ -37,10 +37,10 @@ // // Servos // -#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 // // Limit Switches @@ -118,9 +118,7 @@ #define HEATER_2_PIN 8 #define HEATER_BED_PIN 10 -#ifndef FAN_PIN - #define FAN_PIN 6 -#endif +#define FAN_PIN 6 #define FAN1_PIN 7 // @@ -170,9 +168,9 @@ // // M3/M4/M5 - Spindle/Laser Control // -#if DISABLED(REPRAPWORLD_KEYPAD) // try to use the keypad connector first - #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 43 // Pin should have a pullup! +#if DISABLED(REPRAPWORLD_KEYPAD) // try to use the keypad connector first + #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENABLE_PIN 43 // Pin should have a pullup! #define SPINDLE_DIR_PIN 42 #elif EXTRUDERS <= 2 // Hijack the last extruder so that we can get the PWM signal off the Y breakout @@ -186,7 +184,7 @@ #define Y_ENABLE_PIN 23 #define Y_STEP_PIN 22 #define Y_DIR_PIN 60 - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 17 // Pin should have a pullup! + #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENABLE_PIN 17 // Pin should have a pullup! #define SPINDLE_DIR_PIN 5 #endif diff --git a/Marlin/pins_MELZI.h b/Marlin/pins_MELZI.h index 79042f6..4f6ccb5 100644 --- a/Marlin/pins_MELZI.h +++ b/Marlin/pins_MELZI.h @@ -24,9 +24,6 @@ * Melzi pin assignments */ -#ifndef BOARD_NAME - #define BOARD_NAME "Melzi" -#endif - +#define BOARD_NAME "Melzi" #define IS_MELZI #include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin/pins_MELZI_CREALITY.h b/Marlin/pins_MELZI_CREALITY.h index 8bfd3b8..02f8491 100644 --- a/Marlin/pins_MELZI_CREALITY.h +++ b/Marlin/pins_MELZI_CREALITY.h @@ -31,8 +31,9 @@ */ #define BOARD_NAME "Melzi (Creality)" +#define IS_MELZI -#include "pins_MELZI.h" +#include "pins_SANGUINOLOLU_12.h" // For the stock CR-10 use the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER // option for the display in Configuration.h @@ -47,22 +48,16 @@ #undef LCD_PINS_D7 #undef FIL_RUNOUT_PIN -#define LCD_SDSS 31 // Smart Controller SD card reader (rather than the Melzi) -#define LCD_PINS_RS 28 // ST9720 CS -#define LCD_PINS_ENABLE 17 // ST9720 DAT -#define LCD_PINS_D4 30 // ST9720 CLK -#define FIL_RUNOUT_PIN -1 // Uses Beeper/LED Pin Pulled to GND +#define LCD_SDSS 31 // Smart Controller SD card reader (rather than the Melzi) +#define LCD_PINS_RS 28 // st9720 CS +#define LCD_PINS_ENABLE 17 // st9720 DAT +#define LCD_PINS_D4 30 // st9720 CLK +#define FIL_RUNOUT_PIN -1 // Uses Beeper/LED Pin Pulled to GND // Alter timing for graphical display -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(125) -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) -#endif +#define ST7920_DELAY_1 DELAY_2_NOP +#define ST7920_DELAY_2 DELAY_2_NOP +#define ST7920_DELAY_3 DELAY_2_NOP #if ENABLED(MINIPANEL) #undef DOGLCD_CS diff --git a/Marlin/pins_MELZI_MAKR3D.h b/Marlin/pins_MELZI_MAKR3D.h index 1b20d2a..556f9ce 100644 --- a/Marlin/pins_MELZI_MAKR3D.h +++ b/Marlin/pins_MELZI_MAKR3D.h @@ -25,4 +25,5 @@ */ #define BOARD_NAME "Melzi (ATmega1284)" -#include "pins_MELZI.h" +#define IS_MELZI +#include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin/pins_MIGHTYBOARD_REVE.h b/Marlin/pins_MIGHTYBOARD_REVE.h index 989533d..86be51a 100644 --- a/Marlin/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/pins_MIGHTYBOARD_REVE.h @@ -119,7 +119,6 @@ #define DIGIPOTS_I2C_SDA_Z 65 // K3 #define DIGIPOTS_I2C_SDA_E0 27 // A5 #define DIGIPOTS_I2C_SDA_E1 77 // J6 -#define DIGIPOT_I2C_ADDRESS_A 0x2F // unshifted slave address (5E <- 2F << 1) // // Temperature Sensors @@ -134,14 +133,14 @@ // 2 E4 CS2 // 78 E2 SCK // -#define THERMO_SCK_PIN 78 // E2 -#define THERMO_DO_PIN 3 // E5 -#define THERMO_CS1 5 // E3 -#define THERMO_CS2 2 // E4 +#define THERMO_SCK_PIN 78 // E2 +#define THERMO_DO_PIN 3 // E5 +#define THERMO_CS1 5 // E3 +#define THERMO_CS2 2 // E4 -#define MAX6675_SS THERMO_CS1 -#define MAX6675_SCK_PIN THERMO_SCK_PIN -#define MAX6675_DO_PIN THERMO_DO_PIN +#define MAX6675_SS THERMO_CS1 +#define MAX6675_SCK_PIN THERMO_SCK_PIN +#define MAX6675_DO_PIN THERMO_DO_PIN // // Augmentation for auto-assigning plugs // @@ -149,10 +148,10 @@ // 2 extruders or 1 extruder and a heated bed. // With no heated bed, an additional 24V fan is possible. // -#define MOSFET_A_PIN 6 // H3 -#define MOSFET_B_PIN 11 // B5 - Rev A of this file had this pin assigned to 9 -#define MOSFET_C_PIN 45 // L4 -#define MOSFET_D_PIN 44 // L5 +#define MOSFET_A_PIN 6 // H3 +#define MOSFET_B_PIN 11 // B5 - Rev A of this file had this pin assigned to 9 +#define MOSFET_C_PIN 45 // L4 +#define MOSFET_D_PIN 44 // L5 #if HOTENDS > 1 #if TEMP_SENSOR_BED @@ -172,24 +171,23 @@ #define HEATER_0_PIN MOSFET_A_PIN #if ENABLED(IS_EFB) // Hotend, Fan, Bed - #define HEATER_BED_PIN MOSFET_C_PIN + #define FAN_PIN MOSFET_B_PIN + #define HEATER_BED_PIN MOSFET_C_PIN #elif ENABLED(IS_EEF) // Hotend, Hotend, Fan - #define HEATER_1_PIN MOSFET_B_PIN + #define HEATER_1_PIN MOSFET_B_PIN + #define FAN_PIN MOSFET_C_PIN #elif ENABLED(IS_EEB) // Hotend, Hotend, Bed - #define HEATER_1_PIN MOSFET_B_PIN - #define HEATER_BED_PIN MOSFET_C_PIN + #define HEATER_1_PIN MOSFET_B_PIN + #define HEATER_BED_PIN MOSFET_C_PIN #elif ENABLED(IS_EFF) // Hotend, Fan, Fan - #define FAN1_PIN MOSFET_C_PIN + #define FAN_PIN MOSFET_B_PIN + #define FAN1_PIN MOSFET_C_PIN +#elif ENABLED(IS_SF) // Spindle, Fan + #define FAN_PIN MOSFET_C_PIN #endif #ifndef FAN_PIN - #if ENABLED(IS_EFB) || ENABLED(IS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan - #define FAN_PIN MOSFET_B_PIN - #elif ENABLED(IS_EEF) || ENABLED(IS_SF) // Hotend, Hotend, Fan or Spindle, Fan - #define FAN_PIN MOSFET_C_PIN - #else - #define FAN_PIN MOSFET_D_PIN - #endif + #define FAN_PIN MOSFET_D_PIN #endif // @@ -201,37 +199,37 @@ // // Misc. Functions // -#define LED_PIN 13 // B7 -#define CUTOFF_RESET_PIN 16 // H1 -#define CUTOFF_TEST_PIN 17 // H0 -#define CASE_LIGHT_PIN 44 // L5 MUST BE HARDWARE PWM +#define LED_PIN 13 // B7 +#define CUTOFF_RESET_PIN 16 // H1 +#define CUTOFF_TEST_PIN 17 // H0 +#define CASE_LIGHT_PIN 44 // L5 MUST BE HARDWARE PWM // // LCD / Controller // #ifdef REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - #define LCD_PINS_RS 33 // C4: LCD-STROBE - #define LCD_PINS_ENABLE 72 // J2: LEFT - #define LCD_PINS_D4 35 // C2: LCD-CLK - #define LCD_PINS_D5 32 // C5: RLED - #define LCD_PINS_D6 34 // C3: LCD-DATA - #define LCD_PINS_D7 31 // C6: GLED + #define LCD_PINS_RS 33 // C4: LCD-STROBE + #define LCD_PINS_ENABLE 72 // J2: LEFT + #define LCD_PINS_D4 35 // C2: LCD-CLK + #define LCD_PINS_D5 32 // C5: RLED + #define LCD_PINS_D6 34 // C3: LCD-DATA + #define LCD_PINS_D7 31 // C6: GLED - #define BTN_EN2 75 // J4, UP - #define BTN_EN1 73 // J3, DOWN + #define BTN_EN2 75 // J4, UP + #define BTN_EN1 73 // J3, DOWN //STOP button connected as KILL_PIN - #define KILL_PIN 14 // J1, RIGHT + #define KILL_PIN 14 // J1, RIGHT //KILL - not connected - #define BEEPER_PIN 8 // H5, SD_WP + #define BEEPER_PIN 8 // H5, SD_WP - #define BTN_CENTER 15 // J0 - #define BTN_ENC BTN_CENTER + #define BTN_CENTER 15 // J0 + #define BTN_ENC BTN_CENTER //on board leds - #define STAT_LED_RED_LED SERVO0_PIN // C1 (1280-EX1, DEBUG2) - #define STAT_LED_BLUE_PIN SERVO1_PIN // C0 (1280-EX2, DEBUG3) + #define STAT_LED_RED_LED SERVO0_PIN // C1 (1280-EX1, DEBUG2) + #define STAT_LED_BLUE_PIN SERVO1_PIN // C0 (1280-EX2, DEBUG3) #else // Replicator uses a 3-wire SR controller with HD44780 @@ -239,18 +237,18 @@ // #define SAV_3DLCD - #define SR_DATA_PIN 34 // C3 - #define SR_CLK_PIN 35 // C2 - #define SR_STROBE_PIN 33 // C4 + #define SR_DATA_PIN 34 // C3 + #define SR_CLK_PIN 35 // C2 + #define SR_STROBE_PIN 33 // C4 - #define BTN_UP 75 // J4 - #define BTN_DOWN 73 // J3 - #define BTN_LEFT 72 // J2 - #define BTN_RIGHT 14 // J1 - #define BTN_CENTER 15 // J0 - #define BTN_ENC BTN_CENTER + #define BTN_UP 75 // J4 + #define BTN_DOWN 73 // J3 + #define BTN_LEFT 72 // J2 + #define BTN_RIGHT 14 // J1 + #define BTN_CENTER 15 // J0 + #define BTN_ENC BTN_CENTER - #define BEEPER_PIN 4 // G5 + #define BEEPER_PIN 4 // G5 #define STAT_LED_RED_PIN 32 // C5 #define STAT_LED_BLUE_PIN 31 // C6 (Actually green) @@ -260,17 +258,19 @@ // // SD Card // -#define SDSS 53 // B0 -#define SD_DETECT_PIN 9 // H6 +#define SDSS 53 // B0 +#define SD_DETECT_PIN 9 // H6 #define MAX_PIN THERMO_SCK_PIN // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENABLE_PIN 66 // K4 Pin should have a pullup! -#define SPINDLE_LASER_PWM_PIN 8 // H5 MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 67 // K5 +#define SPINDLE_LASER_ENABLE_PIN 66 // K4 Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 8 // H5 MUST BE HARDWARE PWM +#define SPINDLE_DIR_PIN 67 // K5 + + // Check if all pins are defined in mega/pins_arduino.h diff --git a/Marlin/pins_MINIRAMBO.h b/Marlin/pins_MINIRAMBO.h index 89335ea..b326112 100644 --- a/Marlin/pins_MINIRAMBO.h +++ b/Marlin/pins_MINIRAMBO.h @@ -106,9 +106,7 @@ #endif #define HEATER_BED_PIN 4 -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif +#define FAN_PIN 8 #define FAN1_PIN 6 // @@ -124,8 +122,8 @@ // M3/M4/M5 - Spindle/Laser Control // // use P1 connector for spindle pins -#define SPINDLE_LASER_PWM_PIN 9 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 18 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 9 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENABLE_PIN 18 // Pin should have a pullup! #define SPINDLE_DIR_PIN 19 // diff --git a/Marlin/pins_MINITRONICS.h b/Marlin/pins_MINITRONICS.h index f5fdac2..d3ff9ed 100644 --- a/Marlin/pins_MINITRONICS.h +++ b/Marlin/pins_MINITRONICS.h @@ -57,13 +57,13 @@ #define X_DIR_PIN 47 #define X_ENABLE_PIN 49 -#define Y_STEP_PIN 39 // A6 -#define Y_DIR_PIN 40 // A0 +#define Y_STEP_PIN 39 // A6 +#define Y_DIR_PIN 40 // A0 #define Y_ENABLE_PIN 38 -#define Z_STEP_PIN 42 // A2 -#define Z_DIR_PIN 43 // A6 -#define Z_ENABLE_PIN 41 // A1 +#define Z_STEP_PIN 42 // A2 +#define Z_DIR_PIN 43 // A6 +#define Z_ENABLE_PIN 41 // A1 #define E0_STEP_PIN 45 #define E0_DIR_PIN 44 @@ -83,13 +83,11 @@ // // Heaters / Fans // -#define HEATER_0_PIN 7 // EXTRUDER 1 -#define HEATER_1_PIN 8 // EXTRUDER 2 -#define HEATER_BED_PIN 3 // BED +#define HEATER_0_PIN 7 // EXTRUDER 1 +#define HEATER_1_PIN 8 // EXTRUDER 2 +#define HEATER_BED_PIN 3 // BED -#ifndef FAN_PIN - #define FAN_PIN 9 -#endif +#define FAN_PIN 9 // // Misc. Functions @@ -124,7 +122,7 @@ #define BTN_EN2 -1 #define BTN_ENC -1 - #define SD_DETECT_PIN -1 // Minitronics doesn't use this + #define SD_DETECT_PIN -1 // Minitronics doesn't use this #endif // @@ -132,13 +130,13 @@ // #if ENABLED(SPINDLE_LASER_ENABLE) // assumes we're only doing CNC work (no 3D printing) #undef HEATER_BED_PIN - #undef TEMP_BED_PIN // need to free up some pins but also need to - #undef TEMP_0_PIN // re-assign them (to unused pins) because Marlin - #undef TEMP_1_PIN // requires the presence of certain pins or else it - #define HEATER_BED_PIN 4 // won't compile + #undef TEMP_BED_PIN // need to free up some pins but also need to + #undef TEMP_0_PIN // re-assign them (to unused pins) because Marlin + #undef TEMP_1_PIN // requires the presence of certain pins or else it + #define HEATER_BED_PIN 4 // won't compile #define TEMP_BED_PIN 50 #define TEMP_0_PIN 51 - #define SPINDLE_LASER_ENABLE_PIN 52 // using A6 because it already has a pullup - #define SPINDLE_LASER_PWM_PIN 3 // WARNING - LED & resistor pull up to +12/+24V stepper voltage + #define SPINDLE_LASER_ENABLE_PIN 52 // using A6 because it already has a pull up on it + #define SPINDLE_LASER_PWM_PIN 3 // WARNING - LED & resistor pull up to +12/+24V stepper voltage #define SPINDLE_DIR_PIN 53 #endif diff --git a/Marlin/pins_MKS_13.h b/Marlin/pins_MKS_13.h new file mode 100644 index 0000000..07aa658 --- /dev/null +++ b/Marlin/pins_MKS_13.h @@ -0,0 +1,144 @@ +/** + * 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 Mega with RAMPS v1.4 adjusted pin assignments + * + * MKS v1.3 (Extruder, Fan, Bed) + * MKS v1.3 (Extruder, Extruder, Fan, Bed) + * MKS v1.4 (Extruder, Fan, Bed) + * MKS v1.4 (Extruder, Extruder, Fan, Bed) + */ + +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "MKS 1.3/1.4 supports up to 2 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_NAME "MKS > v1.3" + +// +// Heaters / Fans +// +// Power outputs EFBF or EFBE +#define MOSFET_D_PIN 7 + +// +// PSU / SERVO +// +// If POWER_SUPPLY is specified, always hijack Servo 3 +// +#if POWER_SUPPLY > 0 + #define SERVO3_PIN -1 + #define PS_ON_PIN 4 +#endif + +#include "pins_RAMPS.h" + +// +// LCD / Controller +// +#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_PIN 16 + + // white BLUE-LED + #define STAT_LED_BLUE_PIN 17 + +#endif diff --git a/Marlin/pins_MKS_BASE.h b/Marlin/pins_MKS_BASE.h index 65c78e1..dcf9b90 100644 --- a/Marlin/pins_MKS_BASE.h +++ b/Marlin/pins_MKS_BASE.h @@ -43,8 +43,8 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_PWM_PIN 2 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 15 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 2 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENABLE_PIN 15 // Pin should have a pullup! #define SPINDLE_DIR_PIN 19 #include "pins_RAMPS.h" diff --git a/Marlin/pins_MKS_GEN_L.h b/Marlin/pins_MKS_GEN_L.h index 59c5bcf..dd4568e 100644 --- a/Marlin/pins_MKS_GEN_L.h +++ b/Marlin/pins_MKS_GEN_L.h @@ -36,17 +36,4 @@ // Power outputs EFBF or EFBE #define MOSFET_D_PIN 7 -// -// CS Pins wired to avoid conflict with the LCD -// See https://www.thingiverse.com/asset:66604 -// - -#ifndef X_CS_PIN - #define X_CS_PIN 59 -#endif - -#ifndef Y_CS_PIN - #define Y_CS_PIN 63 -#endif - #include "pins_RAMPS.h" diff --git a/Marlin/pins_OMCA.h b/Marlin/pins_OMCA.h index 6ee6fab..8715efc 100644 --- a/Marlin/pins_OMCA.h +++ b/Marlin/pins_OMCA.h @@ -108,13 +108,13 @@ #define E0_DIR_PIN 21 #define E0_ENABLE_PIN 10 -#define E1_STEP_PIN -1 // 21 -#define E1_DIR_PIN -1 // 20 -#define E1_ENABLE_PIN -1 // 19 +#define E1_STEP_PIN -1 // 21 +#define E1_DIR_PIN -1 // 20 +#define E1_ENABLE_PIN -1 // 19 -#define E2_STEP_PIN -1 // 21 -#define E2_DIR_PIN -1 // 20 -#define E2_ENABLE_PIN -1 // 18 +#define E2_STEP_PIN -1 // 21 +#define E2_DIR_PIN -1 // 20 +#define E2_ENABLE_PIN -1 // 18 // // Temperature Sensors @@ -126,12 +126,10 @@ // // Heaters / Fans // -#define HEATER_0_PIN 3 // DONE PWM on RIGHT connector +#define HEATER_0_PIN 3 // DONE PWM on RIGHT connector #define HEATER_BED_PIN 4 -#ifndef FAN_PIN - #define FAN_PIN 14 // PWM on MIDDLE connector -#endif +#define FAN_PIN 14 // PWM on MIDDLE connector // // Misc. Functions @@ -147,4 +145,4 @@ #define __GS 18 #define __GD 13 -#define UNUSED_PWM 14 // PWM on LEFT connector +#define UNUSED_PWM 14 // PWM on LEFT connector diff --git a/Marlin/pins_OMCA_A.h b/Marlin/pins_OMCA_A.h index 777c80b..3686973 100644 --- a/Marlin/pins_OMCA_A.h +++ b/Marlin/pins_OMCA_A.h @@ -107,12 +107,12 @@ #define E0_DIR_PIN 27 #define E0_ENABLE_PIN 24 -#define E1_STEP_PIN -1 // 19 -#define E1_DIR_PIN -1 // 18 +#define E1_STEP_PIN -1 // 19 +#define E1_DIR_PIN -1 // 18 #define E1_ENABLE_PIN 24 -#define E2_STEP_PIN -1 // 17 -#define E2_DIR_PIN -1 // 16 +#define E2_STEP_PIN -1 // 17 +#define E2_DIR_PIN -1 // 16 #define E2_ENABLE_PIN 24 // @@ -125,9 +125,7 @@ // #define HEATER_0_PIN 4 -#ifndef FAN_PIN - #define FAN_PIN 3 -#endif +#define FAN_PIN 3 // // Misc. Functions diff --git a/Marlin/pins_PRINTRBOARD.h b/Marlin/pins_PRINTRBOARD.h index 42632d1..93f4b2b 100644 --- a/Marlin/pins_PRINTRBOARD.h +++ b/Marlin/pins_PRINTRBOARD.h @@ -74,7 +74,11 @@ // Limit Switches // #define X_STOP_PIN 47 // E3 -#define Y_STOP_PIN 20 // B0 SS +#if ENABLED(SDSUPPORT) + #define Y_STOP_PIN 37 // E5 - Move Ystop to Estop socket +#else + #define Y_STOP_PIN 20 // B0 SS - Ystop in Ystop socket +#endif #define Z_STOP_PIN 36 // E4 // @@ -110,14 +114,13 @@ #define HEATER_2_PIN 45 // F7 #define HEATER_BED_PIN 14 // C4 PWM3C -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif + +#define FAN_PIN 16 // C6 PWM3A // // Misc. Functions // -#define SDSS 26 // B6 SDCS +#define SDSS 20 // B0 SS #define FILWIDTH_PIN 2 // Analog Input // @@ -143,18 +146,16 @@ #define BTN_EN2 3 // D3 RX1 JP2-7 #define BTN_ENC 45 // F7 TDI JP2-12 - #undef SDSS #define SDSS 43 // F5 TMS JP2-8 - #define STAT_LED_RED_PIN 12 // C2 JP11-14 - #define STAT_LED_BLUE_PIN 10 // C0 JP11-12 + #define STAT_LED_RED_PIN 12 // C2 JP11-14 + #define STAT_LED_BLUE_PIN 10 // C0 JP11-12 #elif ENABLED(LCD_I2C_PANELOLU2) #define BTN_EN1 3 // D3 RX1 JP2-7 #define BTN_EN2 2 // D2 TX1 JP2-5 #define BTN_ENC 41 // F3 JP2-4 - #undef SDSS #define SDSS 38 // F0 B-THERM connector - use SD card on Panelolu2 #else diff --git a/Marlin/pins_PRINTRBOARD_REVF.h b/Marlin/pins_PRINTRBOARD_REVF.h index 8239a91..0da837f 100644 --- a/Marlin/pins_PRINTRBOARD_REVF.h +++ b/Marlin/pins_PRINTRBOARD_REVF.h @@ -70,7 +70,7 @@ #error "USBCON should be defined by the platform for this board." #endif -#define BOARD_NAME "Printrboard Rev.F" +#define BOARD_NAME "Printrboard Rev F" // Disable JTAG pins so EXP1 pins work correctly // (Its pins are used for the Extrudrboard and filament sensor, for example). #define DISABLE_JTAG @@ -83,7 +83,7 @@ * See https://printrbot.zendesk.com/hc/en-us/articles/115003072346 * * If you have REV F6 you probably also want to set E0_AUTO_FAN_PIN - * to PRINTRBOARD_F6_HEATER_FAN_PIN (44). + * to PRINTRBOARD_F6_HEATER_FAN_PIN * * Define NO_EXTRUDRBOARD if you don't have an EXTRUDRBOARD and wish to * reassign different functions to EXP1. @@ -190,9 +190,7 @@ #endif #endif -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif +#define FAN_PIN 16 // C6 PWM3A // // LCD / Controller @@ -220,40 +218,34 @@ #define SDSS 3 // F5 TMS JP2-8 - #define STAT_LED_RED_PIN 12 // C2 JP11-14 - #define STAT_LED_BLUE_PIN 10 // C0 JP11-12 + #define STAT_LED_RED_PIN 12 // C2 JP11-14 + #define STAT_LED_BLUE_PIN 10 // C0 JP11-12 #elif ENABLED(MINIPANEL) #if DISABLED(USE_INTERNAL_SD) // PIN FASTIO PIN# ATUSB90 PIN# Teensy2.0++ PIN# Printrboard RevF Conn. MKSLCD12864 PIN# - #define SDSS 11 // 36 C1 EXP2-13 EXP2-07 - #define SD_DETECT_PIN 9 // 34 E1 EXP2-11 EXP2-04 + #define SDSS 11 // 36 C1 EXP2-13 EXP2-07 + #define SD_DETECT_PIN 9 // 34 E1 EXP2-11 EXP2-04 #endif // PIN FASTIO PIN# ATUSB90 PIN# Teensy2.0++ PIN# Printrboard RevF Conn. MKSLCD12864 PIN# - #define DOGLCD_A0 4 // 29 D4 EXP2-05 EXP1-04 - #define DOGLCD_CS 5 // 30 D5 EXP2-06 EXP1-05 - #define BTN_ENC 6 // 31 D6 EXP2-07 EXP1-09 - #define BEEPER_PIN 7 // 32 D7 EXP2-08 EXP1-10 - #define KILL_PIN 8 // 33 E0 EXP2-10 EXP2-03 - #define BTN_EN1 10 // 35 C0 EXP2-12 EXP2-06 - #define BTN_EN2 12 // 37 C2 EXP2-14 EXP2-08 - //#define LCD_BACKLIGHT_PIN 43 // 56 F5 EXP1-12 Not Implemented - //#define SCK 21 // 11 B1 ICSP-04 EXP2-09 - //#define MOSI 22 // 12 B2 ICSP-03 EXP2-05 - //#define MISO 23 // 13 B3 ICSP-06 EXP2-05 + #define DOGLCD_A0 4 // 29 D4 EXP2-05 EXP1-04 + #define DOGLCD_CS 5 // 30 D5 EXP2-06 EXP1-05 + #define BTN_ENC 6 // 31 D6 EXP2-07 EXP1-09 + #define BEEPER_PIN 7 // 32 D7 EXP2-08 EXP1-10 + #define KILL_PIN 8 // 33 E0 EXP2-10 EXP2-03 + #define BTN_EN1 10 // 35 C0 EXP2-12 EXP2-06 + #define BTN_EN2 12 // 37 C2 EXP2-14 EXP2-08 + //#define LCD_BACKLIGHT_PIN 43 // 56 F5 EXP1-12 Not Implemented + //#define SCK 21 // 11 B1 ICSP-04 EXP2-09 + //#define MOSI 22 // 12 B2 ICSP-03 EXP2-05 + //#define MISO 23 // 13 B3 ICSP-06 EXP2-05 // increase delays - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(313) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(313) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(313) - #endif + #define ST7920_DELAY_1 DELAY_5_NOP + #define ST7920_DELAY_2 DELAY_5_NOP + #define ST7920_DELAY_3 DELAY_5_NOP #else @@ -270,7 +262,7 @@ // // PIN FASTIO PIN# ATUSB90 PIN# Teensy2.0++ PIN# Printrboard RevF Conn. #ifndef SDSS - #define SDSS 20 // 10 B0 + #define SDSS 20 // 10 B0 #endif /** diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h index f2ea3d3..c6ef675 100644 --- a/Marlin/pins_RAMBO.h +++ b/Marlin/pins_RAMBO.h @@ -49,10 +49,17 @@ // // Servos // -#define SERVO0_PIN 22 // Motor header MX1 -#define SERVO1_PIN 23 // Motor header MX2 -#define SERVO2_PIN 24 // Motor header MX3 -#define SERVO3_PIN 5 // PWM header pin 5 +#define SERVO0_PIN 22 // Motor header MX1 +#define SERVO1_PIN 23 // Motor header MX2 +#define SERVO2_PIN 24 // Motor header MX3 +#define SERVO3_PIN 5 // PWM header pin 5 + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 30 +#endif // // Limit Switches @@ -64,13 +71,6 @@ #define Z_MIN_PIN 10 #define Z_MAX_PIN 30 -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 30 -#endif - // // Steppers // @@ -107,10 +107,7 @@ #define E1_MS2_PIN 64 #define DIGIPOTSS_PIN 38 -#define DIGIPOT_CHANNELS { 4,5,3,0,1 } // X Y Z E0 E1 digipot channels to stepper driver mapping -#ifndef DIGIPOT_MOTOR_CURRENT - #define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) -#endif +#define DIGIPOT_CHANNELS {4,5,3,0,1} // X Y Z E0 E1 digipot channels to stepper driver mapping // // Temperature Sensors @@ -127,9 +124,7 @@ #define HEATER_2_PIN 6 #define HEATER_BED_PIN 3 -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif +#define FAN_PIN 8 #define FAN1_PIN 6 #define FAN2_PIN 2 @@ -148,8 +143,8 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 31 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENABLE_PIN 31 // Pin should have a pullup! #define SPINDLE_DIR_PIN 32 // @@ -157,14 +152,14 @@ // #define E_MUX0_PIN 17 #define E_MUX1_PIN 16 -#define E_MUX2_PIN 84 // 84 in MK2 Firmware +#define E_MUX2_PIN 84 // 84 in MK2 Firmware // // LCD / Controller // #if ENABLED(ULTRA_LCD) - #define KILL_PIN 80 + #define KILL_PIN 80 #if ENABLED(NEWPANEL) @@ -176,41 +171,41 @@ #define LCD_PINS_D7 75 #if ENABLED(VIKI2) || ENABLED(miniVIKI) - #define BEEPER_PIN 44 + #define BEEPER_PIN 44 // NB: Panucatt's Viki 2.0 wiring diagram (v1.2) indicates that the // beeper/buzzer is connected to pin 33; however, the pin used in the // diagram is actually pin 44, so this is correct. - #define DOGLCD_A0 70 - #define DOGLCD_CS 71 + #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 BTN_EN1 85 + #define BTN_EN2 84 + #define BTN_ENC 83 - #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board + #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board #define STAT_LED_RED_PIN 22 #define STAT_LED_BLUE_PIN 32 - #else // !VIKI2 && !miniVIKI + #else - #define BEEPER_PIN 79 // AUX-4 + #define BEEPER_PIN 79 // AUX-4 // AUX-2 - #define BTN_EN1 76 - #define BTN_EN2 77 - #define BTN_ENC 78 + #define BTN_EN1 76 + #define BTN_EN2 77 + #define BTN_ENC 78 #define SD_DETECT_PIN 81 - #endif // !VIKI2 && !miniVIKI + #endif // VIKI2/miniVIKI #else // !NEWPANEL - old style panel with shift register // No Beeper added - #define BEEPER_PIN 33 + #define BEEPER_PIN 33 // buttons are attached to a shift register // Not wired yet diff --git a/Marlin/pins_RAMPS.h b/Marlin/pins_RAMPS.h index 20d1cba..9b10751 100644 --- a/Marlin/pins_RAMPS.h +++ b/Marlin/pins_RAMPS.h @@ -56,7 +56,7 @@ // Servos // #ifdef IS_RAMPS_13 - #define SERVO0_PIN 7 // RAMPS_13 // Will conflict with BTN_EN2 on LCD_I2C_VIKI + #define SERVO0_PIN 7 // RAMPS_13 // Will conflict with BTN_EN2 on LCD_I2C_VIKI #else #define SERVO0_PIN 11 #endif @@ -91,54 +91,30 @@ #define X_STEP_PIN 54 #define X_DIR_PIN 55 #define X_ENABLE_PIN 38 -#ifndef X_CS_PIN - #define X_CS_PIN 53 -#endif +#define X_CS_PIN 53 #define Y_STEP_PIN 60 #define Y_DIR_PIN 61 #define Y_ENABLE_PIN 56 -#ifndef Y_CS_PIN - #define Y_CS_PIN 49 -#endif +#define Y_CS_PIN 49 #define Z_STEP_PIN 46 #define Z_DIR_PIN 48 #define Z_ENABLE_PIN 62 -#ifndef Z_CS_PIN - #define Z_CS_PIN 40 -#endif +#define Z_CS_PIN 40 #define E0_STEP_PIN 26 #define E0_DIR_PIN 28 #define E0_ENABLE_PIN 24 -#ifndef E0_CS_PIN - #define E0_CS_PIN 42 -#endif +#define E0_CS_PIN 42 #define E1_STEP_PIN 36 #define E1_DIR_PIN 34 #define E1_ENABLE_PIN 30 -#ifndef E1_CS_PIN - #define E1_CS_PIN 44 -#endif +#define E1_CS_PIN 44 -/** - * Default pins for TMC software SPI - */ -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI 66 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO 44 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK 64 - #endif -#endif -#if HAS_DRIVER(TMC2208) +#if ENABLED(HAVE_TMC2208) /** * TMC2208 stepper drivers * @@ -155,29 +131,29 @@ //#define E1_HARDWARE_SERIAL Serial1 //#define E2_HARDWARE_SERIAL Serial1 //#define E3_HARDWARE_SERIAL Serial1 - //#define E4_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 /** * Software serial */ - #define X_SERIAL_TX_PIN 40 + #define X_SERIAL_TX_PIN 59 #define X_SERIAL_RX_PIN 63 #define X2_SERIAL_TX_PIN -1 #define X2_SERIAL_RX_PIN -1 - #define Y_SERIAL_TX_PIN 59 - #define Y_SERIAL_RX_PIN 64 + #define Y_SERIAL_TX_PIN 64 + #define Y_SERIAL_RX_PIN 40 #define Y2_SERIAL_TX_PIN -1 #define Y2_SERIAL_RX_PIN -1 - #define Z_SERIAL_TX_PIN 42 - #define Z_SERIAL_RX_PIN 65 + #define Z_SERIAL_TX_PIN 44 + #define Z_SERIAL_RX_PIN 42 #define Z2_SERIAL_TX_PIN -1 #define Z2_SERIAL_RX_PIN -1 - #define E0_SERIAL_TX_PIN 44 - #define E0_SERIAL_RX_PIN 66 + #define E0_SERIAL_TX_PIN 66 + #define E0_SERIAL_RX_PIN 65 #define E1_SERIAL_TX_PIN -1 #define E1_SERIAL_RX_PIN -1 #define E2_SERIAL_TX_PIN -1 @@ -197,9 +173,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card #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 + #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 // @@ -223,48 +199,46 @@ // Heaters / Fans // #ifndef MOSFET_D_PIN - #define MOSFET_D_PIN -1 + #define MOSFET_D_PIN -1 #endif #ifndef RAMPS_D8_PIN - #define RAMPS_D8_PIN 8 + #define RAMPS_D8_PIN 8 #endif #ifndef RAMPS_D9_PIN - #define RAMPS_D9_PIN 9 + #define RAMPS_D9_PIN 9 #endif #ifndef RAMPS_D10_PIN - #define RAMPS_D10_PIN 10 + #define RAMPS_D10_PIN 10 #endif -#define HEATER_0_PIN RAMPS_D10_PIN +#define HEATER_0_PIN RAMPS_D10_PIN #if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed - #define HEATER_BED_PIN RAMPS_D8_PIN + #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 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 + #define HEATER_1_PIN RAMPS_D9_PIN + #define HEATER_BED_PIN RAMPS_D8_PIN #elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan - #define FAN1_PIN RAMPS_D8_PIN -#elif DISABLED(IS_RAMPS_SF) // Not Spindle, Fan (i.e., "EFBF" or "EFBE") - #define HEATER_BED_PIN RAMPS_D8_PIN + #define FAN_PIN RAMPS_D9_PIN + #define FAN1_PIN RAMPS_D8_PIN +#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 + #define FAN1_PIN MOSFET_D_PIN #else - #define HEATER_1_PIN MOSFET_D_PIN + #define HEATER_1_PIN MOSFET_D_PIN #endif #endif #ifndef FAN_PIN - #if ENABLED(IS_RAMPS_EFB) || ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan - #define FAN_PIN RAMPS_D9_PIN - #elif ENABLED(IS_RAMPS_EEF) || ENABLED(IS_RAMPS_SF) // Hotend, Hotend, Fan or Spindle, Fan - #define FAN_PIN RAMPS_D8_PIN - #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed - #define FAN_PIN 4 // IO pin. Buffer needed - #else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE") - #define FAN_PIN RAMPS_D9_PIN - #endif + #define FAN_PIN 4 // IO pin. Buffer needed #endif // @@ -278,20 +252,18 @@ #endif // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 4 -#endif +#define FIL_RUNOUT_PIN 4 #ifndef PS_ON_PIN #define PS_ON_PIN 12 #endif -#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENABLE_PIN) - #if NUM_SERVOS <= 1 // try to use servo connector first - #define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM +#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENABLE_PIN) + #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first + #define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) \ && (ENABLED(PANEL_ONE) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MINIPANEL) || ENABLED(REPRAPWORLD_KEYPAD))) // try to use AUX 2 - #define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM + #define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM #endif #endif @@ -300,13 +272,13 @@ // #if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENABLE) #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first - #define SPINDLE_LASER_ENABLE_PIN 4 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENABLE_PIN 4 // Pin should have a pullup/pulldown! + #define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM #define SPINDLE_DIR_PIN 5 #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) \ && (ENABLED(PANEL_ONE) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MINIPANEL) || ENABLED(REPRAPWORLD_KEYPAD))) // try to use AUX 2 - #define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup/pulldown! + #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM #define SPINDLE_DIR_PIN 65 #endif #endif @@ -335,9 +307,9 @@ // #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 + #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) @@ -360,20 +332,11 @@ #define BEEPER_PIN 37 #endif - #elif ENABLED(ZONESTAR_LCD) - - #define LCD_PINS_RS 64 - #define LCD_PINS_ENABLE 44 - #define LCD_PINS_D4 63 - #define LCD_PINS_D5 40 - #define LCD_PINS_D6 42 - #define LCD_PINS_D7 65 - #else #if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) - #define LCD_PINS_DC 25 // Set as output on init - #define LCD_PINS_RS 27 // Pull low for 1s to init + #define LCD_PINS_DC 25 // Set as output on init + #define LCD_PINS_RS 27 // Pull low for 1s to init // DOGM SPI LCD Support #define DOGLCD_CS 16 #define DOGLCD_MOSI 17 @@ -443,16 +406,16 @@ #define BTN_EN1 47 #define BTN_EN2 43 #define BTN_ENC 32 - #define LCD_SDSS SDSS + #define LCD_SDSS 53 #define KILL_PIN 41 #elif ENABLED(LCD_I2C_VIKI) - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. + #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. + #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. #define BTN_ENC -1 - #define LCD_SDSS SDSS + #define LCD_SDSS 53 #define SD_DETECT_PIN 49 #elif ENABLED(VIKI2) || ENABLED(miniVIKI) @@ -469,7 +432,8 @@ #define BTN_EN2 7 #define BTN_ENC 39 - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board + #define SDSS 53 + #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board #define KILL_PIN 31 #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) @@ -484,11 +448,11 @@ #define BTN_EN2 37 #define BTN_ENC 31 - #define LCD_SDSS SDSS + #define LCD_SDSS 53 #define SD_DETECT_PIN 49 #define KILL_PIN 41 - #elif ENABLED(MKS_MINI_12864) // Added in Marlin 1.1.6 + #elif ENABLED(MKS_MINI_12864) // Added in Marlin 1.1.6 #define DOGLCD_A0 27 #define DOGLCD_CS 25 @@ -502,12 +466,13 @@ #define BEEPER_PIN 37 // not connected to a pin - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 + #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 #define BTN_EN1 31 #define BTN_EN2 33 #define BTN_ENC 35 + #define SDSS 53 #define SD_DETECT_PIN 49 #define KILL_PIN 64 @@ -515,7 +480,7 @@ #define BEEPER_PIN 42 // not connected to a pin - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 + #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 #define DOGLCD_A0 44 #define DOGLCD_CS 66 @@ -531,13 +496,10 @@ #define BTN_EN2 63 #define BTN_ENC 59 + #define SDSS 53 #define SD_DETECT_PIN 49 #define KILL_PIN 64 - #elif ENABLED(ZONESTAR_LCD) - - #define ADC_KEYPAD_PIN 12 - #else // Beeper on AUX-4 @@ -552,9 +514,9 @@ #define BTN_EN2 59 #define BTN_ENC 63 #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 + #define BTN_EN1 59 // AUX2 PIN 3 + #define BTN_EN2 63 // AUX2 PIN 4 + #define BTN_ENC 49 // AUX3 PIN 7 #else #define BTN_EN1 37 #define BTN_EN2 35 @@ -570,3 +532,17 @@ #endif // NEWPANEL #endif // ULTRA_LCD + +#if ENABLED(ZONESTAR_LCD) + #define LCD_PINS_RS 64 + #define LCD_PINS_ENABLE 44 + #define LCD_PINS_D4 63 + #define LCD_PINS_D5 40 + #define LCD_PINS_D6 42 + #define LCD_PINS_D7 65 + #define ADC_KEYPAD_PIN 12 + #define BTN_EN1 -1 + #define BTN_EN2 -1 + #define BTN_ENC -1 + // pin 29 N/C +#endif // ZONESTAR_LCD diff --git a/Marlin/pins_RAMPS_OLD.h b/Marlin/pins_RAMPS_OLD.h index da047e2..870f2fb 100644 --- a/Marlin/pins_RAMPS_OLD.h +++ b/Marlin/pins_RAMPS_OLD.h @@ -77,9 +77,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card #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 + #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 // @@ -88,15 +88,11 @@ #if ENABLED(RAMPS_V_1_0) #define HEATER_0_PIN 12 #define HEATER_BED_PIN -1 - #ifndef FAN_PIN - #define FAN_PIN 11 - #endif + #define FAN_PIN 11 #else // RAMPS_V_1_1 or RAMPS_V_1_2 #define HEATER_0_PIN 10 #define HEATER_BED_PIN 8 - #ifndef FAN_PIN - #define FAN_PIN 9 - #endif + #define FAN_PIN 9 #endif // @@ -105,11 +101,11 @@ #define SDPOWER 48 #define SDSS 53 #define LED_PIN 13 -#define CASE_LIGHT_PIN 45 // MUST BE HARDWARE PWM +#define CASE_LIGHT_PIN 45 // MUST BE HARDWARE PWM // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENABLE_PIN 41 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENABLE_PIN 41 // Pin should have a pullup/pulldown! +#define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM #define SPINDLE_DIR_PIN 43 diff --git a/Marlin/pins_RIGIDBOARD.h b/Marlin/pins_RIGIDBOARD.h index f783d83..5bd06e4 100644 --- a/Marlin/pins_RIGIDBOARD.h +++ b/Marlin/pins_RIGIDBOARD.h @@ -36,9 +36,8 @@ // // MOSFET changes // -#define RAMPS_D9_PIN 8 // FAN (by default) -#define RAMPS_D10_PIN 9 // EXTRUDER 1 -#define MOSFET_D_PIN 12 // EXTRUDER 2 or FAN +#define RAMPS_D10_PIN 9 // EXTRUDER 1 +#define MOSFET_D_PIN 12 // EXTRUDER 2 or FAN #include "pins_RAMPS.h" @@ -75,9 +74,9 @@ // SPI for Max6675 or Max31855 Thermocouple #undef MAX6675_SS #if DISABLED(SDSUPPORT) - #define MAX6675_SS 53 // Don't use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS 53 // Don't use pin 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS 49 // Don't use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present + #define MAX6675_SS 49 // Don't 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 // @@ -86,9 +85,8 @@ #undef HEATER_BED_PIN #define HEATER_BED_PIN 10 -#ifndef FAN_PIN - #define FAN_PIN 8 // Same as RAMPS_13_EEF -#endif +#undef FAN_PIN +#define FAN_PIN 8 // Same as RAMPS_13_EEF // // Misc. Functions diff --git a/Marlin/pins_RIGIDBOARD_V2.h b/Marlin/pins_RIGIDBOARD_V2.h index 2075892..dfac705 100644 --- a/Marlin/pins_RIGIDBOARD_V2.h +++ b/Marlin/pins_RIGIDBOARD_V2.h @@ -39,12 +39,12 @@ // Channels available for DAC, For Rigidboard there are 4 #define DAC_STEPPER_ORDER { 0, 1, 2, 3 } -#define DAC_STEPPER_SENSE 0.05 // sense resistors on rigidboard stepper chips are .05 value +#define DAC_STEPPER_SENSE 0.05 // sense resistors on rigidboard stepper chips are .05 value #define DAC_STEPPER_ADDRESS 0 -#define DAC_STEPPER_MAX 4096 // was 5000 but max allowable value is actually 4096 -#define DAC_STEPPER_VREF 1 // internal Vref, gain 2x = 4.096V -#define DAC_STEPPER_GAIN 1 // value of 1 here sets gain of 2 -#define DAC_DISABLE_PIN 42 // set low to enable DAC +#define DAC_STEPPER_MAX 4096 // was 5000 but max allowable value is actually 4096 +#define DAC_STEPPER_VREF 1 // internal Vref, gain 2x = 4.096V +#define DAC_STEPPER_GAIN 1 // value of 1 here sets gain of 2 +#define DAC_DISABLE_PIN 42 // set low to enable DAC #define DAC_OR_ADDRESS 0x01 #ifndef DAC_MOTOR_CURRENT_DEFAULT diff --git a/Marlin/pins_RUMBA.h b/Marlin/pins_RUMBA.h index 160dae5..5f56778 100644 --- a/Marlin/pins_RUMBA.h +++ b/Marlin/pins_RUMBA.h @@ -107,7 +107,6 @@ // optional for extruder 4 or chamber: //#define TEMP_X_PIN 12 // Analog Input (default connector for thermistor *T3* on rumba board is used) -//#define TEMP_CHAMBER_PIN 12 // Analog Input (default connector for thermistor *T3* on rumba board is used) #if TEMP_SENSOR_BED == -1 #define TEMP_BED_PIN 7 // Analog Input (connector *K3* on RUMBA thermocouple ADD ON is used <-- this can't be used when TEMP_SENSOR_2 is defined as thermocouple) @@ -124,9 +123,7 @@ #define HEATER_3_PIN 8 #define HEATER_BED_PIN 9 -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif +#define FAN_PIN 7 #define FAN1_PIN 8 // @@ -138,41 +135,24 @@ #define KILL_PIN 46 #define CASE_LIGHT_PIN 45 -// -// M3/M4/M5 - Spindle/Laser Control -// -#ifndef SPINDLE_LASER_PWM_PIN - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM. Pin 4 interrupts OC0* and OC1* always in use? -#endif -#ifndef SPINDLE_LASER_ENABLE_PIN - #define SPINDLE_LASER_ENABLE_PIN 14 // Pin should have a pullup! -#endif -#ifndef SPINDLE_DIR_PIN - #define SPINDLE_DIR_PIN 15 -#endif - // // LCD / Controller // #define SD_DETECT_PIN 49 #define BEEPER_PIN 44 +#define LCD_PINS_RS 19 +#define LCD_PINS_ENABLE 42 +#define LCD_PINS_D4 18 +#define LCD_PINS_D5 38 +#define LCD_PINS_D6 41 #define LCD_PINS_D7 40 #define BTN_EN1 11 #define BTN_EN2 12 #define BTN_ENC 43 -#if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) - #define LCD_PINS_DC 38 // Set as output on init - #define LCD_PINS_RS 41 // Pull low for 1s to init - // DOGM SPI LCD Support - #define DOGLCD_CS 19 - #define DOGLCD_MOSI 42 - #define DOGLCD_SCK 18 - #define DOGLCD_A0 LCD_PINS_DC -#else - #define LCD_PINS_RS 19 - #define LCD_PINS_ENABLE 42 - #define LCD_PINS_D4 18 - #define LCD_PINS_D5 38 - #define LCD_PINS_D6 41 -#endif +// +// M3/M4/M5 - Spindle/Laser Control +// +#define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENABLE_PIN 14 // Pin should have a pullup! +#define SPINDLE_DIR_PIN 15 diff --git a/Marlin/pins_SAINSMART_2IN1.h b/Marlin/pins_SAINSMART_2IN1.h index 53d1a3e..bf01a9e 100644 --- a/Marlin/pins_SAINSMART_2IN1.h +++ b/Marlin/pins_SAINSMART_2IN1.h @@ -21,7 +21,7 @@ */ /** - * Sainsmart 2-in-1 pin assignments + * Sainsmart 2-in-1 pin assignments */ #if HOTENDS > 2 || E_STEPPERS > 2 @@ -33,9 +33,9 @@ // // Heaters / Fans // -#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 +#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 #include "pins_RAMPS.h" diff --git a/Marlin/pins_SANGUINOLOLU_11.h b/Marlin/pins_SANGUINOLOLU_11.h index 0d9af5b..00c2c58 100644 --- a/Marlin/pins_SANGUINOLOLU_11.h +++ b/Marlin/pins_SANGUINOLOLU_11.h @@ -90,23 +90,23 @@ // // Heaters / Fans // -#define HEATER_0_PIN 13 // (extruder) +#define HEATER_0_PIN 13 // (extruder) #if ENABLED(SANGUINOLOLU_V_1_2) - #define HEATER_BED_PIN 12 // (bed) + #define HEATER_BED_PIN 12 // (bed) #define X_ENABLE_PIN 14 #define Y_ENABLE_PIN 14 #define Z_ENABLE_PIN 26 #define E0_ENABLE_PIN 14 - #if !defined(FAN_PIN) && ENABLED(LCD_I2C_PANELOLU2) - #define FAN_PIN 4 // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan + #if ENABLED(LCD_I2C_PANELOLU2) + #define FAN_PIN 4 // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan #endif #else - #define HEATER_BED_PIN 14 // (bed) + #define HEATER_BED_PIN 14 // (bed) #define X_ENABLE_PIN -1 #define Y_ENABLE_PIN -1 #define Z_ENABLE_PIN -1 @@ -114,8 +114,8 @@ #endif -#if !defined(FAN_PIN) && (MB(AZTEEG_X1) || MB(STB_11) || ENABLED(IS_MELZI)) - #define FAN_PIN 4 // Works for Panelolu2 too +#if MB(AZTEEG_X1) || MB(STB_11) || ENABLED(IS_MELZI) + #define FAN_PIN 4 // Works for Panelolu2 too #endif // @@ -134,11 +134,11 @@ #if ENABLED(IS_MELZI) #define LED_PIN 27 #elif MB(STB_11) - #define LCD_BACKLIGHT_PIN 17 // LCD backlight LED + #define LCD_BACKLIGHT_PIN 17 // LCD backlight LED #endif #if DISABLED(SPINDLE_LASER_ENABLE) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // try to use IO Header - #define CASE_LIGHT_PIN 4 // MUST BE HARDWARE PWM - see if IO Header is available + #define CASE_LIGHT_PIN 4 // MUST BE HARDWARE PWM - see if IO Header is available #endif /** @@ -160,9 +160,9 @@ #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0 #if ENABLED(IS_MELZI) - #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 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 // 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. @@ -185,12 +185,7 @@ #define BEEPER_PIN 29 #define DOGLCD_CS 17 - #define LCD_BACKLIGHT_PIN 28 // PA3 - - #elif ENABLED(IS_MELZI) - - #define BEEPER_PIN 27 - #define DOGLCD_CS 28 + #define LCD_BACKLIGHT_PIN 28 // PA3 #else // !MAKRPANEL @@ -224,7 +219,7 @@ #if ENABLED(IS_MELZI) #define BTN_ENC 29 - #define LCD_SDSS 30 // Panelolu2 SD card reader rather than the Melzi + #define LCD_SDSS 30 // Panelolu2 SD card reader rather than the Melzi #else #define BTN_ENC 30 #endif @@ -239,13 +234,13 @@ #define BTN_EN2 30 #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(0) + #define ST7920_DELAY_1 DELAY_0_NOP #endif #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(188) + #define ST7920_DELAY_2 DELAY_3_NOP #endif #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(0) + #define ST7920_DELAY_3 DELAY_0_NOP #endif #elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards @@ -265,7 +260,7 @@ #else // !LCD_I2C_PANELOLU2 && !LCD_FOR_MELZI && !ZONESTAR_LCD #define BTN_ENC 16 - #define LCD_SDSS 28 // Smart Controller SD card reader rather than the Melzi + #define LCD_SDSS 28 // Smart Controller SD card reader rather than the Melzi #endif @@ -279,8 +274,8 @@ #if ENABLED(SPINDLE_LASER_ENABLE) #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // try to use IO Header - #define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup/pulldown! + #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM #define SPINDLE_DIR_PIN 11 #elif !MB(MELZI) // use X stepper motor socket @@ -318,8 +313,8 @@ #define X_DIR_PIN 0 #define X_ENABLE_PIN 14 #define X_STEP_PIN 1 - #define SPINDLE_LASER_PWM_PIN 15 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 21 // Pin should have a pullup! - #define SPINDLE_DIR_PIN -1 // No pin available on the socket for the direction pin + #define SPINDLE_LASER_PWM_PIN 15 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENABLE_PIN 21 // Pin should have a pullup! + #define SPINDLE_DIR_PIN -1 // No pin available on the socket for the direction pin #endif #endif // SPINDLE_LASER_ENABLE diff --git a/Marlin/pins_SAV_MKI.h b/Marlin/pins_SAV_MKI.h index 8945594..99dd228 100644 --- a/Marlin/pins_SAV_MKI.h +++ b/Marlin/pins_SAV_MKI.h @@ -114,9 +114,7 @@ #define HEATER_0_PIN 15 // C5 PWM3B - Extruder #define HEATER_BED_PIN 14 // C4 PWM3C - Bed -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif +#define FAN_PIN 16 // C6 PWM3A // // Misc. Functions @@ -175,10 +173,10 @@ // // M3/M4/M5 - Spindle/Laser Control // - #define SPINDLE_LASER_PWM_PIN 24 // B4 PWM2A - #define SPINDLE_LASER_ENABLE_PIN 39 // F1 Pin should have a pullup! - #define SPINDLE_DIR_PIN 40 // F2 + #define SPINDLE_LASER_PWM_PIN 24 // B4 PWM2A + #define SPINDLE_LASER_ENABLE_PIN 39 // F1 Pin should have a pullup! + #define SPINDLE_DIR_PIN 40 // F2 - #define CASE_LIGHT_PIN 0 // D0 PWM0B + #define CASE_LIGHT_PIN 0 // D0 PWM0B #endif diff --git a/Marlin/pins_SCOOVO_X9H.h b/Marlin/pins_SCOOVO_X9H.h index ea6685d..52b8d14 100644 --- a/Marlin/pins_SCOOVO_X9H.h +++ b/Marlin/pins_SCOOVO_X9H.h @@ -33,10 +33,10 @@ // // Servos // -#define SERVO0_PIN 22 // Motor header MX1 -#define SERVO1_PIN 23 // Motor header MX2 -#define SERVO2_PIN 24 // Motor header MX3 -#define SERVO3_PIN 5 // PWM header pin 5 +#define SERVO0_PIN 22 // Motor header MX1 +#define SERVO1_PIN 23 // Motor header MX2 +#define SERVO2_PIN 24 // Motor header MX3 +#define SERVO3_PIN 5 // PWM header pin 5 // // Limit Switches @@ -91,7 +91,7 @@ #define E1_MS2_PIN 64 #define DIGIPOTSS_PIN 38 -#define DIGIPOT_CHANNELS {4,5,3,0,1} // X Y Z E0 E1 digipot channels to stepper driver mapping +#define DIGIPOT_CHANNELS {4,5,3,0,1} // X Y Z E0 E1 digipot channels to stepper driver mapping // // Temperature Sensors @@ -106,9 +106,7 @@ #define HEATER_1_PIN 7 #define HEATER_BED_PIN 3 -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif +#define FAN_PIN 8 #define FAN1_PIN 6 #define FAN2_PIN 2 diff --git a/Marlin/pins_SETHI.h b/Marlin/pins_SETHI.h index 801560e..ac570fd 100644 --- a/Marlin/pins_SETHI.h +++ b/Marlin/pins_SETHI.h @@ -56,7 +56,7 @@ #define BOARD_NAME "Sethi 3D_1" #ifndef GEN7_VERSION - #define GEN7_VERSION 12 // v1.x + #define GEN7_VERSION 12 // v1.x #endif // @@ -98,13 +98,12 @@ #define HEATER_0_PIN 4 #define HEATER_BED_PIN 3 -#ifndef FAN_PIN - #if GEN7_VERSION >= 13 - // Gen7 v1.3 removed the fan pin - #define FAN_PIN -1 - #else - #define FAN_PIN 31 - #endif + +#if GEN7_VERSION >= 13 + // Gen7 v1.3 removed the fan pin + #define FAN_PIN -1 +#else + #define FAN_PIN 31 #endif // diff --git a/Marlin/pins_SILVER_GATE.h b/Marlin/pins_SILVER_GATE.h index 005c4c6..482416e 100644 --- a/Marlin/pins_SILVER_GATE.h +++ b/Marlin/pins_SILVER_GATE.h @@ -56,13 +56,11 @@ #define FIL_RUNOUT_PIN 34 // X_MAX unless overridden #endif -#ifndef FAN_PIN - #define FAN_PIN 5 -#endif +#define FAN_PIN 5 #define HEATER_0_PIN 7 -#define ORIG_E0_AUTO_FAN_PIN 3 // Use this by NOT overriding E0_AUTO_FAN_PIN +#define E0_AUTO_FAN_PIN 3 #define CONTROLLER_FAN_PIN 2 #define TEMP_0_PIN 7 // Analog Input diff --git a/Marlin/pins_TEENSY2.h b/Marlin/pins_TEENSY2.h index 736be6f..9800eb0 100644 --- a/Marlin/pins_TEENSY2.h +++ b/Marlin/pins_TEENSY2.h @@ -149,9 +149,7 @@ // #define HEATER_0_PIN 15 // C5 PWM3B Extruder #define HEATER_BED_PIN 14 // C4 PWM3C -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A Fan -#endif +#define FAN_PIN 16 // C6 PWM3A Fan // // Misc. Functions @@ -179,6 +177,6 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENABLE_PIN 5 // D5 Pin should have a pullup! -#define SPINDLE_LASER_PWM_PIN 0 // D0 PWM0B MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 7 // D7 +#define SPINDLE_LASER_ENABLE_PIN 5 // D5 Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 0 // D0 PWM0B MUST BE HARDWARE PWM +#define SPINDLE_DIR_PIN 7 // D7 diff --git a/Marlin/pins_TEENSYLU.h b/Marlin/pins_TEENSYLU.h index e733b98..f85eee0 100644 --- a/Marlin/pins_TEENSYLU.h +++ b/Marlin/pins_TEENSYLU.h @@ -79,6 +79,7 @@ #define BOARD_NAME "Teensylu" + // // Limit Switch definitions that match the SCHEMATIC // @@ -127,9 +128,7 @@ #define HEATER_0_PIN 15 // C5 PWM3B - Extruder #define HEATER_BED_PIN 14 // C4 PWM3C -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif +#define FAN_PIN 16 // C6 PWM3A // // Misc. Functions diff --git a/Marlin/pins_TRIGORILLA.h b/Marlin/pins_TRIGORILLA.h new file mode 100644 index 0000000..a87514d --- /dev/null +++ b/Marlin/pins_TRIGORILLA.h @@ -0,0 +1,207 @@ +//ANYCUBIC TRIGORILLA MAINBOARD +#ifndef __AVR_ATmega2560__ + #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." +#endif + +#define BOARD_NAME "TRIGORILLA" +#define LARGE_FLASH true + +// Misc PINs +#define BUZZER 31 +#define SDPOWER -1 +#define SDSS 53 +#define LED_PIN 13 +#define Z_MIN_PROBE_PIN 2 +#define FIL_RUNOUT_PIN 19 + +#ifdef OutageTest + #define OUTAGETEST_PIN 79 + #define OUTAGECON_PIN 58 +#endif + +// Steppers +#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 Y2_STEP_PIN 36 +#define Y2_DIR_PIN 34 +#define Y2_ENABLE_PIN 30 + +#define Z_STEP_PIN 46 +#define Z_DIR_PIN 48 +#define Z_ENABLE_PIN 62 + +#define Z2_STEP_PIN 36 +#define Z2_DIR_PIN 34 +#define Z2_ENABLE_PIN 30 + +#define E0_STEP_PIN 26 +#define E0_DIR_PIN 28 +#define E0_ENABLE_PIN 24 + +// EndStops +#define X_MIN_PIN 3 +#define Y_MIN_PIN 42 +#define Z_MIN_PIN 18 + +#define X_MAX_PIN 43 +#define Y_MAX_PIN -1 +#define Z_MAX_PIN -1 + +// Fans +#define FAN_PIN 9 +#define FAN2_PIN 44 +#define CONTROLLER_FAN_PIN 7 + +// Heaters +#define HEATER_0_PIN 10 +#define HEATER_1_PIN 45 +#define HEATER_BED_PIN 8 + +// Temperatursensoren +#define TEMP_0_PIN 13 +#define TEMP_1_PIN 15 +#define TEMP_2_PIN 12 +#define TEMP_BED_PIN 14 + +// Servos +#ifdef NUM_SERVOS + #define SERVO0_PIN 11 + + #if NUM_SERVOS > 1 + #define SERVO1_PIN 6 + #endif + + #if NUM_SERVOS > 2 + #define SERVO2_PIN 5 + #endif + + #if NUM_SERVOS > 3 + #define SERVO3_PIN 4 + #endif +#endif + +#if defined(ANYCUBIC_TFT_MODEL) + #define BEEPER_PIN 31 + #define SD_DETECT_PIN 49 +#endif + +// LCD +#if defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL) || defined(ANYCUBIC_TFT_MODEL) + #define KILL_PIN 41 +#else + #define KILL_PIN -1 +#endif + +#ifdef ULTRA_LCD + #ifdef NEWPANEL + #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 + + #ifdef REPRAP_DISCOUNT_SMART_CONTROLLER + #define BEEPER_PIN 31 + + #define BTN_EN1 33 + #define BTN_EN2 33 + #define BTN_ENC 35 + + #define SD_DETECT_PIN 49 + #elif defined(LCD_I2C_PANELOLU2) + #define BTN_EN1 47 //reverse if the encoder turns the wrong way. + #define BTN_EN2 43 + #define BTN_ENC 32 + #define SDSS 53 + #define SD_DETECT_PIN -1 + #define KILL_PIN 41 + #elif defined(LCD_I2C_VIKI) + #define BTN_EN1 22 //reverse if the encoder turns the wrong way. + #define BTN_EN2 7 + #define BTN_ENC -1 + #define SDSS 53 + #define SD_DETECT_PIN 49 + #elif defined(FULL_GRAPHIC_SMALL_PANEL) + #define BEEPER_PIN 37 + + // Pins for DOGM SPI LCD Support + #define DOGLCD_A0 23 + #define DOGLCD_CS 27 + #define LCD_PIN_BL 25 // backlight LED on PA3 + + #define KILL_PIN 41 + // GLCD features + //#define LCD_CONTRAST 190 + // Uncomment screen orientation + // #define LCD_SCREEN_ROT_90 + // #define LCD_SCREEN_ROT_180 + // #define LCD_SCREEN_ROT_270 + //The encoder and click button + #define BTN_EN1 33 + #define BTN_EN2 -1 + #define BTN_ENC 35 //the click switch + //not connected to a pin + #define SD_DETECT_PIN 49 + #elif defined(MULTIPANEL) + // #define BEEPER_PIN 37 + // Pins for DOGM SPI LCD Support + #define DOGLCD_A0 17 + #define DOGLCD_CS 16 + #define LCD_PIN_BL 23 // backlight LED on A11/D65 + #define SDSS 53 + + #define KILL_PIN 64 + // GLCD features + //#define LCD_CONTRAST 190 + // Uncomment screen orientation + // #define LCD_SCREEN_ROT_90 + // #define LCD_SCREEN_ROT_180 + // #define LCD_SCREEN_ROT_270 + //The encoder and click button + #define BTN_EN1 -1 + #define BTN_EN2 33 + #define BTN_ENC 35 //the click switch + //not connected to a pin + #define SD_DETECT_PIN 49 + #else + //arduino pin which triggers an piezzo beeper + #define BEEPER_PIN 31 // Beeper on AUX-4 + + //buttons are directly attached using AUX-2 + #ifdef REPRAPWORLD_KEYPAD + #define BTN_EN1 64 // encoder + #define BTN_EN2 59 // encoder + #define BTN_ENC 63 // enter button + #define SHIFT_OUT 40 // shift register + #define SHIFT_CLK 44 // shift register + #define SHIFT_LD 42 // shift register + #else + #define BTN_EN1 37 + #define BTN_EN2 35 + #define BTN_ENC -1 //the click + #endif + + #ifdef G3D_PANEL + #define SD_DETECT_PIN 49 + #else + #define SD_DETECT_PIN -1 // Ramps does not use this port + #endif + + #endif + + #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 +#endif \ No newline at end of file diff --git a/Marlin/pins_ULTIMAIN_2.h b/Marlin/pins_ULTIMAIN_2.h index ea7a832..4ac26c6 100644 --- a/Marlin/pins_ULTIMAIN_2.h +++ b/Marlin/pins_ULTIMAIN_2.h @@ -93,9 +93,7 @@ #define HEATER_1_PIN 3 #define HEATER_BED_PIN 4 -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif +#define FAN_PIN 7 // // Misc. Functions @@ -103,8 +101,8 @@ #define SDSS 53 #define SD_DETECT_PIN 39 #define LED_PIN 8 -#define SAFETY_TRIGGERED_PIN 28 // PIN to detect the safety circuit has triggered -#define MAIN_VOLTAGE_MEASURE_PIN 14 // ANALOG PIN to measure the main voltage, with a 100k - 4k7 resitor divider. +#define SAFETY_TRIGGERED_PIN 28 // PIN to detect the safety circuit has triggered +#define MAIN_VOLTAGE_MEASURE_PIN 14 // ANALOG PIN to measure the main voltage, with a 100k - 4k7 resitor divider. // // LCD / Controller @@ -129,8 +127,8 @@ #if ENABLED(SPINDLE_LASER_ENABLE) // use the LED_PIN for spindle speed control or case light #undef LED_PIN #define SPINDLE_DIR_PIN 16 - #define SPINDLE_LASER_ENABLE_PIN 17 // Pin should have a pullup! - #define SPINDLE_LASER_PWM_PIN 8 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENABLE_PIN 17 // Pin should have a pullup! + #define SPINDLE_LASER_PWM_PIN 8 // MUST BE HARDWARE PWM #else #undef LED_PIN #define CASE_LIGHT_PIN 8 diff --git a/Marlin/pins_ULTIMAKER.h b/Marlin/pins_ULTIMAKER.h index 23941a1..4549bf7 100644 --- a/Marlin/pins_ULTIMAKER.h +++ b/Marlin/pins_ULTIMAKER.h @@ -43,7 +43,7 @@ // // Servos // -#define SERVO0_PIN 11 +#define SERVO0_PIN 13 // untested // // Limit Switches @@ -99,9 +99,7 @@ #define HEATER_1_PIN 3 #define HEATER_BED_PIN 4 -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif +#define FAN_PIN 7 // // Misc. Functions @@ -159,6 +157,6 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_PWM_PIN 9 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 11 // use the EXP3 PWM header +#define SPINDLE_LASER_PWM_PIN 9 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup! +#define SPINDLE_DIR_PIN 11 // use the EXP3 PWM header diff --git a/Marlin/pins_ULTIMAKER_OLD.h b/Marlin/pins_ULTIMAKER_OLD.h index c07f2d0..e04907d 100644 --- a/Marlin/pins_ULTIMAKER_OLD.h +++ b/Marlin/pins_ULTIMAKER_OLD.h @@ -72,21 +72,21 @@ // Limit Switches // #if ENABLED(board_rev_1_1_TO_1_3) - #define X_MIN_PIN 15 // SW1 - #define X_MAX_PIN 14 // SW2 - #define Y_MIN_PIN 17 // SW3 - #define Y_MAX_PIN 16 // SW4 - #define Z_MIN_PIN 19 // SW5 - #define Z_MAX_PIN 18 // SW6 + #define X_MIN_PIN 15 // SW1 + #define X_MAX_PIN 14 // SW2 + #define Y_MIN_PIN 17 // SW3 + #define Y_MAX_PIN 16 // SW4 + #define Z_MIN_PIN 19 // SW5 + #define Z_MAX_PIN 18 // SW6 #endif #if ENABLED(board_rev_1_0) - #define X_MIN_PIN 13 // SW1 - #define X_MAX_PIN 12 // SW2 - #define Y_MIN_PIN 11 // SW3 - #define Y_MAX_PIN 10 // SW4 - #define Z_MIN_PIN 9 // SW5 - #define Z_MAX_PIN 8 // SW6 + #define X_MIN_PIN 13 // SW1 + #define X_MAX_PIN 12 // SW2 + #define Y_MIN_PIN 11 // SW3 + #define Y_MAX_PIN 10 // SW4 + #define Z_MIN_PIN 9 // SW5 + #define Z_MAX_PIN 8 // SW6 #endif #if ENABLED(board_rev_1_5) @@ -124,9 +124,9 @@ #define E0_DIR_PIN 45 #define E0_ENABLE_PIN 41 -#define E1_STEP_PIN -1 // 49 -#define E1_DIR_PIN -1 // 47 -#define E1_ENABLE_PIN -1 // 48 +#define E1_STEP_PIN -1 // 49 +#define E1_DIR_PIN -1 // 47 +#define E1_ENABLE_PIN -1 // 48 // // Temperature Sensors @@ -138,7 +138,7 @@ // Heaters / Fans // #define HEATER_0_PIN 2 -//#define HEATER_1_PIN 3 // used for case light Rev A said "1" +//#define HEATER_1_PIN 3 // used for case light Rev A said "1" #define HEATER_BED_PIN 4 // @@ -196,7 +196,7 @@ // case light - see spindle section for more info on available hardware PWMs // #if !PIN_EXISTS(CASE_LIGHT) && ENABLED(board_rev_1_5) - #define CASE_LIGHT_PIN 7 // use PWM - MUST BE HARDWARE PWM + #define CASE_LIGHT_PIN 7 // use PWM - MUST BE HARDWARE PWM #endif // @@ -214,19 +214,19 @@ #undef Z_MIN_PIN // SW5 #undef Z_MAX_PIN // SW6 - #define X_STOP_PIN 13 // SW1 (didn't change) - also has a useable hardware PWM - #define Y_STOP_PIN 12 // SW2 - #define Z_STOP_PIN 11 // SW3 + #define X_STOP_PIN 13 // SW1 (didn't change) - also has a useable hardware PWM + #define Y_STOP_PIN 12 // SW2 + #define Z_STOP_PIN 11 // SW3 - #define SPINDLE_DIR_PIN 10 // SW4 - #define SPINDLE_LASER_PWM_PIN 9 // SW5 MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 8 // SW6 Pin should have a pullup! + #define SPINDLE_DIR_PIN 10 // SW4 + #define SPINDLE_LASER_PWM_PIN 9 // SW5 MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENABLE_PIN 8 // SW6 Pin should have a pullup! #elif ENABLED(board_rev_1_5) // use the same pins - but now they are on a different connector - #define SPINDLE_DIR_PIN 10 // EXP3-6 (silkscreen says 10) - #define SPINDLE_LASER_PWM_PIN 9 // EXP3-7 (silkscreen says 9) MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 8 // EXP3-8 (silkscreen says 8) Pin should have a pullup! + #define SPINDLE_DIR_PIN 10 // EXP3-6 (silkscreen says 10) + #define SPINDLE_LASER_PWM_PIN 9 // EXP3-7 (silkscreen says 9) MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENABLE_PIN 8 // EXP3-8 (silkscreen says 8) Pin should have a pullup! #elif ENABLED(board_rev_1_1_TO_1_3) @@ -249,14 +249,14 @@ #define E0_DIR_PIN 47 #define E0_ENABLE_PIN 48 #define SPINDLE_DIR_PIN 43 - #define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 41 // Pin should have a pullup! + #define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENABLE_PIN 41 // Pin should have a pullup! #elif TEMP_SENSOR_BED == 0 // Can't use E0 so see if HEATER_BED_PIN is available #undef HEATER_BED_PIN - #define SPINDLE_DIR_PIN 38 // Probably pin 4 on 10 pin connector closest to the E0 socket - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM - Special precautions usually needed. - #define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup! (Probably pin 6 on the 10-pin - // connector closest to the E0 socket) + #define SPINDLE_DIR_PIN 38 // Probably pin 4 on 10 pin connector closest to the E0 socket + #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM - Special precautions usually needed. + #define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup! (Probably pin 6 on the 10-pin + // connector closest to the E0 socket) #endif #endif #endif diff --git a/Marlin/pins_ZRIB_V20.h b/Marlin/pins_ZRIB_V20.h index 94a083d..1437c71 100644 --- a/Marlin/pins_ZRIB_V20.h +++ b/Marlin/pins_ZRIB_V20.h @@ -36,4 +36,4 @@ #define FILWIDTH_PIN 11 // Analog Input #endif -#include "pins_MKS_GEN_13.h" +#include "pins_MKS_13.h" diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index e21c501..f83cbd4 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -56,35 +56,23 @@ * * IntersectionDistance[s1_, s2_, a_, d_] := (2 a d - s1^2 + s2^2)/(4 a) * - * -- - * - * The fast inverse function needed for Bézier interpolation for AVR - * was designed, written and tested by Eduardo José Tagle on April/2018 */ +#include "MarlinConfig.h" #include "planner.h" #include "stepper.h" #include "temperature.h" #include "ultralcd.h" #include "language.h" -#include "parser.h" +#include "ubl.h" +#include "gcode.h" #include "Marlin.h" #if ENABLED(MESH_BED_LEVELING) #include "mesh_bed_leveling.h" -#elif ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" #endif -#if ENABLED(AUTO_POWER_CONTROL) - #include "power.h" -#endif - -// Delay for delivery of first block to the stepper ISR, if the queue contains 2 or -// fewer movements. The delay is measured in milliseconds, and must be less than 250ms -#define BLOCK_DELAY_FOR_1ST_MOVE 100 - Planner planner; // public: @@ -93,67 +81,40 @@ Planner planner; * A ring buffer of moves described in steps */ block_t Planner::block_buffer[BLOCK_BUFFER_SIZE]; -volatile uint8_t Planner::block_buffer_head, // Index of the next block to be pushed - Planner::block_buffer_nonbusy, // Index of the first non-busy block - Planner::block_buffer_planned, // Index of the optimally planned block - Planner::block_buffer_tail; // Index of the busy block, if any -uint16_t Planner::cleaning_buffer_counter; // A counter to disable queuing of blocks -uint8_t Planner::delay_before_delivering; // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks +volatile uint8_t Planner::block_buffer_head = 0, // Index of the next block to be pushed + Planner::block_buffer_tail = 0; -uint32_t Planner::max_acceleration_mm_per_s2[NUM_AXIS_N], // (mm/s^2) M201 XYZE - Planner::max_acceleration_steps_per_s2[NUM_AXIS_N], // (steps/s^2) Derived from mm_per_s2 - Planner::min_segment_time_us; // (µs) M205 Q - -float Planner::max_feedrate_mm_s[NUM_AXIS_N], // (mm/s) M203 XYZE - Max speeds - Planner::axis_steps_per_mm[NUM_AXIS_N], // (steps) M92 XYZE - Steps per millimeter - Planner::steps_to_mm[NUM_AXIS_N], // (mm) Millimeters per step - Planner::min_feedrate_mm_s, // (mm/s) M205 S - Minimum linear feedrate - Planner::acceleration, // (mm/s^2) M204 S - Normal acceleration. DEFAULT ACCELERATION for all printing moves. - Planner::retract_acceleration, // (mm/s^2) M204 R - Retract acceleration. Filament pull-back and push-forward while standing still in the other axes - Planner::travel_acceleration, // (mm/s^2) M204 T - Travel acceleration. DEFAULT ACCELERATION for all NON printing moves. - Planner::min_travel_feedrate_mm_s; // (mm/s) M205 T - Minimum travel feedrate - -#if ENABLED(JUNCTION_DEVIATION) - float Planner::junction_deviation_mm; // (mm) M205 J - #if ENABLED(LIN_ADVANCE) - #if ENABLED(DISTINCT_E_FACTORS) - float Planner::max_e_jerk[EXTRUDERS]; // Calculated from junction_deviation_mm - #else - float Planner::max_e_jerk; - #endif - #endif -#else - float Planner::max_jerk[NUM_AXIS]; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. -#endif - -#if ENABLED(LINE_BUILDUP_COMPENSATION_FEATURE) - float Planner::k0[MOV_AXIS], - Planner::k1[MOV_AXIS], - Planner::k2[MOV_AXIS], - Planner::sqrtk1[MOV_AXIS]; -#endif - -#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - bool Planner::abort_on_endstop_hit = false; -#endif +float Planner::max_feedrate_mm_s[XYZE_N], // Max speeds in mm per second + Planner::axis_steps_per_mm[XYZE_N], + Planner::steps_to_mm[XYZE_N]; #if ENABLED(DISTINCT_E_FACTORS) uint8_t Planner::last_extruder = 0; // Respond to extruder change - #define _EINDEX (E_AXIS + active_extruder) -#else - #define _EINDEX E_AXIS #endif int16_t Planner::flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); // Extrusion factor for each extruder -float Planner::e_factor[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0f); // The flow percentage and volumetric multiplier combine to scale E movement +float Planner::e_factor[EXTRUDERS]; // The flow percentage and volumetric multiplier combine to scale E movement #if DISABLED(NO_VOLUMETRICS) float Planner::filament_size[EXTRUDERS], // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder - Planner::volumetric_area_nominal = CIRCLE_AREA(float(DEFAULT_NOMINAL_FILAMENT_DIA) * 0.5f), // Nominal cross-sectional area + Planner::volumetric_area_nominal = CIRCLE_AREA((DEFAULT_NOMINAL_FILAMENT_DIA) * 0.5), // Nominal cross-sectional area Planner::volumetric_multiplier[EXTRUDERS]; // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner #endif +uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N], + Planner::max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override by software + +uint32_t Planner::min_segment_time_us; + +// Initialized by settings.load() +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_jerk[XYZE], // The largest speed change requiring no acceleration + Planner::min_travel_feedrate_mm_s; + #if HAS_LEVELING bool Planner::leveling_active = false; // Flag that auto bed leveling is enabled #if ABL_PLANAR @@ -184,7 +145,7 @@ float Planner::e_factor[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0f); // The flow perc #if ENABLED(AUTOTEMP) float Planner::autotemp_max = 250, Planner::autotemp_min = 210, - Planner::autotemp_factor = 0.1f; + Planner::autotemp_factor = 0.1; bool Planner::autotemp_enabled = false; #endif @@ -195,7 +156,7 @@ int32_t Planner::position[NUM_AXIS] = { 0 }; uint32_t Planner::cutoff_long; float Planner::previous_speed[NUM_AXIS], - Planner::previous_nominal_speed_sqr; + Planner::previous_nominal_speed; #if ENABLED(DISABLE_INACTIVE_EXTRUDER) uint8_t Planner::g_uc_extruder_last_move[EXTRUDERS] = { 0 }; @@ -209,11 +170,11 @@ float Planner::previous_speed[NUM_AXIS], #endif #if ENABLED(LIN_ADVANCE) - float Planner::extruder_advance_K; // Initialized by settings.load() -#endif - -#if HAS_POSITION_FLOAT - float Planner::position_float[NUM_AXIS]; // Needed for accurate maths. Steps cannot be used! + float Planner::extruder_advance_k, // Initialized by settings.load() + Planner::advance_ed_ratio, // Initialized by settings.load() + Planner::position_float[XYZE], // Needed for accurate maths. Steps cannot be used! + Planner::lin_dist_xy, + Planner::lin_dist_e; #endif #if ENABLED(ULTRA_LCD) @@ -227,650 +188,87 @@ float Planner::previous_speed[NUM_AXIS], Planner::Planner() { init(); } void Planner::init() { + block_buffer_head = block_buffer_tail = 0; ZERO(position); - #if HAS_POSITION_FLOAT + #if ENABLED(LIN_ADVANCE) ZERO(position_float); #endif ZERO(previous_speed); - previous_nominal_speed_sqr = 0; + previous_nominal_speed = 0.0; #if ABL_PLANAR bed_level_matrix.set_to_identity(); #endif - clear_block_buffer(); - delay_before_delivering = 0; } -#if ENABLED(S_CURVE_ACCELERATION) - - /** - * This routine returns 0x1000000 / d, getting the inverse as fast as possible. - * A fast-converging iterative Newton-Raphson method can reach full precision in - * just 1 iteration, and takes 211 cycles (worst case; the mean case is less, up - * to 30 cycles for small divisors), instead of the 500 cycles a normal division - * would take. - * - * Inspired by the following page: - * https://stackoverflow.com/questions/27801397/newton-raphson-division-with-big-integers - * - * Suppose we want to calculate floor(2 ^ k / B) where B is a positive integer - * Then, B must be <= 2^k, otherwise, the quotient is 0. - * - * The Newton - Raphson iteration for x = B / 2 ^ k yields: - * q[n + 1] = q[n] * (2 - q[n] * B / 2 ^ k) - * - * This can be rearranged to: - * q[n + 1] = q[n] * (2 ^ (k + 1) - q[n] * B) >> k - * - * Each iteration requires only integer multiplications and bit shifts. - * It doesn't necessarily converge to floor(2 ^ k / B) but in the worst case - * it eventually alternates between floor(2 ^ k / B) and ceil(2 ^ k / B). - * So it checks for this case and extracts floor(2 ^ k / B). - * - * A simple but important optimization for this approach is to truncate - * multiplications (i.e., calculate only the higher bits of the product) in the - * early iterations of the Newton - Raphson method. This is done so the results - * of the early iterations are far from the quotient. Then it doesn't matter if - * they are done inaccurately. - * It's important to pick a good starting value for x. Knowing how many - * digits the divisor has, it can be estimated: - * - * 2^k / x = 2 ^ log2(2^k / x) - * 2^k / x = 2 ^(log2(2^k)-log2(x)) - * 2^k / x = 2 ^(k*log2(2)-log2(x)) - * 2^k / x = 2 ^ (k-log2(x)) - * 2^k / x >= 2 ^ (k-floor(log2(x))) - * floor(log2(x)) is simply the index of the most significant bit set. - * - * If this estimation can be improved even further the number of iterations can be - * reduced a lot, saving valuable execution time. - * The paper "Software Integer Division" by Thomas L.Rodeheffer, Microsoft - * Research, Silicon Valley,August 26, 2008, available at - * https://www.microsoft.com/en-us/research/wp-content/uploads/2008/08/tr-2008-141.pdf - * suggests, for its integer division algorithm, using a table to supply the first - * 8 bits of precision, then, due to the quadratic convergence nature of the - * Newton-Raphon iteration, just 2 iterations should be enough to get maximum - * precision of the division. - * By precomputing values of inverses for small denominator values, just one - * Newton-Raphson iteration is enough to reach full precision. - * This code uses the top 9 bits of the denominator as index. - * - * The AVR assembly function implements this C code using the data below: - * - * // For small divisors, it is best to directly retrieve the results - * if (d <= 110) return pgm_read_dword(&small_inv_tab[d]); - * - * // Compute initial estimation of 0x1000000/x - - * // Get most significant bit set on divider - * uint8_t idx = 0; - * uint32_t nr = d; - * if (!(nr & 0xFF0000)) { - * nr <<= 8; idx += 8; - * if (!(nr & 0xFF0000)) { nr <<= 8; idx += 8; } - * } - * if (!(nr & 0xF00000)) { nr <<= 4; idx += 4; } - * if (!(nr & 0xC00000)) { nr <<= 2; idx += 2; } - * if (!(nr & 0x800000)) { nr <<= 1; idx += 1; } - * - * // Isolate top 9 bits of the denominator, to be used as index into the initial estimation table - * uint32_t tidx = nr >> 15, // top 9 bits. bit8 is always set - * ie = inv_tab[tidx & 0xFF] + 256, // Get the table value. bit9 is always set - * x = idx <= 8 ? (ie >> (8 - idx)) : (ie << (idx - 8)); // Position the estimation at the proper place - * - * x = uint32_t((x * uint64_t(_BV(25) - x * d)) >> 24); // Refine estimation by newton-raphson. 1 iteration is enough - * const uint32_t r = _BV(24) - x * d; // Estimate remainder - * if (r >= d) x++; // Check whether to adjust result - * return uint32_t(x); // x holds the proper estimation - * - */ - static uint32_t get_period_inverse(uint32_t d) { - - static const uint8_t inv_tab[256] PROGMEM = { - 255,253,252,250,248,246,244,242,240,238,236,234,233,231,229,227, - 225,224,222,220,218,217,215,213,212,210,208,207,205,203,202,200, - 199,197,195,194,192,191,189,188,186,185,183,182,180,179,178,176, - 175,173,172,170,169,168,166,165,164,162,161,160,158,157,156,154, - 153,152,151,149,148,147,146,144,143,142,141,139,138,137,136,135, - 134,132,131,130,129,128,127,126,125,123,122,121,120,119,118,117, - 116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101, - 100,99,98,97,96,95,94,93,92,91,90,89,88,88,87,86, - 85,84,83,82,81,80,80,79,78,77,76,75,74,74,73,72, - 71,70,70,69,68,67,66,66,65,64,63,62,62,61,60,59, - 59,58,57,56,56,55,54,53,53,52,51,50,50,49,48,48, - 47,46,46,45,44,43,43,42,41,41,40,39,39,38,37,37, - 36,35,35,34,33,33,32,32,31,30,30,29,28,28,27,27, - 26,25,25,24,24,23,22,22,21,21,20,19,19,18,18,17, - 17,16,15,15,14,14,13,13,12,12,11,10,10,9,9,8, - 8,7,7,6,6,5,5,4,4,3,3,2,2,1,0,0 - }; - - // For small denominators, it is cheaper to directly store the result. - // For bigger ones, just ONE Newton-Raphson iteration is enough to get - // maximum precision we need - static const uint32_t small_inv_tab[111] PROGMEM = { - 16777216,16777216,8388608,5592405,4194304,3355443,2796202,2396745,2097152,1864135,1677721,1525201,1398101,1290555,1198372,1118481, - 1048576,986895,932067,883011,838860,798915,762600,729444,699050,671088,645277,621378,599186,578524,559240,541200, - 524288,508400,493447,479349,466033,453438,441505,430185,419430,409200,399457,390167,381300,372827,364722,356962, - 349525,342392,335544,328965,322638,316551,310689,305040,299593,294337,289262,284359,279620,275036,270600,266305, - 262144,258111,254200,250406,246723,243148,239674,236298,233016,229824,226719,223696,220752,217885,215092,212369, - 209715,207126,204600,202135,199728,197379,195083,192841,190650,188508,186413,184365,182361,180400,178481,176602, - 174762,172960,171196,169466,167772,166111,164482,162885,161319,159783,158275,156796,155344,153919,152520 - }; - - // For small divisors, it is best to directly retrieve the results - if (d <= 110) return pgm_read_dword(&small_inv_tab[d]); - - register uint8_t r8 = d & 0xFF, - r9 = (d >> 8) & 0xFF, - r10 = (d >> 16) & 0xFF, - r2,r3,r4,r5,r6,r7,r11,r12,r13,r14,r15,r16,r17,r18; - register const uint8_t* ptab = inv_tab; - - __asm__ __volatile__( - // %8:%7:%6 = interval - // r31:r30: MUST be those registers, and they must point to the inv_tab - - A("clr %13") // %13 = 0 - - // Now we must compute - // result = 0xFFFFFF / d - // %8:%7:%6 = interval - // %16:%15:%14 = nr - // %13 = 0 - - // A plain division of 24x24 bits should take 388 cycles to complete. We will - // use Newton-Raphson for the calculation, and will strive to get way less cycles - // for the same result - Using C division, it takes 500cycles to complete . - - A("clr %3") // idx = 0 - A("mov %14,%6") - A("mov %15,%7") - A("mov %16,%8") // nr = interval - A("tst %16") // nr & 0xFF0000 == 0 ? - A("brne 2f") // No, skip this - A("mov %16,%15") - A("mov %15,%14") // nr <<= 8, %14 not needed - A("subi %3,-8") // idx += 8 - A("tst %16") // nr & 0xFF0000 == 0 ? - A("brne 2f") // No, skip this - A("mov %16,%15") // nr <<= 8, %14 not needed - A("clr %15") // We clear %14 - A("subi %3,-8") // idx += 8 - - // here %16 != 0 and %16:%15 contains at least 9 MSBits, or both %16:%15 are 0 - L("2") - A("cpi %16,0x10") // (nr & 0xF00000) == 0 ? - A("brcc 3f") // No, skip this - A("swap %15") // Swap nibbles - A("swap %16") // Swap nibbles. Low nibble is 0 - A("mov %14, %15") - A("andi %14,0x0F") // Isolate low nibble - A("andi %15,0xF0") // Keep proper nibble in %15 - A("or %16, %14") // %16:%15 <<= 4 - A("subi %3,-4") // idx += 4 - - L("3") - A("cpi %16,0x40") // (nr & 0xC00000) == 0 ? - A("brcc 4f") // No, skip this - A("add %15,%15") - A("adc %16,%16") - A("add %15,%15") - A("adc %16,%16") // %16:%15 <<= 2 - A("subi %3,-2") // idx += 2 - - L("4") - A("cpi %16,0x80") // (nr & 0x800000) == 0 ? - A("brcc 5f") // No, skip this - A("add %15,%15") - A("adc %16,%16") // %16:%15 <<= 1 - A("inc %3") // idx += 1 - - // Now %16:%15 contains its MSBit set to 1, or %16:%15 is == 0. We are now absolutely sure - // we have at least 9 MSBits available to enter the initial estimation table - L("5") - A("add %15,%15") - A("adc %16,%16") // %16:%15 = tidx = (nr <<= 1), we lose the top MSBit (always set to 1, %16 is the index into the inverse table) - A("add r30,%16") // Only use top 8 bits - A("adc r31,%13") // r31:r30 = inv_tab + (tidx) - A("lpm %14, Z") // %14 = inv_tab[tidx] - A("ldi %15, 1") // %15 = 1 %15:%14 = inv_tab[tidx] + 256 - - // We must scale the approximation to the proper place - A("clr %16") // %16 will always be 0 here - A("subi %3,8") // idx == 8 ? - A("breq 6f") // yes, no need to scale - A("brcs 7f") // If C=1, means idx < 8, result was negative! - - // idx > 8, now %3 = idx - 8. We must perform a left shift. idx range:[1-8] - A("sbrs %3,0") // shift by 1bit position? - A("rjmp 8f") // No - A("add %14,%14") - A("adc %15,%15") // %15:16 <<= 1 - L("8") - A("sbrs %3,1") // shift by 2bit position? - A("rjmp 9f") // No - A("add %14,%14") - A("adc %15,%15") - A("add %14,%14") - A("adc %15,%15") // %15:16 <<= 1 - L("9") - A("sbrs %3,2") // shift by 4bits position? - A("rjmp 16f") // No - A("swap %15") // Swap nibbles. lo nibble of %15 will always be 0 - A("swap %14") // Swap nibbles - A("mov %12,%14") - A("andi %12,0x0F") // isolate low nibble - A("andi %14,0xF0") // and clear it - A("or %15,%12") // %15:%16 <<= 4 - L("16") - A("sbrs %3,3") // shift by 8bits position? - A("rjmp 6f") // No, we are done - A("mov %16,%15") - A("mov %15,%14") - A("clr %14") - A("jmp 6f") - - // idx < 8, now %3 = idx - 8. Get the count of bits - L("7") - A("neg %3") // %3 = -idx = count of bits to move right. idx range:[1...8] - A("sbrs %3,0") // shift by 1 bit position ? - A("rjmp 10f") // No, skip it - A("asr %15") // (bit7 is always 0 here) - A("ror %14") - L("10") - A("sbrs %3,1") // shift by 2 bit position ? - A("rjmp 11f") // No, skip it - A("asr %15") // (bit7 is always 0 here) - A("ror %14") - A("asr %15") // (bit7 is always 0 here) - A("ror %14") - L("11") - A("sbrs %3,2") // shift by 4 bit position ? - A("rjmp 12f") // No, skip it - A("swap %15") // Swap nibbles - A("andi %14, 0xF0") // Lose the lowest nibble - A("swap %14") // Swap nibbles. Upper nibble is 0 - A("or %14,%15") // Pass nibble from upper byte - A("andi %15, 0x0F") // And get rid of that nibble - L("12") - A("sbrs %3,3") // shift by 8 bit position ? - A("rjmp 6f") // No, skip it - A("mov %14,%15") - A("clr %15") - L("6") // %16:%15:%14 = initial estimation of 0x1000000 / d - - // Now, we must refine the estimation present on %16:%15:%14 using 1 iteration - // of Newton-Raphson. As it has a quadratic convergence, 1 iteration is enough - // to get more than 18bits of precision (the initial table lookup gives 9 bits of - // precision to start from). 18bits of precision is all what is needed here for result - - // %8:%7:%6 = d = interval - // %16:%15:%14 = x = initial estimation of 0x1000000 / d - // %13 = 0 - // %3:%2:%1:%0 = working accumulator - - // Compute 1<<25 - x*d. Result should never exceed 25 bits and should always be positive - A("clr %0") - A("clr %1") - A("clr %2") - A("ldi %3,2") // %3:%2:%1:%0 = 0x2000000 - A("mul %6,%14") // r1:r0 = LO(d) * LO(x) - A("sub %0,r0") - A("sbc %1,r1") - A("sbc %2,%13") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * LO(x) - A("mul %7,%14") // r1:r0 = MI(d) * LO(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= MI(d) * LO(x) << 8 - A("mul %8,%14") // r1:r0 = HI(d) * LO(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16 - A("mul %6,%15") // r1:r0 = LO(d) * MI(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * MI(x) << 8 - A("mul %7,%15") // r1:r0 = MI(d) * MI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MI(d) * MI(x) << 16 - A("mul %8,%15") // r1:r0 = HI(d) * MI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24 - A("mul %6,%16") // r1:r0 = LO(d) * HI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= LO(d) * HI(x) << 16 - A("mul %7,%16") // r1:r0 = MI(d) * HI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MI(d) * HI(x) << 24 - // %3:%2:%1:%0 = (1<<25) - x*d [169] - - // We need to multiply that result by x, and we are only interested in the top 24bits of that multiply - - // %16:%15:%14 = x = initial estimation of 0x1000000 / d - // %3:%2:%1:%0 = (1<<25) - x*d = acc - // %13 = 0 - - // result = %11:%10:%9:%5:%4 - A("mul %14,%0") // r1:r0 = LO(x) * LO(acc) - A("mov %4,r1") - A("clr %5") - A("clr %9") - A("clr %10") - A("clr %11") // %11:%10:%9:%5:%4 = LO(x) * LO(acc) >> 8 - A("mul %15,%0") // r1:r0 = MI(x) * LO(acc) - A("add %4,r0") - A("adc %5,r1") - A("adc %9,%13") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * LO(acc) - A("mul %16,%0") // r1:r0 = HI(x) * LO(acc) - A("add %5,r0") - A("adc %9,r1") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * LO(acc) << 8 - - A("mul %14,%1") // r1:r0 = LO(x) * MIL(acc) - A("add %4,r0") - A("adc %5,r1") - A("adc %9,%13") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * MIL(acc) - A("mul %15,%1") // r1:r0 = MI(x) * MIL(acc) - A("add %5,r0") - A("adc %9,r1") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 8 - A("mul %16,%1") // r1:r0 = HI(x) * MIL(acc) - A("add %9,r0") - A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 16 - - A("mul %14,%2") // r1:r0 = LO(x) * MIH(acc) - A("add %5,r0") - A("adc %9,r1") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * MIH(acc) << 8 - A("mul %15,%2") // r1:r0 = MI(x) * MIH(acc) - A("add %9,r0") - A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 16 - A("mul %16,%2") // r1:r0 = HI(x) * MIH(acc) - A("add %10,r0") - A("adc %11,r1") // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 24 - - A("mul %14,%3") // r1:r0 = LO(x) * HI(acc) - A("add %9,r0") - A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * HI(acc) << 16 - A("mul %15,%3") // r1:r0 = MI(x) * HI(acc) - A("add %10,r0") - A("adc %11,r1") // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 24 - A("mul %16,%3") // r1:r0 = HI(x) * HI(acc) - A("add %11,r0") // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 32 - - // At this point, %11:%10:%9 contains the new estimation of x. - - // Finally, we must correct the result. Estimate remainder as - // (1<<24) - x*d - // %11:%10:%9 = x - // %8:%7:%6 = d = interval" "\n\t" - A("ldi %3,1") - A("clr %2") - A("clr %1") - A("clr %0") // %3:%2:%1:%0 = 0x1000000 - A("mul %6,%9") // r1:r0 = LO(d) * LO(x) - A("sub %0,r0") - A("sbc %1,r1") - A("sbc %2,%13") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * LO(x) - A("mul %7,%9") // r1:r0 = MI(d) * LO(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= MI(d) * LO(x) << 8 - A("mul %8,%9") // r1:r0 = HI(d) * LO(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16 - A("mul %6,%10") // r1:r0 = LO(d) * MI(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * MI(x) << 8 - A("mul %7,%10") // r1:r0 = MI(d) * MI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MI(d) * MI(x) << 16 - A("mul %8,%10") // r1:r0 = HI(d) * MI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24 - A("mul %6,%11") // r1:r0 = LO(d) * HI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= LO(d) * HI(x) << 16 - A("mul %7,%11") // r1:r0 = MI(d) * HI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MI(d) * HI(x) << 24 - // %3:%2:%1:%0 = r = (1<<24) - x*d - // %8:%7:%6 = d = interval - - // Perform the final correction - A("sub %0,%6") - A("sbc %1,%7") - A("sbc %2,%8") // r -= d - A("brcs 14f") // if ( r >= d) - - // %11:%10:%9 = x - A("ldi %3,1") - A("add %9,%3") - A("adc %10,%13") - A("adc %11,%13") // x++ - L("14") - - // Estimation is done. %11:%10:%9 = x - A("clr __zero_reg__") // Make C runtime happy - // [211 cycles total] - : "=r" (r2), - "=r" (r3), - "=r" (r4), - "=d" (r5), - "=r" (r6), - "=r" (r7), - "+r" (r8), - "+r" (r9), - "+r" (r10), - "=d" (r11), - "=r" (r12), - "=r" (r13), - "=d" (r14), - "=d" (r15), - "=d" (r16), - "=d" (r17), - "=d" (r18), - "+z" (ptab) - : - : "r0", "r1", "cc" - ); - - // Return the result - return r11 | (uint16_t(r12) << 8) | (uint32_t(r13) << 16); - } - -#endif // S_CURVE_ACCELERATION - #define MINIMAL_STEP_RATE 120 /** * Calculate trapezoid parameters, multiplying the entry- and exit-speeds * by the provided factors. - ** - * ############ VERY IMPORTANT ############ - * NOTE that the PRECONDITION to call this function is that the block is - * NOT BUSY and it is marked as RECALCULATE. That WARRANTIES the Stepper ISR - * is not and will not use the block while we modify it, so it is safe to - * alter its values. */ void Planner::calculate_trapezoid_for_block(block_t* const block, const float &entry_factor, const float &exit_factor) { - uint32_t initial_rate = CEIL(block->nominal_rate * entry_factor), final_rate = CEIL(block->nominal_rate * exit_factor); // (steps per second) // Limit minimal step rate (Otherwise the timer will overflow.) - NOLESS(initial_rate, uint32_t(MINIMAL_STEP_RATE)); - NOLESS(final_rate, uint32_t(MINIMAL_STEP_RATE)); - - #if ENABLED(S_CURVE_ACCELERATION) - uint32_t cruise_rate = initial_rate; - #endif + NOLESS(initial_rate, MINIMAL_STEP_RATE); + NOLESS(final_rate, MINIMAL_STEP_RATE); const int32_t accel = block->acceleration_steps_per_s2; // Steps required for acceleration, deceleration to/from nominal rate - uint32_t accelerate_steps = CEIL(estimate_acceleration_distance(initial_rate, block->nominal_rate, accel)), - decelerate_steps = FLOOR(estimate_acceleration_distance(block->nominal_rate, final_rate, -accel)); + int32_t accelerate_steps = CEIL(estimate_acceleration_distance(initial_rate, block->nominal_rate, accel)), + decelerate_steps = FLOOR(estimate_acceleration_distance(block->nominal_rate, final_rate, -accel)), // Steps between acceleration and deceleration, if any - int32_t plateau_steps = block->step_event_count - accelerate_steps - decelerate_steps; + plateau_steps = block->step_event_count - accelerate_steps - decelerate_steps; // Does accelerate_steps + decelerate_steps exceed step_event_count? // Then we can't possibly reach the nominal rate, there will be no cruising. // Use intersection_distance() to calculate accel / braking time in order to // reach the final_rate exactly at the end of this block. if (plateau_steps < 0) { - const float accelerate_steps_float = CEIL(intersection_distance(initial_rate, final_rate, accel, block->step_event_count)); - accelerate_steps = MIN(uint32_t(MAX(accelerate_steps_float, 0)), block->step_event_count); + accelerate_steps = CEIL(intersection_distance(initial_rate, final_rate, accel, block->step_event_count)); + NOLESS(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(S_CURVE_ACCELERATION) - // We won't reach the cruising rate. Let's calculate the speed we will reach - cruise_rate = final_speed(initial_rate, accel, accelerate_steps); - #endif } - #if ENABLED(S_CURVE_ACCELERATION) - else // We have some plateau time, so the cruise rate will be the nominal rate - cruise_rate = block->nominal_rate; - #endif - #if ENABLED(S_CURVE_ACCELERATION) - // Jerk controlled speed requires to express speed versus time, NOT steps - uint32_t acceleration_time = ((float)(cruise_rate - initial_rate) / accel) * (STEPPER_TIMER_RATE), - deceleration_time = ((float)(cruise_rate - final_rate) / accel) * (STEPPER_TIMER_RATE); + // block->accelerate_until = accelerate_steps; + // block->decelerate_after = accelerate_steps+plateau_steps; - // And to offload calculations from the ISR, we also calculate the inverse of those times here - uint32_t acceleration_time_inverse = get_period_inverse(acceleration_time); - uint32_t deceleration_time_inverse = get_period_inverse(deceleration_time); - #endif - - // Store new block parameters - block->accelerate_until = accelerate_steps; - block->decelerate_after = accelerate_steps + plateau_steps; - block->initial_rate = initial_rate; - #if ENABLED(S_CURVE_ACCELERATION) - block->acceleration_time = acceleration_time; - block->deceleration_time = deceleration_time; - block->acceleration_time_inverse = acceleration_time_inverse; - block->deceleration_time_inverse = deceleration_time_inverse; - block->cruise_rate = cruise_rate; - #endif - block->final_rate = final_rate; + CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section + if (!TEST(block->flag, BLOCK_BIT_BUSY)) { // Don't update variables if block is busy. + block->accelerate_until = accelerate_steps; + block->decelerate_after = accelerate_steps + plateau_steps; + block->initial_rate = initial_rate; + block->final_rate = final_rate; + } + CRITICAL_SECTION_END; } -/* PLANNER SPEED DEFINITION - +--------+ <- current->nominal_speed - / \ - current->entry_speed -> + \ - | + <- next->entry_speed (aka exit speed) - +-------------+ - time --> +// "Junction jerk" in this context is the immediate change in speed at the junction of two blocks. +// This method will calculate the junction jerk as the euclidean distance between the nominal +// velocities of the respective blocks. +//inline float junction_jerk(block_t *before, block_t *after) { +// return SQRT( +// POW((before->speed_x-after->speed_x), 2)+POW((before->speed_y-after->speed_y), 2)); +//} - Recalculates the motion plan according to the following basic guidelines: - - 1. Go over every feasible block sequentially in reverse order and calculate the junction speeds - (i.e. current->entry_speed) such that: - a. No junction speed exceeds the pre-computed maximum junction speed limit or nominal speeds of - neighboring blocks. - b. A block entry speed cannot exceed one reverse-computed from its exit speed (next->entry_speed) - with a maximum allowable deceleration over the block travel distance. - c. The last (or newest appended) block is planned from a complete stop (an exit speed of zero). - 2. Go over every block in chronological (forward) order and dial down junction speed values if - a. The exit speed exceeds the one forward-computed from its entry speed with the maximum allowable - acceleration over the block travel distance. - - When these stages are complete, the planner will have maximized the velocity profiles throughout the all - of the planner blocks, where every block is operating at its maximum allowable acceleration limits. In - other words, for all of the blocks in the planner, the plan is optimal and no further speed improvements - are possible. If a new block is added to the buffer, the plan is recomputed according to the said - guidelines for a new optimal plan. - - To increase computational efficiency of these guidelines, a set of planner block pointers have been - created to indicate stop-compute points for when the planner guidelines cannot logically make any further - changes or improvements to the plan when in normal operation and new blocks are streamed and added to the - planner buffer. For example, if a subset of sequential blocks in the planner have been planned and are - bracketed by junction velocities at their maximums (or by the first planner block as well), no new block - added to the planner buffer will alter the velocity profiles within them. So we no longer have to compute - them. Or, if a set of sequential blocks from the first block in the planner (or a optimal stop-compute - point) are all accelerating, they are all optimal and can not be altered by a new block added to the - planner buffer, as this will only further increase the plan speed to chronological blocks until a maximum - junction velocity is reached. However, if the operational conditions of the plan changes from infrequently - used feed holds or feedrate overrides, the stop-compute pointers will be reset and the entire plan is - recomputed as stated in the general guidelines. - - Planner buffer index mapping: - - block_buffer_tail: Points to the beginning of the planner buffer. First to be executed or being executed. - - block_buffer_head: Points to the buffer block after the last block in the buffer. Used to indicate whether - the buffer is full or empty. As described for standard ring buffers, this block is always empty. - - block_buffer_planned: Points to the first buffer block after the last optimally planned block for normal - streaming operating conditions. Use for planning optimizations by avoiding recomputing parts of the - planner buffer that don't change with the addition of a new block, as describe above. In addition, - this block can never be less than block_buffer_tail and will always be pushed forward and maintain - this requirement when encountered by the Planner::discard_current_block() routine during a cycle. - - NOTE: Since the planner only computes on what's in the planner buffer, some motions with lots of short - line segments, like G2/3 arcs or complex curves, may seem to move slow. This is because there simply isn't - enough combined distance traveled in the entire buffer to accelerate up to the nominal speed and then - decelerate to a complete stop at the end of the buffer, as stated by the guidelines. If this happens and - becomes an annoyance, there are a few simple solutions: (1) Maximize the machine acceleration. The planner - will be able to compute higher velocity profiles within the same combined distance. (2) Maximize line - motion(s) distance per block to a desired tolerance. The more combined distance the planner has to use, - the faster it can go. (3) Maximize the planner buffer size. This also will increase the combined distance - for the planner to compute over. It also increases the number of computations the planner has to perform - to compute an optimal plan, so select carefully. -*/ // The kernel called by recalculate() when scanning the plan from last to first entry. void Planner::reverse_pass_kernel(block_t* const current, const block_t * const next) { - if (current) { - // If entry speed is already at the maximum entry speed, and there was no change of speed - // in the next block, there is no need to recheck. Block is cruising and there is no need to - // compute anything for this block, - // If not, block entry speed needs to be recalculated to ensure maximum possible planned speed. - const float max_entry_speed_sqr = current->max_entry_speed_sqr; - - // Compute maximum entry speed decelerating over the current block from its exit speed. - // If not at the maximum entry speed, or the previous block entry speed changed - if (current->entry_speed_sqr != max_entry_speed_sqr || (next && TEST(next->flag, BLOCK_BIT_RECALCULATE))) { - - // If nominal length true, max junction speed is guaranteed to be reached. - // If a block can de/ac-celerate from nominal speed to zero within the length of the block, then - // the current block and next block junction speeds are guaranteed to always be at their maximum - // junction speeds in deceleration and acceleration, respectively. This is due to how the current - // block nominal speed limits both the current and next maximum junction speeds. Hence, in both - // the reverse and forward planners, the corresponding block junction speed will always be at the - // the maximum junction speed and may always be ignored for any speed reduction checks. - - const float new_entry_speed_sqr = TEST(current->flag, BLOCK_BIT_NOMINAL_LENGTH) - ? max_entry_speed_sqr - : MIN(max_entry_speed_sqr, max_allowable_speed_sqr(-current->acceleration, next ? next->entry_speed_sqr : sq(float(MINIMUM_PLANNER_SPEED)), current->millimeters)); - if (current->entry_speed_sqr != new_entry_speed_sqr) { - - // Need to recalculate the block speed - Mark it now, so the stepper - // ISR does not consume the block before being recalculated - SBI(current->flag, BLOCK_BIT_RECALCULATE); - - // But there is an inherent race condition here, as the block may have - // become BUSY just before being marked RECALCULATE, so check for that! - if (stepper.is_block_busy(current)) { - // Block became busy. Clear the RECALCULATE flag (no point in - // recalculating BUSY blocks). And don't set its speed, as it can't - // be updated at this time. - CBI(current->flag, BLOCK_BIT_RECALCULATE); - } - else { - // Block is not BUSY so this is ahead of the Stepper ISR: - // Just Set the new entry speed. - current->entry_speed_sqr = new_entry_speed_sqr; - } - } - } + if (!current || !next) return; + // If entry speed is already at the maximum entry speed, no need to recheck. Block is cruising. + // If not, block in state of acceleration or deceleration. Reset entry speed to maximum and + // check for maximum allowable speed reductions to ensure maximum possible planned speed. + float max_entry_speed = current->max_entry_speed; + if (current->entry_speed != max_entry_speed) { + // If nominal length true, max junction speed is guaranteed to be reached. Only compute + // for max allowable speed if block is decelerating and nominal length is false. + current->entry_speed = (TEST(current->flag, BLOCK_BIT_NOMINAL_LENGTH) || max_entry_speed <= next->entry_speed) + ? max_entry_speed + : min(max_entry_speed, max_allowable_speed(-current->acceleration, next->entry_speed, current->millimeters)); + SBI(current->flag, BLOCK_BIT_RECALCULATE); } } @@ -879,97 +277,41 @@ void Planner::reverse_pass_kernel(block_t* const current, const block_t * const * Once in reverse and once forward. This implements the reverse pass. */ void Planner::reverse_pass() { - // Initialize block index to the last block in the planner buffer. - uint8_t block_index = prev_block_index(block_buffer_head); + if (movesplanned() > 3) { + const uint8_t endnr = BLOCK_MOD(block_buffer_tail + 2); // tail is running. tail+1 shouldn't be altered because it's connected to the running block. + // tail+2 because the index is not yet advanced when checked + uint8_t blocknr = prev_block_index(block_buffer_head); + block_t* current = &block_buffer[blocknr]; - // Read the index of the last buffer planned block. - // The ISR may change it so get a stable local copy. - uint8_t planned_block_index = block_buffer_planned; - - // If there was a race condition and block_buffer_planned was incremented - // or was pointing at the head (queue empty) break loop now and avoid - // planning already consumed blocks - if (planned_block_index == block_buffer_head) return; - - // Reverse Pass: Coarsely maximize all possible deceleration curves back-planning from the last - // block in buffer. Cease planning when the last optimal planned or tail pointer is reached. - // NOTE: Forward pass will later refine and correct the reverse pass to create an optimal plan. - const block_t *next = NULL; - while (block_index != planned_block_index) { - - // Perform the reverse pass - block_t *current = &block_buffer[block_index]; - - // Only consider non sync blocks - if (!TEST(current->flag, BLOCK_BIT_SYNC_POSITION)) { + do { + const block_t * const next = current; + blocknr = prev_block_index(blocknr); + current = &block_buffer[blocknr]; + if (TEST(current->flag, BLOCK_BIT_START_FROM_FULL_HALT)) // Up to this every block is already optimized. + break; reverse_pass_kernel(current, next); - next = current; - } - - // Advance to the next - block_index = prev_block_index(block_index); - - // The ISR could advance the block_buffer_planned while we were doing the reverse pass. - // We must try to avoid using an already consumed block as the last one - So follow - // changes to the pointer and make sure to limit the loop to the currently busy block - while (planned_block_index != block_buffer_planned) { - - // If we reached the busy block or an already processed block, break the loop now - if (block_index == planned_block_index) return; - - // Advance the pointer, following the busy block - planned_block_index = next_block_index(planned_block_index); - } + } while (blocknr != endnr); } } // The kernel called by recalculate() when scanning the plan from first to last entry. -void Planner::forward_pass_kernel(const block_t* const previous, block_t* const current, const uint8_t block_index) { - if (previous) { - // If the previous block is an acceleration block, too short to complete the full speed - // change, adjust the entry speed accordingly. Entry speeds have already been reset, - // maximized, and reverse-planned. If nominal length is set, max junction speed is - // guaranteed to be reached. No need to recheck. - if (!TEST(previous->flag, BLOCK_BIT_NOMINAL_LENGTH) && - previous->entry_speed_sqr < current->entry_speed_sqr) { +void Planner::forward_pass_kernel(const block_t * const previous, block_t* const current) { + if (!previous) return; - // Compute the maximum allowable speed - const float new_entry_speed_sqr = max_allowable_speed_sqr(-previous->acceleration, previous->entry_speed_sqr, previous->millimeters); - - // If true, current block is full-acceleration and we can move the planned pointer forward. - if (new_entry_speed_sqr < current->entry_speed_sqr) { - - // Mark we need to recompute the trapezoidal shape, and do it now, - // so the stepper ISR does not consume the block before being recalculated + // If the previous block is an acceleration block, but it is not long enough to complete the + // full speed change within the block, we need to adjust the entry speed accordingly. Entry + // speeds have already been reset, maximized, and reverse planned by reverse planner. + // If nominal length is true, max junction speed is guaranteed to be reached. No need to recheck. + if (!TEST(previous->flag, BLOCK_BIT_NOMINAL_LENGTH)) { + if (previous->entry_speed < current->entry_speed) { + float entry_speed = min(current->entry_speed, + max_allowable_speed(-previous->acceleration, previous->entry_speed, previous->millimeters)); + // Check for junction speed change + if (current->entry_speed != entry_speed) { + current->entry_speed = entry_speed; SBI(current->flag, BLOCK_BIT_RECALCULATE); - - // But there is an inherent race condition here, as the block maybe - // became BUSY, just before it was marked as RECALCULATE, so check - // if that is the case! - if (stepper.is_block_busy(current)) { - // Block became busy. Clear the RECALCULATE flag (no point in - // recalculating BUSY blocks and don't set its speed, as it can't - // be updated at this time. - CBI(current->flag, BLOCK_BIT_RECALCULATE); - } - else { - // Block is not BUSY, we won the race against the Stepper ISR: - - // Always <= max_entry_speed_sqr. Backward pass sets this. - current->entry_speed_sqr = new_entry_speed_sqr; // Always <= max_entry_speed_sqr. Backward pass sets this. - - // Set optimal plan pointer. - block_buffer_planned = block_index; - } } } - - // Any block set at its maximum entry speed also creates an optimal plan up to this - // point in the buffer. When the plan is bracketed by either the beginning of the - // buffer and a maximum entry speed or two maximum entry speeds, every block in between - // cannot logically be further improved. Hence, we don't have to recompute them anymore. - if (current->entry_speed_sqr == current->max_entry_speed_sqr) - block_buffer_planned = block_index; } } @@ -978,37 +320,15 @@ void Planner::forward_pass_kernel(const block_t* const previous, block_t* const * Once in reverse and once forward. This implements the forward pass. */ void Planner::forward_pass() { + block_t* block[3] = { NULL, NULL, NULL }; - // Forward Pass: Forward plan the acceleration curve from the planned pointer onward. - // Also scans for optimal plan breakpoints and appropriately updates the planned pointer. - - // Begin at buffer planned pointer. Note that block_buffer_planned can be modified - // by the stepper ISR, so read it ONCE. It it guaranteed that block_buffer_planned - // will never lead head, so the loop is safe to execute. Also note that the forward - // pass will never modify the values at the tail. - uint8_t block_index = block_buffer_planned; - - block_t *current; - const block_t * previous = NULL; - while (block_index != block_buffer_head) { - - // Perform the forward pass - current = &block_buffer[block_index]; - - // Skip SYNC blocks - if (!TEST(current->flag, BLOCK_BIT_SYNC_POSITION)) { - // If there's no previous block or the previous block is not - // BUSY (thus, modifiable) run the forward_pass_kernel. Otherwise, - // the previous block became BUSY, so assume the current block's - // entry speed can't be altered (since that would also require - // updating the exit speed of the previous block). - if (!previous || !stepper.is_block_busy(previous)) - forward_pass_kernel(previous, current, block_index); - previous = current; - } - // Advance to the previous - block_index = next_block_index(block_index); + for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { + block[0] = block[1]; + block[1] = block[2]; + block[2] = &block_buffer[b]; + forward_pass_kernel(block[0], block[1]); } + forward_pass_kernel(block[1], block[2]); } /** @@ -1017,122 +337,62 @@ void Planner::forward_pass() { * recalculate() after updating the blocks. */ void Planner::recalculate_trapezoids() { - // The tail may be changed by the ISR so get a local copy. - uint8_t block_index = block_buffer_tail, - head_block_index = block_buffer_head; - // Since there could be a sync block in the head of the queue, and the - // next loop must not recalculate the head block (as it needs to be - // specially handled), scan backwards to the first non-SYNC block. - while (head_block_index != block_index) { - - // Go back (head always point to the first free block) - const uint8_t prev_index = prev_block_index(head_block_index); - - // Get the pointer to the block - block_t *prev = &block_buffer[prev_index]; - - // If not dealing with a sync block, we are done. The last block is not a SYNC block - if (!TEST(prev->flag, BLOCK_BIT_SYNC_POSITION)) break; - - // Examine the previous block. This and all following are SYNC blocks - head_block_index = prev_index; - } - - // Go from the tail (currently executed block) to the first block, without including it) - block_t *current = NULL, *next = NULL; - float current_entry_speed = 0.0, next_entry_speed = 0.0; - while (block_index != head_block_index) { + int8_t block_index = block_buffer_tail; + block_t *current, *next = NULL; + while (block_index != block_buffer_head) { + current = next; next = &block_buffer[block_index]; - - // Skip sync blocks - if (!TEST(next->flag, BLOCK_BIT_SYNC_POSITION)) { - next_entry_speed = SQRT(next->entry_speed_sqr); - - if (current) { - // Recalculate if current block entry or exit junction speed has changed. - if (TEST(current->flag, BLOCK_BIT_RECALCULATE) || TEST(next->flag, BLOCK_BIT_RECALCULATE)) { - - // Mark the current block as RECALCULATE, to protect it from the Stepper ISR running it. - // Note that due to the above condition, there's a chance the current block isn't marked as - // RECALCULATE yet, but the next one is. That's the reason for the following line. - SBI(current->flag, BLOCK_BIT_RECALCULATE); - - // But there is an inherent race condition here, as the block maybe - // became BUSY, just before it was marked as RECALCULATE, so check - // if that is the case! - if (!stepper.is_block_busy(current)) { - // Block is not BUSY, we won the race against the Stepper ISR: - - // NOTE: Entry and exit factors always > 0 by all previous logic operations. - const float current_nominal_speed = SQRT(current->nominal_speed_sqr), - nomr = 1.0f / current_nominal_speed; - calculate_trapezoid_for_block(current, current_entry_speed * nomr, next_entry_speed * nomr); - #if ENABLED(LIN_ADVANCE) - if (current->use_advance_lead) { - const float comp = current->e_D_ratio * extruder_advance_K * axis_steps_per_mm[E_AXIS]; - current->max_adv_steps = current_nominal_speed * comp; - current->final_adv_steps = next_entry_speed * comp; - } - #endif - } - - // Reset current only to ensure next trapezoid is computed - The - // stepper is free to use the block from now on. - CBI(current->flag, BLOCK_BIT_RECALCULATE); - } + if (current) { + // Recalculate if current block entry or exit junction speed has changed. + if (TEST(current->flag, BLOCK_BIT_RECALCULATE) || TEST(next->flag, BLOCK_BIT_RECALCULATE)) { + // NOTE: Entry and exit factors always > 0 by all previous logic operations. + const float nomr = 1.0 / current->nominal_speed; + calculate_trapezoid_for_block(current, current->entry_speed * nomr, next->entry_speed * nomr); + CBI(current->flag, BLOCK_BIT_RECALCULATE); // Reset current only to ensure next trapezoid is computed } - - current = next; - current_entry_speed = next_entry_speed; } - block_index = next_block_index(block_index); } - // Last/newest block in buffer. Exit speed is set with MINIMUM_PLANNER_SPEED. Always recalculated. if (next) { - - // Mark the next(last) block as RECALCULATE, to prevent the Stepper ISR running it. - // As the last block is always recalculated here, there is a chance the block isn't - // marked as RECALCULATE yet. That's the reason for the following line. - SBI(next->flag, BLOCK_BIT_RECALCULATE); - - // But there is an inherent race condition here, as the block maybe - // became BUSY, just before it was marked as RECALCULATE, so check - // if that is the case! - if (!stepper.is_block_busy(current)) { - // Block is not BUSY, we won the race against the Stepper ISR: - - const float next_nominal_speed = SQRT(next->nominal_speed_sqr), - nomr = 1.0f / next_nominal_speed; - calculate_trapezoid_for_block(next, next_entry_speed * nomr, float(MINIMUM_PLANNER_SPEED) * nomr); - #if ENABLED(LIN_ADVANCE) - if (next->use_advance_lead) { - const float comp = next->e_D_ratio * extruder_advance_K * axis_steps_per_mm[E_AXIS]; - next->max_adv_steps = next_nominal_speed * comp; - next->final_adv_steps = (MINIMUM_PLANNER_SPEED) * comp; - } - #endif - } - - // Reset next only to ensure its trapezoid is computed - The stepper is free to use - // the block from now on. + const float nomr = 1.0 / next->nominal_speed; + calculate_trapezoid_for_block(next, next->entry_speed * nomr, (MINIMUM_PLANNER_SPEED) * nomr); CBI(next->flag, BLOCK_BIT_RECALCULATE); } } +/* + * Recalculate the motion plan according to the following algorithm: + * + * 1. Go over every block in reverse order... + * + * Calculate a junction speed reduction (block_t.entry_factor) so: + * + * a. The junction jerk is within the set limit, and + * + * b. No speed reduction within one block requires faster + * deceleration than the one, true constant acceleration. + * + * 2. Go over every block in chronological order... + * + * Dial down junction speed reduction values if: + * a. The speed increase within one block would require faster + * acceleration than the one, true constant acceleration. + * + * After that, all blocks will have an entry_factor allowing all speed changes to + * be performed using only the one, true constant acceleration, and where no junction + * jerk is jerkier than the set limit, Jerky. Finally it will: + * + * 3. Recalculate "trapezoids" for all blocks. + */ void Planner::recalculate() { - // Initialize block index to the last block in the planner buffer. - const uint8_t block_index = prev_block_index(block_buffer_head); - // If there is just one block, no planning can be done. Avoid it! - if (block_index != block_buffer_planned) { - reverse_pass(); - forward_pass(); - } + reverse_pass(); + forward_pass(); recalculate_trapezoids(); } + #if ENABLED(AUTOTEMP) void Planner::getHighESpeed() { @@ -1144,21 +404,15 @@ void Planner::recalculate() { float high = 0.0; for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { block_t* block = &block_buffer[b]; - if ( - #if ENABLED(HANGPRINTER) - block->steps[A_AXIS] || block->steps[B_AXIS] || block->steps[C_AXIS] || block->steps[D_AXIS] - #else - block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS] - #endif - ) { - const float se = (float)block->steps[E_AXIS] / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec; + if (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS]) { + float se = (float)block->steps[E_AXIS] / block->step_event_count * block->nominal_speed; // mm/sec; NOLESS(high, se); } } float t = autotemp_min + high * autotemp_factor; t = constrain(t, autotemp_min, autotemp_max); - if (t < oldt) t = t * (1 - float(AUTOTEMP_OLDWEIGHT)) + oldt * float(AUTOTEMP_OLDWEIGHT); + if (t < oldt) t = t * (1 - (AUTOTEMP_OLDWEIGHT)) + oldt * (AUTOTEMP_OLDWEIGHT); oldt = t; thermalManager.setTargetHotend(t, 0); } @@ -1181,7 +435,7 @@ void Planner::check_axes_activity() { #endif #endif - if (has_blocks_queued()) { + if (blocks_queued()) { #if FAN_COUNT > 0 for (uint8_t i = 0; i < FAN_COUNT; i++) @@ -1261,8 +515,8 @@ void Planner::check_axes_activity() { #endif // FAN_KICKSTART_TIME > 0 - #if FAN_MIN_PWM != 0 || FAN_MAX_PWM != 255 - #define CALC_FAN_SPEED(f) (tail_fan_speed[f] ? map(tail_fan_speed[f], 1, 255, FAN_MIN_PWM, FAN_MAX_PWM) : 0) + #ifdef FAN_MIN_PWM + #define CALC_FAN_SPEED(f) (tail_fan_speed[f] ? ( FAN_MIN_PWM + (tail_fan_speed[f] * (255 - FAN_MIN_PWM)) / 255 ) : 0) #else #define CALC_FAN_SPEED(f) tail_fan_speed[f] #endif @@ -1313,7 +567,7 @@ void Planner::check_axes_activity() { * Return 1.0 with volumetric off or a diameter of 0.0. */ inline float calculate_volumetric_multiplier(const float &diameter) { - return (parser.volumetric_enabled && diameter) ? 1.0f / CIRCLE_AREA(diameter * 0.5) : 1.0; + return (parser.volumetric_enabled && diameter) ? 1.0 / CIRCLE_AREA(diameter * 0.5) : 1.0; } /** @@ -1337,18 +591,18 @@ void Planner::check_axes_activity() { */ void Planner::calculate_volumetric_for_width_sensor(const int8_t encoded_ratio) { // Reconstitute the nominal/measured ratio - const float nom_meas_ratio = 1 + 0.01f * encoded_ratio, + const float nom_meas_ratio = 1.0 + 0.01 * encoded_ratio, ratio_2 = sq(nom_meas_ratio); volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = parser.volumetric_enabled - ? ratio_2 / CIRCLE_AREA(filament_width_nominal * 0.5f) // Volumetric uses a true volumetric multiplier - : ratio_2; // Linear squares the ratio, which scales the volume + ? ratio_2 / CIRCLE_AREA(filament_width_nominal * 0.5) // Volumetric uses a true volumetric multiplier + : ratio_2; // Linear squares the ratio, which scales the volume refresh_e_factor(FILAMENT_SENSOR_EXTRUDER_NUM); } #endif -#if PLANNER_LEVELING || HAS_UBL_AND_CURVES +#if PLANNER_LEVELING /** * rx, ry, rz - Cartesian positions in mm * Leveled XYZ on completion @@ -1371,11 +625,12 @@ void Planner::check_axes_activity() { rx = dx + X_TILT_FULCRUM; ry = dy + Y_TILT_FULCRUM; - #elif HAS_MESH + #else #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) const float fade_scaling_factor = fade_scaling_factor_for_z(rz); - #else + if (!fade_scaling_factor) return; + #elif HAS_MESH constexpr float fade_scaling_factor = 1.0; #endif @@ -1384,29 +639,33 @@ void Planner::check_axes_activity() { #endif rz += ( - #if ENABLED(MESH_BED_LEVELING) + #if ENABLED(AUTO_BED_LEVELING_UBL) + ubl.get_z_correction(rx, ry) * fade_scaling_factor + #elif ENABLED(MESH_BED_LEVELING) mbl.get_z(rx, ry #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) , fade_scaling_factor #endif ) - #elif ENABLED(AUTO_BED_LEVELING_UBL) - fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(rx, ry) : 0.0 #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - fade_scaling_factor ? fade_scaling_factor * bilinear_z_offset(raw) : 0.0 + bilinear_z_offset(raw) * fade_scaling_factor + #else + 0 #endif ); #endif } -#endif - -#if PLANNER_LEVELING - void Planner::unapply_leveling(float raw[XYZ]) { - if (leveling_active) { + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + const float fade_scaling_factor = fade_scaling_factor_for_z(raw[Z_AXIS]); + #else + constexpr float fade_scaling_factor = 1.0; + #endif + + if (leveling_active && fade_scaling_factor) { #if ABL_PLANAR @@ -1420,29 +679,25 @@ void Planner::check_axes_activity() { raw[X_AXIS] = dx + X_TILT_FULCRUM; raw[Y_AXIS] = dy + Y_TILT_FULCRUM; - #elif HAS_MESH - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = fade_scaling_factor_for_z(raw[Z_AXIS]); - #else - constexpr float fade_scaling_factor = 1.0; - #endif + #else // !ABL_PLANAR raw[Z_AXIS] -= ( - #if ENABLED(MESH_BED_LEVELING) + #if ENABLED(AUTO_BED_LEVELING_UBL) + ubl.get_z_correction(raw[X_AXIS], raw[Y_AXIS]) * fade_scaling_factor + #elif ENABLED(MESH_BED_LEVELING) mbl.get_z(raw[X_AXIS], raw[Y_AXIS] #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) , fade_scaling_factor #endif ) - #elif ENABLED(AUTO_BED_LEVELING_UBL) - fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw[X_AXIS], raw[Y_AXIS]) : 0.0 #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - fade_scaling_factor ? fade_scaling_factor * bilinear_z_offset(raw) : 0.0 + bilinear_z_offset(raw) * fade_scaling_factor + #else + 0 #endif ); - #endif + #endif // !ABL_PLANAR } #if ENABLED(SKEW_CORRECTION) @@ -1452,200 +707,25 @@ void Planner::check_axes_activity() { #endif // PLANNER_LEVELING -void Planner::quick_stop() { - - // Remove all the queued blocks. Note that this function is NOT - // called from the Stepper ISR, so we must consider tail as readonly! - // that is why we set head to tail - But there is a race condition that - // must be handled: The tail could change between the read and the assignment - // so this must be enclosed in a critical section - - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - // Drop all queue entries - block_buffer_nonbusy = block_buffer_planned = block_buffer_head = block_buffer_tail; - - // Restart the block delay for the first movement - As the queue was - // forced to empty, there's no risk the ISR will touch this. - delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - - #if ENABLED(ULTRA_LCD) - // Clear the accumulated runtime - clear_block_buffer_runtime(); - #endif - - // Make sure to drop any attempt of queuing moves for at least 1 second - cleaning_buffer_counter = 1000; - - // Reenable Stepper ISR - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - - // And stop the stepper ISR - stepper.quick_stop(); -} - -void Planner::endstop_triggered(const AxisEnum axis) { - // Record stepper position and discard the current block - stepper.endstop_triggered(axis); -} - -float Planner::triggered_position_mm(const AxisEnum axis) { - return stepper.triggered_position(axis) * steps_to_mm[axis]; -} - -void Planner::finish_and_disable() { - while (has_blocks_queued() || cleaning_buffer_counter) idle(); - disable_all_steppers(); -} - -/** - * Get an axis position according to stepper position(s) - * For CORE machines apply translation from ABC to XYZ. - */ -float Planner::get_axis_position_mm(const AxisEnum axis) { - float axis_steps; - #if IS_CORE - // Requesting one of the "core" axes? - if (axis == CORE_AXIS_1 || axis == CORE_AXIS_2) { - - // Protect the access to the position. - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - // ((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 = 0.5f * ( - axis == CORE_AXIS_2 ? CORESIGN(stepper.position(CORE_AXIS_1) - stepper.position(CORE_AXIS_2)) - : stepper.position(CORE_AXIS_1) + stepper.position(CORE_AXIS_2) - ); - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - } - else - axis_steps = stepper.position(axis); - #else - axis_steps = stepper.position(axis); - #endif - #if ENABLED(LINE_BUILDUP_COMPENSATION_FEATURE) - if (axis != E_AXIS) return (sq(axis_steps / k0[axis] + sqrtk1[axis]) - k1[axis]) / k2[axis]; - #endif - return axis_steps * steps_to_mm[axis]; -} - -/** - * Block until all buffered steps are executed / cleaned - */ -void Planner::synchronize() { while (has_blocks_queued() || cleaning_buffer_counter) idle(); } - -#if ENABLED(UNREGISTERED_MOVE_SUPPORT) - #define COUNT_MOVE count_it -#else - #define COUNT_MOVE true -#endif - /** * Planner::_buffer_steps * - * Add a new linear movement to the planner queue (in terms of steps). + * Add a new linear movement to the buffer (in terms of steps). * - * target - target position in steps units - * target_float - target position in mm (HAS_POSITION_FLOAT) - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - * count_it - apply this move to the counters (UNREGISTERED_MOVE_SUPPORT) - * - * Returns true if movement was properly queued, false otherwise + * target - target position in steps units + * fr_mm_s - (target) speed of the move + * extruder - target extruder */ -bool Planner::_buffer_steps(const int32_t (&target)[NUM_AXIS] - #if HAS_POSITION_FLOAT - , const float (&target_float)[NUM_AXIS] - #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/ - #if ENABLED(UNREGISTERED_MOVE_SUPPORT) - , const bool count_it/*=true*/ - #endif -) { +void Planner::_buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const uint8_t extruder) { - // If we are cleaning, do not accept queuing of movements - if (cleaning_buffer_counter) return false; + const int32_t da = target[X_AXIS] - position[X_AXIS], + db = target[Y_AXIS] - position[Y_AXIS], + dc = target[Z_AXIS] - position[Z_AXIS]; - // Wait for the next available block - uint8_t next_buffer_head; - block_t * const block = get_next_free_block(next_buffer_head); - - // Fill the block with the specified movement - if (!_populate_block(block, false, target - #if HAS_POSITION_FLOAT - , target_float - #endif - , fr_mm_s, extruder, millimeters - #if ENABLED(UNREGISTERED_MOVE_SUPPORT) - , count_it - #endif - )) { - // Movement was not queued, probably because it was too short. - // Simply accept that as movement queued and done - return true; - } - - // If this is the first added movement, reload the delay, otherwise, cancel it. - if (block_buffer_head == block_buffer_tail) { - // If it was the first queued block, restart the 1st block delivery delay, to - // give the planner an opportunity to queue more movements and plan them - // As there are no queued movements, the Stepper ISR will not touch this - // variable, so there is no risk setting this here (but it MUST be done - // before the following line!!) - delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - } - - // Move buffer head - block_buffer_head = next_buffer_head; - - // Recalculate and optimize trapezoidal speed profiles - recalculate(); - - // Movement successfully queued! - return true; -} - -/** - * Planner::_populate_block - * - * Fills a new linear movement in the block (in terms of steps). - * - * target - target position in steps units - * target_float - target position in mm (HAS_POSITION_FLOAT) - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - * count_it - apply this move to the counters (UNREGISTERED_MOVE_SUPPORT) - * - * Returns true is movement is acceptable, false otherwise - */ -bool Planner::_populate_block(block_t * const block, bool split_move, - const int32_t (&target)[NUM_AXIS] - #if HAS_POSITION_FLOAT - , const float (&target_float)[NUM_AXIS] - #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/ - #if ENABLED(UNREGISTERED_MOVE_SUPPORT) - , const bool count_it/*=true*/ - #endif -) { - - const int32_t da = target[A_AXIS] - position[A_AXIS], - db = target[B_AXIS] - position[B_AXIS], - dc = target[C_AXIS] - position[C_AXIS] - #if ENABLED(HANGPRINTER) - , dd = target[D_AXIS] - position[D_AXIS] - #endif - ; int32_t de = target[E_AXIS] - position[E_AXIS]; /* <-- add a slash to enable - SERIAL_ECHOPAIR(" _populate_block FR:", fr_mm_s); + SERIAL_ECHOPAIR(" _buffer_steps FR:", fr_mm_s); SERIAL_ECHOPAIR(" A:", target[A_AXIS]); SERIAL_ECHOPAIR(" (", da); SERIAL_ECHOPAIR(" steps) B:", target[B_AXIS]); @@ -1657,36 +737,28 @@ bool Planner::_populate_block(block_t * const block, bool split_move, SERIAL_ECHOLNPGM(" steps)"); //*/ - #if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE) + // If LIN_ADVANCE is disabled then do E move prevention with integers + // Otherwise it's done in _buffer_segment. + #if DISABLED(LIN_ADVANCE) && (ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE)) if (de) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (thermalManager.tooColdToExtrude(extruder)) { - if (COUNT_MOVE) { - position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part - #if HAS_POSITION_FLOAT - position_float[E_AXIS] = target_float[E_AXIS]; - #endif - } + 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(); SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); } #endif // PREVENT_COLD_EXTRUSION #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - if (ABS(de * e_factor[extruder]) > (int32_t)axis_steps_per_mm[E_AXIS_N] * (EXTRUDE_MAXLENGTH)) { // It's not important to get max. extrusion length in a precision < 1mm, so save some cycles and cast to int - if (COUNT_MOVE) { - position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part - #if HAS_POSITION_FLOAT - position_float[E_AXIS] = target_float[E_AXIS]; - #endif - } + if (labs(de * e_factor[extruder]) > (int32_t)axis_steps_per_mm[E_AXIS_N] * (EXTRUDE_MAXLENGTH)) { // It's not important to get max. extrusion length in a precision < 1mm, so save some cycles and cast to int + 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(); SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); } #endif // PREVENT_LENGTHY_EXTRUDE } - #endif // PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE + #endif // !LIN_ADVANCE && (PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE) // Compute direction bit-mask for this block uint8_t dm = 0; @@ -1708,11 +780,6 @@ bool Planner::_populate_block(block_t * const block, bool split_move, if (dc < 0) SBI(dm, Z_HEAD); // ...and Z if (db + dc < 0) SBI(dm, B_AXIS); // Motor B direction if (CORESIGN(db - dc) < 0) SBI(dm, C_AXIS); // Motor C direction - #elif ENABLED(HANGPRINTER) - if (da < 0) SBI(dm, A_AXIS); - if (db < 0) SBI(dm, B_AXIS); - if (dc < 0) SBI(dm, C_AXIS); - if (dd < 0) SBI(dm, D_AXIS); #else if (da < 0) SBI(dm, X_AXIS); if (db < 0) SBI(dm, Y_AXIS); @@ -1721,7 +788,17 @@ bool Planner::_populate_block(block_t * const block, bool split_move, if (de < 0) SBI(dm, E_AXIS); const float esteps_float = de * e_factor[extruder]; - const uint32_t esteps = ABS(esteps_float) + 0.5f; + const int32_t esteps = abs(esteps_float) + 0.5; + + // Calculate the buffer head after we push this byte + const uint8_t next_buffer_head = next_block_index(block_buffer_head); + + // If the buffer is full: good! That means we are well ahead of the robot. + // Rest here until there is room in the buffer. + while (block_buffer_tail == next_buffer_head) idle(); + + // Prepare to set up new block + block_t* block = &block_buffer[block_buffer_head]; // Clear all flags, including the "busy" bit block->flag = 0x00; @@ -1729,58 +806,37 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Set direction bits block->direction_bits = dm; - // Specify if block is to be counted or not - #if ENABLED(UNREGISTERED_MOVE_SUPPORT) - block->count_it = count_it; - #endif - // Number of steps for each axis // See http://www.corexy.com/theory.html #if CORE_IS_XY - block->steps[A_AXIS] = ABS(da + db); - block->steps[B_AXIS] = ABS(da - db); - block->steps[Z_AXIS] = ABS(dc); + block->steps[A_AXIS] = labs(da + db); + block->steps[B_AXIS] = labs(da - db); + block->steps[Z_AXIS] = labs(dc); #elif CORE_IS_XZ - block->steps[A_AXIS] = ABS(da + dc); - block->steps[Y_AXIS] = ABS(db); - block->steps[C_AXIS] = ABS(da - dc); + block->steps[A_AXIS] = labs(da + dc); + block->steps[Y_AXIS] = labs(db); + block->steps[C_AXIS] = labs(da - dc); #elif CORE_IS_YZ - block->steps[X_AXIS] = ABS(da); - block->steps[B_AXIS] = ABS(db + dc); - block->steps[C_AXIS] = ABS(db - dc); - #elif IS_SCARA - block->steps[A_AXIS] = ABS(da); - block->steps[B_AXIS] = ABS(db); - block->steps[Z_AXIS] = ABS(dc); - #elif ENABLED(HANGPRINTER) - block->steps[A_AXIS] = ABS(da); - block->steps[B_AXIS] = ABS(db); - block->steps[C_AXIS] = ABS(dc); - block->steps[D_AXIS] = ABS(dd); + block->steps[X_AXIS] = labs(da); + block->steps[B_AXIS] = labs(db + dc); + block->steps[C_AXIS] = labs(db - dc); #else // default non-h-bot planning - block->steps[A_AXIS] = ABS(da); - block->steps[B_AXIS] = ABS(db); - block->steps[C_AXIS] = ABS(dc); + block->steps[X_AXIS] = labs(da); + block->steps[Y_AXIS] = labs(db); + block->steps[Z_AXIS] = labs(dc); #endif block->steps[E_AXIS] = esteps; - - block->step_event_count = ( - #if ENABLED(HANGPRINTER) - MAX5(block->steps[A_AXIS], block->steps[B_AXIS], block->steps[C_AXIS], block->steps[D_AXIS], esteps) - #else - MAX4(block->steps[A_AXIS], block->steps[B_AXIS], block->steps[C_AXIS], esteps) - #endif - ); + block->step_event_count = MAX4(block->steps[X_AXIS], block->steps[Y_AXIS], block->steps[Z_AXIS], esteps); // Bail if this is a zero-length block - if (block->step_event_count < MIN_STEPS_PER_SEGMENT) return false; + if (block->step_event_count < MIN_STEPS_PER_SEGMENT) return; - // For a mixing extruder, get a magnified esteps for each + // 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_steps[i] = mixing_factor[i] * esteps; + block->mix_event_count[i] = mixing_factor[i] * block->step_event_count; #endif #if FAN_COUNT > 0 @@ -1794,12 +850,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, block->active_extruder = extruder; - #if ENABLED(AUTO_POWER_CONTROL) - if (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS]) - powerManager.power_on(); - #endif - - // Enable active axes + //enable active axes #if CORE_IS_XY if (block->steps[A_AXIS] || block->steps[B_AXIS]) { enable_X(); @@ -1820,7 +871,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, enable_Z(); } if (block->steps[X_AXIS]) enable_X(); - #elif DISABLED(HANGPRINTER) // Hangprinters X, Y, Z, E0 axes should always be enabled anyways + #else if (block->steps[X_AXIS]) enable_X(); if (block->steps[Y_AXIS]) enable_Y(); #if DISABLED(Z_LATE_ENABLE) @@ -1830,9 +881,6 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Enable extruder(s) if (esteps) { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder @@ -1841,8 +889,16 @@ bool Planner::_populate_block(block_t * const block, bool split_move, for (uint8_t i = 0; i < EXTRUDERS; i++) if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--; - switch (extruder) { + switch(extruder) { case 0: + enable_E0(); + g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2; + #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) + if (extruder_duplication_enabled) { + enable_E1(); + g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2; + } + #endif #if EXTRUDERS > 1 DISABLE_IDLE_E(1); #if EXTRUDERS > 2 @@ -1855,17 +911,11 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif // EXTRUDERS > 3 #endif // EXTRUDERS > 2 #endif // EXTRUDERS > 1 - enable_E0(); - g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2; - #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - if (extruder_duplication_enabled) { - enable_E1(); - g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2; - } - #endif break; #if EXTRUDERS > 1 case 1: + enable_E1(); + g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2; DISABLE_IDLE_E(0); #if EXTRUDERS > 2 DISABLE_IDLE_E(2); @@ -1876,11 +926,11 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif // EXTRUDERS > 4 #endif // EXTRUDERS > 3 #endif // EXTRUDERS > 2 - enable_E1(); - g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2; break; #if EXTRUDERS > 2 case 2: + enable_E2(); + g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2; DISABLE_IDLE_E(0); DISABLE_IDLE_E(1); #if EXTRUDERS > 3 @@ -1889,28 +939,26 @@ bool Planner::_populate_block(block_t * const block, bool split_move, DISABLE_IDLE_E(4); #endif #endif - enable_E2(); - g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2; break; #if EXTRUDERS > 3 case 3: + enable_E3(); + g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2; DISABLE_IDLE_E(0); DISABLE_IDLE_E(1); DISABLE_IDLE_E(2); #if EXTRUDERS > 4 DISABLE_IDLE_E(4); #endif - enable_E3(); - g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2; break; #if EXTRUDERS > 4 case 4: + enable_E4(); + g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2; DISABLE_IDLE_E(0); DISABLE_IDLE_E(1); DISABLE_IDLE_E(2); DISABLE_IDLE_E(3); - enable_E4(); - g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2; break; #endif // EXTRUDERS > 4 #endif // EXTRUDERS > 3 @@ -1961,24 +1009,17 @@ bool Planner::_populate_block(block_t * const block, bool split_move, delta_mm[C_AXIS] = CORESIGN(db - dc) * steps_to_mm[C_AXIS]; #endif #else - float delta_mm[NUM_AXIS]; - delta_mm[A_AXIS] = da * steps_to_mm[A_AXIS]; - delta_mm[B_AXIS] = db * steps_to_mm[B_AXIS]; - delta_mm[C_AXIS] = dc * steps_to_mm[C_AXIS]; - #if ENABLED(HANGPRINTER) - delta_mm[D_AXIS] = dd * steps_to_mm[D_AXIS]; - #endif + float delta_mm[XYZE]; + delta_mm[X_AXIS] = da * steps_to_mm[X_AXIS]; + delta_mm[Y_AXIS] = db * steps_to_mm[Y_AXIS]; + delta_mm[Z_AXIS] = dc * steps_to_mm[Z_AXIS]; #endif delta_mm[E_AXIS] = esteps_float * steps_to_mm[E_AXIS_N]; - if (block->steps[A_AXIS] < MIN_STEPS_PER_SEGMENT && block->steps[B_AXIS] < MIN_STEPS_PER_SEGMENT && block->steps[C_AXIS] < MIN_STEPS_PER_SEGMENT - #if ENABLED(HANGPRINTER) - && block->steps[D_AXIS] < MIN_STEPS_PER_SEGMENT - #endif - ) { - block->millimeters = ABS(delta_mm[E_AXIS]); + if (block->steps[X_AXIS] < MIN_STEPS_PER_SEGMENT && block->steps[Y_AXIS] < MIN_STEPS_PER_SEGMENT && block->steps[Z_AXIS] < MIN_STEPS_PER_SEGMENT) { + block->millimeters = FABS(delta_mm[E_AXIS]); } - else if (!millimeters) { + else { block->millimeters = SQRT( #if CORE_IS_XY sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_AXIS]) @@ -1986,29 +1027,23 @@ bool Planner::_populate_block(block_t * const block, bool split_move, sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_HEAD]) #elif CORE_IS_YZ sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_HEAD]) - #elif ENABLED(HANGPRINTER) - sq(delta_mm[A_AXIS]) + sq(delta_mm[B_AXIS]) + sq(delta_mm[C_AXIS]) + sq(delta_mm[D_AXIS]) #else sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_AXIS]) #endif ); } - else - block->millimeters = millimeters; - - const float inverse_millimeters = 1.0f / block->millimeters; // Inverse millimeters to remove multiple divides + const float inverse_millimeters = 1.0 / block->millimeters; // Inverse millimeters to remove multiple divides // Calculate inverse time for this move. No divide by zero due to previous checks. // Example: At 120mm/s a 60mm move takes 0.5s. So this will give 2.0. float inverse_secs = fr_mm_s * inverse_millimeters; - // Get the number of non busy movements in queue (non busy means that they can be altered) - const uint8_t moves_queued = nonbusy_movesplanned(); + const uint8_t moves_queued = movesplanned(); // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill #if ENABLED(SLOWDOWN) || ENABLED(ULTRA_LCD) || defined(XY_FREQUENCY_LIMIT) // Segment time im micro seconds - uint32_t segment_time_us = LROUND(1000000.0f / inverse_secs); + uint32_t segment_time_us = LROUND(1000000.0 / inverse_secs); #endif #if ENABLED(SLOWDOWN) @@ -2016,7 +1051,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, if (segment_time_us < min_segment_time_us) { // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. const uint32_t nst = segment_time_us + LROUND(2 * (min_segment_time_us - segment_time_us) / moves_queued); - inverse_secs = 1000000.0f / nst; + inverse_secs = 1000000.0 / nst; #if defined(XY_FREQUENCY_LIMIT) || ENABLED(ULTRA_LCD) segment_time_us = nst; #endif @@ -2025,16 +1060,12 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif #if ENABLED(ULTRA_LCD) - // Protect the access to the position. - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - block_buffer_runtime_us += segment_time_us; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); + CRITICAL_SECTION_START + block_buffer_runtime_us += segment_time_us; + CRITICAL_SECTION_END #endif - block->nominal_speed_sqr = sq(block->millimeters * inverse_secs); // (mm/sec)^2 Always > 0 + block->nominal_speed = block->millimeters * inverse_secs; // (mm/sec) Always > 0 block->nominal_rate = CEIL(block->step_event_count * inverse_secs); // (step/sec) Always > 0 #if ENABLED(FILAMENT_WIDTH_SENSOR) @@ -2056,7 +1087,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, while (filwidth_delay_dist >= MMD_MM) filwidth_delay_dist -= MMD_MM; // Convert into an index into the measurement array - filwidth_delay_index[0] = int8_t(filwidth_delay_dist * 0.1f); + filwidth_delay_index[0] = int8_t(filwidth_delay_dist * 0.1); // If the index has changed (must have gone forward)... if (filwidth_delay_index[0] != filwidth_delay_index[1]) { @@ -2072,9 +1103,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif // Calculate and limit speed in mm/sec for each axis - float current_speed[NUM_AXIS], speed_factor = 1.0f; // factor <1 decreases speed - LOOP_NUM_AXIS(i) { - const float cs = ABS((current_speed[i] = delta_mm[i] * inverse_secs)); + float current_speed[NUM_AXIS], speed_factor = 1.0; // factor <1 decreases speed + LOOP_XYZE(i) { + const float cs = FABS((current_speed[i] = delta_mm[i] * inverse_secs)); #if ENABLED(DISTINCT_E_FACTORS) if (i == E_AXIS) i += extruder; #endif @@ -2112,7 +1143,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, const uint32_t max_x_segment_time = MAX3(xs0, xs1, xs2), max_y_segment_time = MAX3(ys0, ys1, ys2), - min_xy_segment_time = MIN(max_x_segment_time, max_y_segment_time); + min_xy_segment_time = min(max_x_segment_time, max_y_segment_time); if (min_xy_segment_time < MAX_FREQ_TIME_US) { const float low_sf = speed_factor * min_xy_segment_time / (MAX_FREQ_TIME_US); NOMORE(speed_factor, low_sf); @@ -2120,25 +1151,18 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif // XY_FREQUENCY_LIMIT // Correct the speed - if (speed_factor < 1.0f) { - LOOP_NUM_AXIS(i) current_speed[i] *= speed_factor; + if (speed_factor < 1.0) { + LOOP_XYZE(i) current_speed[i] *= speed_factor; + block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; - block->nominal_speed_sqr = block->nominal_speed_sqr * sq(speed_factor); } // Compute and limit the acceleration rate for the trapezoid generator. const float steps_per_mm = block->step_event_count * inverse_millimeters; uint32_t accel; - if (!block->steps[A_AXIS] && !block->steps[B_AXIS] && !block->steps[C_AXIS] - #if ENABLED(HANGPRINTER) - && !block->steps[D_AXIS] - #endif - ) { + if (!block->steps[X_AXIS] && !block->steps[Y_AXIS] && !block->steps[Z_AXIS]) { // convert to: acceleration steps/sec^2 accel = CEIL(retract_acceleration * steps_per_mm); - #if ENABLED(LIN_ADVANCE) - block->use_advance_lead = false; - #endif } else { #define LIMIT_ACCEL_LONG(AXIS,INDX) do{ \ @@ -2158,57 +1182,6 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Start with print or travel acceleration accel = CEIL((esteps ? acceleration : travel_acceleration) * steps_per_mm); - #if ENABLED(LIN_ADVANCE) - - #if ENABLED(JUNCTION_DEVIATION) - #if ENABLED(DISTINCT_E_FACTORS) - #define MAX_E_JERK max_e_jerk[extruder] - #else - #define MAX_E_JERK max_e_jerk - #endif - #else - #define MAX_E_JERK max_jerk[E_AXIS] - #endif - - /** - * - * Use LIN_ADVANCE for blocks if all these are true: - * - * esteps : This is a print move, because we checked for A, B, C steps before. - * - * extruder_advance_K : There is an advance factor set. - * - * de > 0 : Extruder is running forward (e.g., for "Wipe while retracting" (Slic3r) or "Combing" (Cura) moves) - */ - block->use_advance_lead = esteps - && extruder_advance_K - && de > 0; - - if (block->use_advance_lead) { - block->e_D_ratio = (target_float[E_AXIS] - position_float[E_AXIS]) / - #if IS_KINEMATIC - block->millimeters - #else - SQRT(sq(target_float[X_AXIS] - position_float[X_AXIS]) - + sq(target_float[Y_AXIS] - position_float[Y_AXIS]) - + sq(target_float[Z_AXIS] - position_float[Z_AXIS])) - #endif - ; - - // Check for unusual high e_D ratio to detect if a retract move was combined with the last print move due to min. steps per segment. Never execute this with advance! - // This assumes no one will use a retract length of 0mm < retr_length < ~0.2mm and no one will print 100mm wide lines using 3mm filament or 35mm wide lines using 1.75mm filament. - if (block->e_D_ratio > 3.0f) - block->use_advance_lead = false; - else { - const uint32_t max_accel_steps_per_s2 = MAX_E_JERK / (extruder_advance_K * block->e_D_ratio) * steps_per_mm; - #if ENABLED(LA_DEBUG) - if (accel > max_accel_steps_per_s2) SERIAL_ECHOLNPGM("Acceleration limited."); - #endif - NOMORE(accel, max_accel_steps_per_s2); - } - } - #endif - #if ENABLED(DISTINCT_E_FACTORS) #define ACCEL_IDX extruder #else @@ -2217,233 +1190,158 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Limit acceleration per axis if (block->step_event_count <= cutoff_long) { - LIMIT_ACCEL_LONG(A_AXIS, 0); - LIMIT_ACCEL_LONG(B_AXIS, 0); - LIMIT_ACCEL_LONG(C_AXIS, 0); - #if ENABLED(HANGPRINTER) - LIMIT_ACCEL_LONG(D_AXIS, 0); - #endif + LIMIT_ACCEL_LONG(X_AXIS, 0); + LIMIT_ACCEL_LONG(Y_AXIS, 0); + LIMIT_ACCEL_LONG(Z_AXIS, 0); LIMIT_ACCEL_LONG(E_AXIS, ACCEL_IDX); } else { - LIMIT_ACCEL_FLOAT(A_AXIS, 0); - LIMIT_ACCEL_FLOAT(B_AXIS, 0); - LIMIT_ACCEL_FLOAT(C_AXIS, 0); - #if ENABLED(HANGPRINTER) - LIMIT_ACCEL_FLOAT(D_AXIS, 0); - #endif + LIMIT_ACCEL_FLOAT(X_AXIS, 0); + LIMIT_ACCEL_FLOAT(Y_AXIS, 0); + LIMIT_ACCEL_FLOAT(Z_AXIS, 0); LIMIT_ACCEL_FLOAT(E_AXIS, ACCEL_IDX); } } block->acceleration_steps_per_s2 = accel; block->acceleration = accel / steps_per_mm; - #if DISABLED(S_CURVE_ACCELERATION) - block->acceleration_rate = (uint32_t)(accel * (4096.0f * 4096.0f / (STEPPER_TIMER_RATE))); - #endif - #if ENABLED(LIN_ADVANCE) - if (block->use_advance_lead) { - block->advance_speed = (STEPPER_TIMER_RATE) / (extruder_advance_K * block->e_D_ratio * block->acceleration * axis_steps_per_mm[E_AXIS_N]); - #if ENABLED(LA_DEBUG) - if (extruder_advance_K * block->e_D_ratio * block->acceleration * 2 < SQRT(block->nominal_speed_sqr) * block->e_D_ratio) - SERIAL_ECHOLNPGM("More than 2 steps per eISR loop executed."); - if (block->advance_speed < 200) - SERIAL_ECHOLNPGM("eISR running at > 10kHz."); - #endif - } - #endif + block->acceleration_rate = (long)(accel * 16777216.0 / ((F_CPU) * 0.125)); // * 8.388608 - float vmax_junction_sqr; // Initial limit on the segment entry velocity (mm/s)^2 + // Initial limit on the segment entry velocity + float vmax_junction; - #if ENABLED(JUNCTION_DEVIATION) + #if 0 // Use old jerk for now - /** - * Compute maximum allowable entry speed at junction by centripetal acceleration approximation. - * Let a circle be tangent to both previous and current path line segments, where the junction - * deviation is defined as the distance from the junction to the closest edge of the circle, - * colinear with the circle center. The circular segment joining the two paths represents the - * path of centripetal acceleration. Solve for max velocity based on max acceleration about the - * radius of the circle, defined indirectly by junction deviation. This may be also viewed as - * path width or max_jerk in the previous Grbl version. This approach does not actually deviate - * from path, but used as a robust way to compute cornering speeds, as it takes into account the - * nonlinearities of both the junction angle and junction velocity. - * - * NOTE: If the junction deviation value is finite, Grbl executes the motions in an exact path - * mode (G61). If the junction deviation value is zero, Grbl will execute the motion in an exact - * stop mode (G61.1) manner. In the future, if continuous mode (G64) is desired, the math here - * is exactly the same. Instead of motioning all the way to junction point, the machine will - * just follow the arc circle defined here. The Arduino doesn't have the CPU cycles to perform - * a continuous mode path, but ARM-based microcontrollers most certainly do. - * - * NOTE: The max junction speed is a fixed value, since machine acceleration limits cannot be - * changed dynamically during operation nor can the line move geometry. This must be kept in - * memory in the event of a feedrate override changing the nominal speeds of blocks, which can - * change the overall maximum entry speed conditions of all blocks. - * - * ####### - * https://github.com/MarlinFirmware/Marlin/issues/10341#issuecomment-388191754 - * - * hoffbaked: on May 10 2018 tuned and improved the GRBL algorithm for Marlin: - Okay! It seems to be working good. I somewhat arbitrarily cut it off at 1mm - on then on anything with less sides than an octagon. With this, and the - reverse pass actually recalculating things, a corner acceleration value - of 1000 junction deviation of .05 are pretty reasonable. If the cycles - can be spared, a better acos could be used. For all I know, it may be - already calculated in a different place. */ + float junction_deviation = 0.1; - // Unit vector of previous path line segment - static float previous_unit_vec[XYZE]; - - float unit_vec[] = { - delta_mm[A_AXIS] * inverse_millimeters, - delta_mm[B_AXIS] * inverse_millimeters, - delta_mm[C_AXIS] * inverse_millimeters, - delta_mm[E_AXIS] * inverse_millimeters + // Compute path unit vector + double unit_vec[XYZ] = { + delta_mm[X_AXIS] * inverse_millimeters, + delta_mm[Y_AXIS] * inverse_millimeters, + delta_mm[Z_AXIS] * inverse_millimeters }; + /* + Compute maximum allowable entry speed at junction by centripetal acceleration approximation. + + Let a circle be tangent to both previous and current path line segments, where the junction + deviation is defined as the distance from the junction to the closest edge of the circle, + collinear with the circle center. + + The circular segment joining the two paths represents the path of centripetal acceleration. + Solve for max velocity based on max acceleration about the radius of the circle, defined + indirectly by junction deviation. + + This may be also viewed as path width or max_jerk in the previous grbl version. This approach + does not actually deviate from path, but used as a robust way to compute cornering speeds, as + it takes into account the nonlinearities of both the junction angle and junction velocity. + */ + + vmax_junction = MINIMUM_PLANNER_SPEED; // Set default max junction speed + // Skip first block or when previous_nominal_speed is used as a flag for homing and offset cycles. - if (moves_queued && !UNEAR_ZERO(previous_nominal_speed_sqr)) { + if (moves_queued && !UNEAR_ZERO(previous_nominal_speed)) { // Compute cosine of angle between previous and current path. (prev_unit_vec is negative) // NOTE: Max junction velocity is computed without sin() or acos() by trig half angle identity. - float junction_cos_theta = -previous_unit_vec[X_AXIS] * unit_vec[X_AXIS] - -previous_unit_vec[Y_AXIS] * unit_vec[Y_AXIS] - -previous_unit_vec[Z_AXIS] * unit_vec[Z_AXIS] - -previous_unit_vec[E_AXIS] * unit_vec[E_AXIS] - ; + const float cos_theta = - previous_unit_vec[X_AXIS] * unit_vec[X_AXIS] + - previous_unit_vec[Y_AXIS] * unit_vec[Y_AXIS] + - previous_unit_vec[Z_AXIS] * unit_vec[Z_AXIS]; + // Skip and use default max junction speed for 0 degree acute junction. + if (cos_theta < 0.95) { + vmax_junction = min(previous_nominal_speed, block->nominal_speed); + // Skip and avoid divide by zero for straight junctions at 180 degrees. Limit to min() of nominal speeds. + if (cos_theta > -0.95) { + // Compute maximum junction velocity based on maximum acceleration and junction deviation + float sin_theta_d2 = SQRT(0.5 * (1.0 - cos_theta)); // Trig half angle identity. Always positive. + NOMORE(vmax_junction, SQRT(block->acceleration * junction_deviation * sin_theta_d2 / (1.0 - sin_theta_d2))); + } + } + } + #endif - // NOTE: Computed without any expensive trig, sin() or acos(), by trig half angle identity of cos(theta). - if (junction_cos_theta > 0.999999f) { - // For a 0 degree acute junction, just set minimum junction speed. - vmax_junction_sqr = sq(float(MINIMUM_PLANNER_SPEED)); + /** + * Adapted from Průša MKS firmware + * https://github.com/prusa3d/Prusa-Firmware + * + * Start with a safe speed (from which the machine may halt to stop immediately). + */ + + // Exit speed limited by a jerk to full halt of a previous last segment + static float previous_safe_speed; + + float safe_speed = block->nominal_speed; + uint8_t limited = 0; + LOOP_XYZE(i) { + const float jerk = FABS(current_speed[i]), maxj = max_jerk[i]; + if (jerk > maxj) { + if (limited) { + const float mjerk = maxj * block->nominal_speed; + if (jerk * safe_speed > mjerk) safe_speed = mjerk / jerk; } else { - NOLESS(junction_cos_theta, -0.999999f); // Check for numerical round-off to avoid divide by zero. - - // Convert delta vector to unit vector - float junction_unit_vec[XYZE] = { - unit_vec[X_AXIS] - previous_unit_vec[X_AXIS], - unit_vec[Y_AXIS] - previous_unit_vec[Y_AXIS], - unit_vec[Z_AXIS] - previous_unit_vec[Z_AXIS], - unit_vec[E_AXIS] - previous_unit_vec[E_AXIS] - }; - normalize_junction_vector(junction_unit_vec); - - const float junction_acceleration = limit_value_by_axis_maximum(block->acceleration, junction_unit_vec), - sin_theta_d2 = SQRT(0.5f * (1.0f - junction_cos_theta)); // Trig half angle identity. Always positive. - - vmax_junction_sqr = (junction_acceleration * junction_deviation_mm * sin_theta_d2) / (1.0f - sin_theta_d2); - if (block->millimeters < 1) { - - // Fast acos approximation, minus the error bar to be safe - const float junction_theta = (RADIANS(-40) * sq(junction_cos_theta) - RADIANS(50)) * junction_cos_theta + RADIANS(90) - 0.18f; - - // If angle is greater than 135 degrees (octagon), find speed for approximate arc - if (junction_theta > RADIANS(135)) { - const float limit_sqr = block->millimeters / (RADIANS(180) - junction_theta) * junction_acceleration; - NOMORE(vmax_junction_sqr, limit_sqr); - } - } - } - - // Get the lowest speed - vmax_junction_sqr = MIN3(vmax_junction_sqr, block->nominal_speed_sqr, previous_nominal_speed_sqr); - } - else // Init entry speed to zero. Assume it starts from rest. Planner will correct this later. - vmax_junction_sqr = 0; - - COPY(previous_unit_vec, unit_vec); - - #else // Classic Jerk Limiting - - /** - * Adapted from Průša MKS firmware - * https://github.com/prusa3d/Prusa-Firmware - */ - const float nominal_speed = SQRT(block->nominal_speed_sqr); - - // Exit speed limited by a jerk to full halt of a previous last segment - static float previous_safe_speed; - - // Start with a safe speed (from which the machine may halt to stop immediately). - float safe_speed = nominal_speed; - - uint8_t limited = 0; - LOOP_NUM_AXIS(i) { - const float jerk = ABS(current_speed[i]), // cs : Starting from zero, change in speed for this axis - maxj = max_jerk[i]; // mj : The max jerk setting for this axis - if (jerk > maxj) { // cs > mj : New current speed too fast? - if (limited) { // limited already? - const float mjerk = nominal_speed * maxj; // ns*mj - if (jerk * safe_speed > mjerk) safe_speed = mjerk / jerk; // ns*mj/cs - } - else { - safe_speed *= maxj / jerk; // Initial limit: ns*mj/cs - ++limited; // Initially limited - } + ++limited; + safe_speed = maxj; } } + } - float vmax_junction; - if (moves_queued && !UNEAR_ZERO(previous_nominal_speed_sqr)) { - // Estimate a maximum velocity allowed at a joint of two successive segments. - // If this maximum velocity allowed is lower than the minimum of the entry / exit safe velocities, - // then the machine is not coasting anymore and the safe entry / exit velocities shall be used. + if (moves_queued && !UNEAR_ZERO(previous_nominal_speed)) { + // Estimate a maximum velocity allowed at a joint of two successive segments. + // If this maximum velocity allowed is lower than the minimum of the entry / exit safe velocities, + // then the machine is not coasting anymore and the safe entry / exit velocities shall be used. - // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. - float v_factor = 1; - limited = 0; + // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum. + // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting. + vmax_junction = min(block->nominal_speed, previous_nominal_speed); - // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum. - // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting. - const float previous_nominal_speed = SQRT(previous_nominal_speed_sqr); - vmax_junction = MIN(nominal_speed, previous_nominal_speed); + // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. + float v_factor = 1; + limited = 0; - // Now limit the jerk in all axes. - const float smaller_speed_factor = vmax_junction / previous_nominal_speed; - LOOP_NUM_AXIS(axis) { - // Limit an axis. We have to differentiate: coasting, reversal of an axis, full stop. - float v_exit = previous_speed[axis] * smaller_speed_factor, - v_entry = current_speed[axis]; - if (limited) { - v_exit *= v_factor; - v_entry *= v_factor; - } - - // Calculate jerk depending on whether the axis is coasting in the same direction or reversing. - const float jerk = (v_exit > v_entry) - ? // coasting axis reversal - ( (v_entry > 0 || v_exit < 0) ? (v_exit - v_entry) : MAX(v_exit, -v_entry) ) - : // v_exit <= v_entry coasting axis reversal - ( (v_entry < 0 || v_exit > 0) ? (v_entry - v_exit) : MAX(-v_exit, v_entry) ); - - if (jerk > max_jerk[axis]) { - v_factor *= max_jerk[axis] / jerk; - ++limited; - } + // Now limit the jerk in all axes. + const float smaller_speed_factor = vmax_junction / previous_nominal_speed; + LOOP_XYZE(axis) { + // Limit an axis. We have to differentiate: coasting, reversal of an axis, full stop. + float v_exit = previous_speed[axis] * smaller_speed_factor, + v_entry = current_speed[axis]; + if (limited) { + v_exit *= v_factor; + v_entry *= v_factor; + } + + // Calculate jerk depending on whether the axis is coasting in the same direction or reversing. + const float jerk = (v_exit > v_entry) + ? // coasting axis reversal + ( (v_entry > 0 || v_exit < 0) ? (v_exit - v_entry) : max(v_exit, -v_entry) ) + : // v_exit <= v_entry coasting axis reversal + ( (v_entry < 0 || v_exit > 0) ? (v_entry - v_exit) : max(-v_exit, v_entry) ); + + if (jerk > max_jerk[axis]) { + v_factor *= max_jerk[axis] / jerk; + ++limited; } - if (limited) vmax_junction *= v_factor; - // Now the transition velocity is known, which maximizes the shared exit / entry velocity while - // respecting the jerk factors, it may be possible, that applying separate safe exit / entry velocities will achieve faster prints. - const float vmax_junction_threshold = vmax_junction * 0.99f; - if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) - vmax_junction = safe_speed; } - else + if (limited) vmax_junction *= v_factor; + // Now the transition velocity is known, which maximizes the shared exit / entry velocity while + // respecting the jerk factors, it may be possible, that applying separate safe exit / entry velocities will achieve faster prints. + const float vmax_junction_threshold = vmax_junction * 0.99f; + if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { + // Not coasting. The machine will stop and start the movements anyway, + // better to start the segment from start. + SBI(block->flag, BLOCK_BIT_START_FROM_FULL_HALT); vmax_junction = safe_speed; - - previous_safe_speed = safe_speed; - vmax_junction_sqr = sq(vmax_junction); - - #endif // Classic Jerk Limiting + } + } + else { + SBI(block->flag, BLOCK_BIT_START_FROM_FULL_HALT); + vmax_junction = safe_speed; + } // Max entry speed of this block equals the max exit speed of the previous block. - block->max_entry_speed_sqr = vmax_junction_sqr; + block->max_entry_speed = vmax_junction; // Initialize block entry speed. Compute based on deceleration to user-defined MINIMUM_PLANNER_SPEED. - const float v_allowable_sqr = max_allowable_speed_sqr(-block->acceleration, sq(float(MINIMUM_PLANNER_SPEED)), block->millimeters); - - // If we are trying to add a split block, start with the - // max. allowed speed to avoid an interrupted first move. - block->entry_speed_sqr = !split_move ? sq(float(MINIMUM_PLANNER_SPEED)) : MIN(vmax_junction_sqr, v_allowable_sqr); + const float v_allowable = max_allowable_speed(-block->acceleration, MINIMUM_PLANNER_SPEED, block->millimeters); + block->entry_speed = min(vmax_junction, v_allowable); // Initialize planner efficiency flags // Set flag if block will always reach maximum junction speed regardless of entry/exit speeds. @@ -2453,69 +1351,55 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // block nominal speed limits both the current and next maximum junction speeds. Hence, in both // the reverse and forward planners, the corresponding block junction speed will always be at the // the maximum junction speed and may always be ignored for any speed reduction checks. - block->flag |= block->nominal_speed_sqr <= v_allowable_sqr ? BLOCK_FLAG_RECALCULATE | BLOCK_FLAG_NOMINAL_LENGTH : BLOCK_FLAG_RECALCULATE; + block->flag |= BLOCK_FLAG_RECALCULATE | (block->nominal_speed <= v_allowable ? BLOCK_FLAG_NOMINAL_LENGTH : 0); // Update previous path unit_vector and nominal speed COPY(previous_speed, current_speed); - previous_nominal_speed_sqr = block->nominal_speed_sqr; + previous_nominal_speed = block->nominal_speed; + previous_safe_speed = safe_speed; - // Update the position (only when a move was queued) - static_assert(COUNT(target) > 1, "Parameter to _populate_block must be (&target)[" - #if ENABLED(HANGPRINTER) - "ABCD" - #else - "XYZ" - #endif - "E]!" - ); + #if ENABLED(LIN_ADVANCE) + /** + * + * Use LIN_ADVANCE for blocks if all these are true: + * + * esteps && (block->steps[X_AXIS] || block->steps[Y_AXIS]) : This is a print move + * + * extruder_advance_k : There is an advance factor set. + * + * esteps != block->step_event_count : A problem occurs if the move before a retract is too small. + * In that case, the retract and move will be executed together. + * This leads to too many advance steps due to a huge e_acceleration. + * The math is good, but we must avoid retract moves with advance! + * lin_dist_e > 0 : Extruder is running forward (e.g., for "Wipe while retracting" (Slic3r) or "Combing" (Cura) moves) + */ + block->use_advance_lead = esteps && (block->steps[X_AXIS] || block->steps[Y_AXIS]) + && extruder_advance_k + && (uint32_t)esteps != block->step_event_count + && lin_dist_e > 0; + if (block->use_advance_lead) + block->abs_adv_steps_multiplier8 = LROUND( + extruder_advance_k + * (UNEAR_ZERO(advance_ed_ratio) ? lin_dist_e / lin_dist_xy : advance_ed_ratio) // Use the fixed ratio, if set + * (block->nominal_speed / (float)block->nominal_rate) + * axis_steps_per_mm[E_AXIS_N] * 256.0 + ); - if (COUNT_MOVE) { - COPY(position, target); - #if HAS_POSITION_FLOAT - COPY(position_float, target_float); - #endif - } + #endif // LIN_ADVANCE - // Movement was accepted - return true; -} // _populate_block() - -/** - * Planner::buffer_sync_block - * Add a block to the buffer that just updates the position - */ -void Planner::buffer_sync_block() { - // Wait for the next available block - uint8_t next_buffer_head; - block_t * const block = get_next_free_block(next_buffer_head); - - // Clear block - memset(block, 0, sizeof(block_t)); - - block->flag = BLOCK_FLAG_SYNC_POSITION; - - block->position[A_AXIS] = position[A_AXIS]; - block->position[B_AXIS] = position[B_AXIS]; - block->position[C_AXIS] = position[C_AXIS]; - #if ENABLED(HANGPRINTER) - block->position[D_AXIS] = position[D_AXIS]; - #endif - block->position[E_AXIS] = position[E_AXIS]; - - // If this is the first added movement, reload the delay, otherwise, cancel it. - if (block_buffer_head == block_buffer_tail) { - // If it was the first queued block, restart the 1st block delivery delay, to - // give the planner an opportunity to queue more movements and plan them - // As there are no queued movements, the Stepper ISR will not touch this - // variable, so there is no risk setting this here (but it MUST be done - // before the following line!!) - delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - } + const float bnsr = 1.0 / block->nominal_speed; + calculate_trapezoid_for_block(block, block->entry_speed * bnsr, safe_speed * bnsr); + // Move buffer head block_buffer_head = next_buffer_head; - stepper.wake_up(); -} // buffer_sync_block() + // Update the position (only when a move was queued) + static_assert(COUNT(target) > 1, "Parameter to _buffer_steps must be (&target)[XYZE]!"); + COPY(position, target); + + recalculate(); + +} // _buffer_steps() /** * Planner::buffer_segment @@ -2524,24 +1408,11 @@ void Planner::buffer_sync_block() { * * Leveling and kinematics should be applied ahead of calling this. * - * a,b,c,e - target positions in mm and/or degrees - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known + * a,b,c,e - target positions in mm and/or degrees + * fr_mm_s - (target) speed of the move + * extruder - target extruder */ -bool Planner::buffer_segment(const float &a, const float &b, const float &c - #if ENABLED(HANGPRINTER) - , const float &d - #endif - , const float &e, const float &fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/ - #if ENABLED(UNREGISTERED_MOVE_SUPPORT) - , bool count_it /* = true */ - #endif -) { - - // If we are cleaning, do not accept queuing of movements - if (cleaning_buffer_counter) return false; - +void Planner::buffer_segment(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder) { // When changing extruders recalculate steps corresponding to the E position #if ENABLED(DISTINCT_E_FACTORS) if (last_extruder != extruder && axis_steps_per_mm[E_AXIS_N] != axis_steps_per_mm[E_AXIS + last_extruder]) { @@ -2552,42 +1423,55 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c // The target position of the tool in absolute steps // Calculate target position in absolute steps - const int32_t target[NUM_AXIS] = { - #if ENABLED(LINE_BUILDUP_COMPENSATION_FEATURE) - LROUND(k0[A_AXIS] * (SQRT(k1[A_AXIS] + a * k2[A_AXIS]) - sqrtk1[A_AXIS])), - LROUND(k0[B_AXIS] * (SQRT(k1[B_AXIS] + b * k2[B_AXIS]) - sqrtk1[B_AXIS])), - LROUND(k0[C_AXIS] * (SQRT(k1[C_AXIS] + c * k2[C_AXIS]) - sqrtk1[C_AXIS])), - LROUND(k0[D_AXIS] * (SQRT(k1[D_AXIS] + d * k2[D_AXIS]) - sqrtk1[D_AXIS])), - #else - LROUND(a * axis_steps_per_mm[A_AXIS]), - LROUND(b * axis_steps_per_mm[B_AXIS]), - LROUND(c * axis_steps_per_mm[C_AXIS]), - #if ENABLED(HANGPRINTER) - LROUND(d * axis_steps_per_mm[D_AXIS]), - #endif - #endif + const int32_t target[XYZE] = { + LROUND(a * axis_steps_per_mm[X_AXIS]), + LROUND(b * axis_steps_per_mm[Y_AXIS]), + LROUND(c * axis_steps_per_mm[Z_AXIS]), LROUND(e * axis_steps_per_mm[E_AXIS_N]) }; - #if HAS_POSITION_FLOAT - const float target_float[NUM_AXIS] = { a, b, c - #if ENABLED(HANGPRINTER) - , d - #endif - , e - }; - #endif - // DRYRUN prevents E moves from taking place if (DEBUGGING(DRYRUN)) { - if (COUNT_MOVE) { - position[E_AXIS] = target[E_AXIS]; - #if HAS_POSITION_FLOAT - position_float[E_AXIS] = e; - #endif - } + position[E_AXIS] = target[E_AXIS]; + #if ENABLED(LIN_ADVANCE) + position_float[E_AXIS] = e; + #endif } + #if ENABLED(LIN_ADVANCE) + lin_dist_e = e - position_float[E_AXIS]; + #endif + + // If LIN_ADVANCE is enabled then do E move prevention with floats + // Otherwise it's done in _buffer_steps. + #if ENABLED(LIN_ADVANCE) && (ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE)) + if (lin_dist_e) { + #if ENABLED(PREVENT_COLD_EXTRUSION) + if (thermalManager.tooColdToExtrude(extruder)) { + position_float[E_AXIS] = e; // Behave as if the move really took place, but ignore E part + position[E_AXIS] = target[E_AXIS]; + lin_dist_e = 0; + SERIAL_ECHO_START(); + SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); + } + #endif // PREVENT_COLD_EXTRUSION + #if ENABLED(PREVENT_LENGTHY_EXTRUDE) + if (lin_dist_e * e_factor[extruder] > (EXTRUDE_MAXLENGTH)) { + position_float[E_AXIS] = e; // Behave as if the move really took place, but ignore E part + position[E_AXIS] = target[E_AXIS]; + lin_dist_e = 0; + SERIAL_ECHO_START(); + SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); + } + #endif // PREVENT_LENGTHY_EXTRUDE + } + #endif // LIN_ADVANCE && (PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE) + + #if ENABLED(LIN_ADVANCE) + if (lin_dist_e > 0) + lin_dist_xy = HYPOT(a - position_float[X_AXIS], b - position_float[Y_AXIS]); + #endif + /* <-- add a slash to enable SERIAL_ECHOPAIR(" buffer_segment FR:", fr_mm_s); #if IS_KINEMATIC @@ -2603,39 +1487,56 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c #endif SERIAL_ECHOPAIR(" (", position[Y_AXIS]); SERIAL_ECHOPAIR("->", target[Y_AXIS]); - #if ENABLED(DELTA) || ENABLED(HANGPRINTER) + #if ENABLED(DELTA) SERIAL_ECHOPAIR(") C:", c); #else SERIAL_ECHOPAIR(") Z:", c); #endif SERIAL_ECHOPAIR(" (", position[Z_AXIS]); SERIAL_ECHOPAIR("->", target[Z_AXIS]); - #if ENABLED(HANGPRINTER) - SERIAL_ECHOPAIR(") D:", d); - SERIAL_ECHOPAIR(" (", position[D_AXIS]); - SERIAL_ECHOPAIR("->", target[D_AXIS]); - #endif SERIAL_ECHOPAIR(") E:", e); SERIAL_ECHOPAIR(" (", position[E_AXIS]); SERIAL_ECHOPAIR("->", target[E_AXIS]); SERIAL_ECHOLNPGM(")"); //*/ - // Queue the movement - if ( - !_buffer_steps(target - #if HAS_POSITION_FLOAT - , target_float - #endif - , fr_mm_s, extruder, millimeters - #if ENABLED(UNREGISTERED_MOVE_SUPPORT) - , count_it - #endif - ) - ) return false; + // Always split the first move into two (if not homing or probing) + if (!blocks_queued()) { + + #define _BETWEEN(A) (position[A##_AXIS] + target[A##_AXIS]) >> 1 + const int32_t between[XYZE] = { _BETWEEN(X), _BETWEEN(Y), _BETWEEN(Z), _BETWEEN(E) }; + DISABLE_STEPPER_DRIVER_INTERRUPT(); + + #if ENABLED(LIN_ADVANCE) + lin_dist_xy *= 0.5; + lin_dist_e *= 0.5; + #endif + + _buffer_steps(between, fr_mm_s, extruder); + + #if ENABLED(LIN_ADVANCE) + position_float[X_AXIS] = (position_float[X_AXIS] + a) * 0.5; + position_float[Y_AXIS] = (position_float[Y_AXIS] + b) * 0.5; + //position_float[Z_AXIS] = (position_float[Z_AXIS] + c) * 0.5; + position_float[E_AXIS] = (position_float[E_AXIS] + e) * 0.5; + #endif + + const uint8_t next = block_buffer_head; + _buffer_steps(target, fr_mm_s, extruder); + SBI(block_buffer[next].flag, BLOCK_BIT_CONTINUED); + ENABLE_STEPPER_DRIVER_INTERRUPT(); + } + else + _buffer_steps(target, fr_mm_s, extruder); stepper.wake_up(); - return true; + + #if ENABLED(LIN_ADVANCE) + position_float[X_AXIS] = a; + position_float[Y_AXIS] = b; + //position_float[Z_AXIS] = c; + position_float[E_AXIS] = e; + #endif } // buffer_segment() /** @@ -2645,78 +1546,59 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c * On CORE machines stepper ABC will be translated from the given XYZ. */ -void Planner::_set_position_mm(const float &a, const float &b, const float &c - #if ENABLED(HANGPRINTER) - , const float &d - #endif - , const float &e -) { +void Planner::_set_position_mm(const float &a, const float &b, const float &c, const float &e) { #if ENABLED(DISTINCT_E_FACTORS) + #define _EINDEX (E_AXIS + active_extruder) last_extruder = active_extruder; - #endif - #if ENABLED(LINE_BUILDUP_COMPENSATION_FEATURE) - position[A_AXIS] = LROUND(k0[A_AXIS] * (SQRT(k1[A_AXIS] + a * k2[A_AXIS]) - sqrtk1[A_AXIS])), - position[B_AXIS] = LROUND(k0[B_AXIS] * (SQRT(k1[B_AXIS] + b * k2[B_AXIS]) - sqrtk1[B_AXIS])), - position[C_AXIS] = LROUND(k0[C_AXIS] * (SQRT(k1[C_AXIS] + c * k2[C_AXIS]) - sqrtk1[C_AXIS])), - position[D_AXIS] = LROUND(k0[D_AXIS] * (SQRT(k1[D_AXIS] + d * k2[D_AXIS]) - sqrtk1[D_AXIS])), #else - position[A_AXIS] = LROUND(a * axis_steps_per_mm[A_AXIS]); - position[B_AXIS] = LROUND(b * axis_steps_per_mm[B_AXIS]); - position[C_AXIS] = LROUND(axis_steps_per_mm[C_AXIS] * (c + ( - #if !IS_KINEMATIC && ENABLED(AUTO_BED_LEVELING_UBL) - leveling_active ? ubl.get_z_correction(a, b) : - #endif - 0) - )); - #if ENABLED(HANGPRINTER) - position[D_AXIS] = LROUND(d * axis_steps_per_mm[D_AXIS]), - #endif + #define _EINDEX E_AXIS #endif - position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]); - #if HAS_POSITION_FLOAT - position_float[A_AXIS] = a; - position_float[B_AXIS] = b; - position_float[C_AXIS] = c; - #if ENABLED(HANGPRINTER) - position_float[D_AXIS] = d; - #endif + const int32_t na = position[X_AXIS] = LROUND(a * axis_steps_per_mm[X_AXIS]), + nb = position[Y_AXIS] = LROUND(b * axis_steps_per_mm[Y_AXIS]), + nc = position[Z_AXIS] = LROUND(c * axis_steps_per_mm[Z_AXIS]), + ne = position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]); + #if ENABLED(LIN_ADVANCE) + position_float[X_AXIS] = a; + position_float[Y_AXIS] = b; + //position_float[Z_AXIS] = c; position_float[E_AXIS] = e; #endif - if (has_blocks_queued()) { - //previous_nominal_speed_sqr = 0.0; // Reset planner junction speeds. Assume start from rest. - //ZERO(previous_speed); - buffer_sync_block(); - } - else - stepper.set_position(position[A_AXIS], position[B_AXIS], position[C_AXIS], - #if ENABLED(HANGPRINTER) - position[D_AXIS], - #endif - position[E_AXIS] - ); + stepper.set_position(na, nb, nc, ne); + previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. + ZERO(previous_speed); } void Planner::set_position_mm_kinematic(const float (&cart)[XYZE]) { #if PLANNER_LEVELING float raw[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] }; apply_leveling(raw); - #elif ENABLED(HANGPRINTER) - float raw[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] }; #else const float (&raw)[XYZE] = cart; #endif #if IS_KINEMATIC inverse_kinematics(raw); - #if ENABLED(HANGPRINTER) - _set_position_mm(line_lengths[A_AXIS], line_lengths[B_AXIS], line_lengths[C_AXIS], line_lengths[D_AXIS], cart[E_CART]); - #else - _set_position_mm(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_CART]); - #endif + _set_position_mm(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS]); #else - _set_position_mm(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], cart[E_CART]); + _set_position_mm(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], cart[E_AXIS]); #endif } +/** + * Sync from the stepper positions. (e.g., after an interrupted move) + */ +void Planner::sync_from_steppers() { + LOOP_XYZE(i) { + position[i] = stepper.position((AxisEnum)i); + #if ENABLED(LIN_ADVANCE) + position_float[i] = position[i] * steps_to_mm[i + #if ENABLED(DISTINCT_E_FACTORS) + + (i == E_AXIS ? active_extruder : 0) + #endif + ]; + #endif + } +} + /** * Setters for planner position (also setting stepper position). */ @@ -2727,42 +1609,32 @@ void Planner::set_position_mm(const AxisEnum axis, const float &v) { #else const uint8_t axis_index = axis; #endif - position[axis] = LROUND(axis_steps_per_mm[axis_index] * (v + ( - #if ENABLED(AUTO_BED_LEVELING_UBL) - axis == Z_AXIS && leveling_active ? ubl.get_z_correction(current_position[X_AXIS], current_position[Y_AXIS]) : - #endif - 0) - )); - #if HAS_POSITION_FLOAT + position[axis] = LROUND(v * axis_steps_per_mm[axis_index]); + #if ENABLED(LIN_ADVANCE) position_float[axis] = v; #endif - if (has_blocks_queued()) - buffer_sync_block(); - else - stepper.set_position(axis, position[axis]); + stepper.set_position(axis, v); + previous_speed[axis] = 0.0; } // Recalculate the steps/s^2 acceleration rates, based on the mm/s^2 void Planner::reset_acceleration_rates() { #if ENABLED(DISTINCT_E_FACTORS) - #define AXIS_CONDITION (i < E_AXIS || i == E_AXIS + active_extruder) + #define HIGHEST_CONDITION (i < E_AXIS || i == E_AXIS + active_extruder) #else - #define AXIS_CONDITION true + #define HIGHEST_CONDITION true #endif uint32_t highest_rate = 1; - LOOP_NUM_AXIS_N(i) { + LOOP_XYZE_N(i) { max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * axis_steps_per_mm[i]; - if (AXIS_CONDITION) NOLESS(highest_rate, max_acceleration_steps_per_s2[i]); + if (HIGHEST_CONDITION) NOLESS(highest_rate, max_acceleration_steps_per_s2[i]); } - cutoff_long = 4294967295UL / highest_rate; // 0xFFFFFFFFUL - #if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE) - recalculate_max_e_jerk(); - #endif + cutoff_long = 4294967295UL / highest_rate; } // Recalculate position, steps_to_mm if axis_steps_per_mm changes! void Planner::refresh_positioning() { - LOOP_NUM_AXIS_N(i) steps_to_mm[i] = 1.0f / axis_steps_per_mm[i]; + LOOP_XYZE_N(i) steps_to_mm[i] = 1.0 / axis_steps_per_mm[i]; set_position_mm_kinematic(current_position); reset_acceleration_rates(); } @@ -2770,7 +1642,8 @@ void Planner::refresh_positioning() { #if ENABLED(AUTOTEMP) void Planner::autotemp_M104_M109() { - if ((autotemp_enabled = parser.seen('F'))) autotemp_factor = parser.value_float(); + autotemp_enabled = parser.seen('F'); + if (autotemp_enabled) autotemp_factor = parser.value_celsius_diff(); if (parser.seen('S')) autotemp_min = parser.value_celsius(); if (parser.seen('B')) autotemp_max = parser.value_celsius(); } diff --git a/Marlin/planner.h b/Marlin/planner.h index c4d459d..23f13bf 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -36,11 +36,11 @@ #include "enum.h" #include "Marlin.h" -#if ABL_PLANAR +#if HAS_ABL #include "vector_3.h" #endif -enum BlockFlagBit : char { +enum BlockFlagBit { // Recalculate trapezoids on entry junction. For optimization. BLOCK_BIT_RECALCULATE, @@ -49,18 +49,22 @@ enum BlockFlagBit : char { // from a safe speed (in consideration of jerking from zero speed). BLOCK_BIT_NOMINAL_LENGTH, - // The block is segment 2+ of a longer move - BLOCK_BIT_CONTINUED, + // Start from a halt at the start of this block, respecting the maximum allowed jerk. + BLOCK_BIT_START_FROM_FULL_HALT, - // Sync the stepper counts from the block - BLOCK_BIT_SYNC_POSITION + // The block is busy + BLOCK_BIT_BUSY, + + // The block is segment 2+ of a longer move + BLOCK_BIT_CONTINUED }; -enum BlockFlag : char { +enum BlockFlag { BLOCK_FLAG_RECALCULATE = _BV(BLOCK_BIT_RECALCULATE), BLOCK_FLAG_NOMINAL_LENGTH = _BV(BLOCK_BIT_NOMINAL_LENGTH), - BLOCK_FLAG_CONTINUED = _BV(BLOCK_BIT_CONTINUED), - BLOCK_FLAG_SYNC_POSITION = _BV(BLOCK_BIT_SYNC_POSITION) + BLOCK_FLAG_START_FROM_FULL_HALT = _BV(BLOCK_BIT_START_FROM_FULL_HALT), + BLOCK_FLAG_BUSY = _BV(BLOCK_BIT_BUSY), + BLOCK_FLAG_CONTINUED = _BV(BLOCK_BIT_CONTINUED) }; /** @@ -74,63 +78,38 @@ enum BlockFlag : char { */ typedef struct { - volatile uint8_t flag; // Block flags (See BlockFlag enum above) - Modified by ISR and main thread! + uint8_t flag; // Block flags (See BlockFlag enum above) - #if ENABLED(UNREGISTERED_MOVE_SUPPORT) - bool count_it; - #endif + unsigned char active_extruder; // The extruder to move (if E move) - // Fields used by the motion planner to manage acceleration - float nominal_speed_sqr, // The nominal speed for this block in (mm/sec)^2 - entry_speed_sqr, // Entry speed at previous-current junction in (mm/sec)^2 - max_entry_speed_sqr, // Maximum allowable junction entry speed in (mm/sec)^2 - millimeters, // The total travel of this block in mm - acceleration; // acceleration mm/sec^2 - - union { - // Data used by all move blocks - struct { - // Fields used by the Bresenham algorithm for tracing the line - uint32_t steps[NUM_AXIS]; // Step count along each axis - }; - // Data used by all sync blocks - struct { - int32_t position[NUM_AXIS]; // New position to force when this sync block is executed - }; - }; + // Fields used by the Bresenham algorithm for tracing the line + int32_t steps[NUM_AXIS]; // Step count along each axis uint32_t step_event_count; // The number of step events required to complete this block - uint8_t active_extruder; // The extruder to move (if E move) - #if ENABLED(MIXING_EXTRUDER) - uint32_t mix_steps[MIXING_STEPPERS]; // Scaled steps[E_AXIS] for the mixing steppers + uint32_t mix_event_count[MIXING_STEPPERS]; // Scaled step_event_count for the mixing steppers #endif - // Settings for the trapezoid generator - uint32_t 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 - - #if ENABLED(S_CURVE_ACCELERATION) - uint32_t cruise_rate, // The actual cruise rate to use, between end of the acceleration phase and start of deceleration phase - acceleration_time, // Acceleration time and deceleration time in STEP timer counts - deceleration_time, - acceleration_time_inverse, // Inverse of acceleration and deceleration periods, expressed as integer. Scale depends on CPU being used - deceleration_time_inverse; - #else - uint32_t acceleration_rate; // The acceleration rate used for acceleration calculation - #endif + int32_t 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 uint8_t direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h) // Advance extrusion #if ENABLED(LIN_ADVANCE) bool use_advance_lead; - uint16_t advance_speed, // STEP timer value for extruder speed offset ISR - max_adv_steps, // max. advance steps to get cruising speed pressure (not always nominal_speed!) - final_adv_steps; // advance steps due to exit speed - float e_D_ratio; + uint32_t abs_adv_steps_multiplier8; // Factorised by 2^8 to avoid float #endif + // Fields used by the motion planner to manage acceleration + 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 + + // Settings for the trapezoid generator uint32_t 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 @@ -148,8 +127,6 @@ typedef struct { } block_t; -#define HAS_POSITION_FLOAT (ENABLED(LIN_ADVANCE) || HAS_FEEDRATE_SCALING) - #define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1)) class Planner { @@ -170,12 +147,7 @@ class Planner { */ static block_t block_buffer[BLOCK_BUFFER_SIZE]; static volatile uint8_t block_buffer_head, // Index of the next block to be pushed - block_buffer_nonbusy, // Index of the first non busy block - block_buffer_planned, // Index of the optimally planned block block_buffer_tail; // Index of the busy block, if any - static uint16_t cleaning_buffer_counter; // A counter to disable queuing of blocks - static uint8_t delay_before_delivering; // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks - #if ENABLED(DISTINCT_E_FACTORS) static uint8_t last_extruder; // Respond to extruder change @@ -192,42 +164,19 @@ class Planner { // May be auto-adjusted by a filament width sensor #endif - static uint32_t max_acceleration_mm_per_s2[NUM_AXIS_N], // (mm/s^2) M201 XYZE - max_acceleration_steps_per_s2[NUM_AXIS_N], // (steps/s^2) Derived from mm_per_s2 - min_segment_time_us; // (µs) M205 Q - static float max_feedrate_mm_s[NUM_AXIS_N], // (mm/s) M203 XYZE - Max speeds - axis_steps_per_mm[NUM_AXIS_N], // (steps) M92 XYZE - Steps per millimeter - steps_to_mm[NUM_AXIS_N], // (mm) Millimeters per step - min_feedrate_mm_s, // (mm/s) M205 S - Minimum linear feedrate - acceleration, // (mm/s^2) M204 S - Normal acceleration. DEFAULT ACCELERATION for all printing moves. - retract_acceleration, // (mm/s^2) M204 R - Retract acceleration. Filament pull-back and push-forward while standing still in the other axes - travel_acceleration, // (mm/s^2) M204 T - Travel acceleration. DEFAULT ACCELERATION for all NON printing moves. - min_travel_feedrate_mm_s; // (mm/s) M205 T - Minimum travel feedrate + static float max_feedrate_mm_s[XYZE_N], // Max speeds in mm per second + axis_steps_per_mm[XYZE_N], + steps_to_mm[XYZE_N]; + static uint32_t max_acceleration_steps_per_s2[XYZE_N], + max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override - #if ENABLED(JUNCTION_DEVIATION) - static float junction_deviation_mm; // (mm) M205 J - #if ENABLED(LIN_ADVANCE) - #if ENABLED(DISTINCT_E_FACTORS) - static float max_e_jerk[EXTRUDERS]; // Calculated from junction_deviation_mm - #else - static float max_e_jerk; - #endif - #endif - #else - static float max_jerk[NUM_AXIS]; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. - #endif - - #if ENABLED(LINE_BUILDUP_COMPENSATION_FEATURE) - /* - * Parameters for calculating target[] - * See buildup compensation theory: - * https://vitana.se/opr3d/tbear/2017.html#hangprinter_project_29 - */ - static float k0[MOV_AXIS], - k1[MOV_AXIS], - k2[MOV_AXIS], - sqrtk1[MOV_AXIS]; - #endif + static uint32_t min_segment_time_us; // Use 'M205 B<µs>' to override + static float min_feedrate_mm_s, + acceleration, // Normal acceleration mm/s^2 DEFAULT ACCELERATION for all printing moves. M204 SXXXX + retract_acceleration, // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX + travel_acceleration, // Travel acceleration mm/s^2 DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX + max_jerk[XYZE], // The largest speed change requiring no acceleration + min_travel_feedrate_mm_s; #if HAS_LEVELING static bool leveling_active; // Flag that bed leveling is enabled @@ -242,11 +191,9 @@ class Planner { #endif #if ENABLED(LIN_ADVANCE) - static float extruder_advance_K; - #endif - - #if HAS_POSITION_FLOAT - static float position_float[NUM_AXIS]; + static float extruder_advance_k, advance_ed_ratio, + position_float[XYZE], + lin_dist_xy, lin_dist_e; #endif #if ENABLED(SKEW_CORRECTION) @@ -266,10 +213,6 @@ class Planner { #endif #endif - #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - static bool abort_on_endstop_hit; - #endif - private: /** @@ -284,9 +227,9 @@ class Planner { static float previous_speed[NUM_AXIS]; /** - * Nominal speed of previous path line segment (mm/s)^2 + * Nominal speed of previous path line segment */ - static float previous_nominal_speed_sqr; + static float previous_nominal_speed; /** * Limit where 64bit math is necessary for acceleration calculation @@ -335,7 +278,7 @@ class Planner { static void refresh_positioning(); FORCE_INLINE static void refresh_e_factor(const uint8_t e) { - e_factor[e] = (flow_percentage[e] * 0.01f + e_factor[e] = (flow_percentage[e] * 0.01 #if DISABLED(NO_VOLUMETRICS) * volumetric_multiplier[e] #endif @@ -345,6 +288,13 @@ class Planner { // Manage fans, paste pressure, etc. static void check_axes_activity(); + /** + * Number of moves currently in the planner + */ + FORCE_INLINE static uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail + BLOCK_BUFFER_SIZE); } + + FORCE_INLINE static bool is_full() { return block_buffer_tail == next_block_index(block_buffer_head); } + // Update multipliers based on new diameter measurements static void calculate_volumetric_multipliers(); @@ -373,19 +323,19 @@ class Planner { * Returns 0.0 if Z is past the specified 'Fade Height'. */ inline static float fade_scaling_factor_for_z(const float &rz) { - static float z_fade_factor = 1; + static float z_fade_factor = 1.0; if (z_fade_height) { - if (rz >= z_fade_height) return 0; + if (rz >= z_fade_height) return 0.0; if (last_fade_z != rz) { last_fade_z = rz; - z_fade_factor = 1 - rz * inverse_z_fade_height; + z_fade_factor = 1.0 - rz * inverse_z_fade_height; } return z_fade_factor; } - return 1; + return 1.0; } - FORCE_INLINE static void force_fade_recalc() { last_fade_z = -999.999f; } + FORCE_INLINE static void force_fade_recalc() { last_fade_z = -999.999; } FORCE_INLINE static void set_z_fade_height(const float &zfh) { z_fade_height = zfh > 0 ? zfh : 0; @@ -401,7 +351,7 @@ class Planner { FORCE_INLINE static float fade_scaling_factor_for_z(const float &rz) { UNUSED(rz); - return 1; + return 1.0; } FORCE_INLINE static bool leveling_active_at_z(const float &rz) { UNUSED(rz); return true; } @@ -432,64 +382,28 @@ class Planner { #endif // SKEW_CORRECTION - #if PLANNER_LEVELING || HAS_UBL_AND_CURVES + #if PLANNER_LEVELING + + #define ARG_X float rx + #define ARG_Y float ry + #define ARG_Z float rz + /** * Apply leveling to transform a cartesian position * as it will be given to the planner and steppers. */ static void apply_leveling(float &rx, float &ry, float &rz); - FORCE_INLINE static void apply_leveling(float (&raw)[XYZ]) { apply_leveling(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); } - #endif - - #if PLANNER_LEVELING - #define ARG_X float rx - #define ARG_Y float ry - #define ARG_Z float rz - #if ENABLED(HANGPRINTER) - #define ARG_E1 float re1 - #endif + static void apply_leveling(float (&raw)[XYZ]) { apply_leveling(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); } static void unapply_leveling(float raw[XYZ]); + #else + #define ARG_X const float &rx #define ARG_Y const float &ry #define ARG_Z const float &rz - #if ENABLED(HANGPRINTER) - #define ARG_E1 const float &re1 - #endif + #endif - // Number of moves currently in the planner including the busy block, if any - FORCE_INLINE static uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail); } - - // Number of nonbusy moves currently in the planner - FORCE_INLINE static uint8_t nonbusy_movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_nonbusy); } - - // Remove all blocks from the buffer - FORCE_INLINE static void clear_block_buffer() { block_buffer_nonbusy = block_buffer_planned = block_buffer_head = block_buffer_tail = 0; } - - // Check if movement queue is full - FORCE_INLINE static bool is_full() { return block_buffer_tail == next_block_index(block_buffer_head); } - - // Get count of movement slots free - FORCE_INLINE static uint8_t moves_free() { return BLOCK_BUFFER_SIZE - 1 - movesplanned(); } - - /** - * Planner::get_next_free_block - * - * - Get the next head indices (passed by reference) - * - Wait for the number of spaces to open up in the planner - * - Return the first head block - */ - FORCE_INLINE static block_t* get_next_free_block(uint8_t &next_buffer_head, const uint8_t count=1) { - - // Wait until there are enough slots free - while (moves_free() < count) { idle(); } - - // Return the first available block - next_buffer_head = next_block_index(block_buffer_head); - return &block_buffer[block_buffer_head]; - } - /** * Planner::_buffer_steps * @@ -498,50 +412,8 @@ class Planner { * target - target position in steps units * fr_mm_s - (target) speed of the move * extruder - target extruder - * millimeters - the length of the movement, if known - * count_it - apply this move to the counters (UNREGISTERED_MOVE_SUPPORT) - * - * Returns true if movement was buffered, false otherwise */ - static bool _buffer_steps(const int32_t (&target)[NUM_AXIS] - #if HAS_POSITION_FLOAT - , const float (&target_float)[NUM_AXIS] - #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 - #if ENABLED(UNREGISTERED_MOVE_SUPPORT) - , const bool count_it=true - #endif - ); - - /** - * Planner::_populate_block - * - * Fills a new linear movement in the block (in terms of steps). - * - * target - target position in steps units - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - * count_it - apply this move to the counters (UNREGISTERED_MOVE_SUPPORT) - * - * Returns true is movement is acceptable, false otherwise - */ - static bool _populate_block(block_t * const block, bool split_move, - const int32_t (&target)[NUM_AXIS] - #if HAS_POSITION_FLOAT - , const float (&target_float)[NUM_AXIS] - #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 - #if ENABLED(UNREGISTERED_MOVE_SUPPORT) - , const bool count_it=true - #endif - ); - - /** - * Planner::buffer_sync_block - * Add a block to the buffer that just updates the position - */ - static void buffer_sync_block(); + static void _buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const uint8_t extruder); /** * Planner::buffer_segment @@ -550,29 +422,13 @@ class Planner { * * Leveling and kinematics should be applied ahead of calling this. * - * a,b,c,e - target positions in mm and/or degrees - * (a, b, c, d, e for Hangprinter) - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - * count_it - remember this move in its counters (UNREGISTERED_MOVE_SUPPORT) + * a,b,c,e - target positions in mm and/or degrees + * fr_mm_s - (target) speed of the move + * extruder - target extruder */ - static bool buffer_segment(const float &a, const float &b, const float &c, - #if ENABLED(HANGPRINTER) - const float &d, - #endif - const float &e, const float &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 - #if ENABLED(UNREGISTERED_MOVE_SUPPORT) - , bool count_it=true - #endif - ); + static void buffer_segment(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder); - static void _set_position_mm(const float &a, const float &b, const float &c, - #if ENABLED(HANGPRINTER) - const float &d, - #endif - const float &e - ); + static void _set_position_mm(const float &a, const float &b, const float &c, const float &e); /** * Add a new linear movement to the buffer. @@ -583,26 +439,14 @@ class Planner { * (Cartesians may also call buffer_line_kinematic.) * * rx,ry,rz,e - target position in mm or degrees - * (rx, ry, rz, re1 for Hangprinter) * fr_mm_s - (target) speed of the move (mm/s) * extruder - target extruder - * millimeters - the length of the movement, if known */ - FORCE_INLINE static bool buffer_line(ARG_X, ARG_Y, ARG_Z, - #if ENABLED(HANGPRINTER) - ARG_E1, - #endif - const float &e, const float &fr_mm_s, const uint8_t extruder, const float millimeters = 0.0 - ) { + FORCE_INLINE static void buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, const float &fr_mm_s, const uint8_t extruder) { #if PLANNER_LEVELING && IS_CARTESIAN apply_leveling(rx, ry, rz); #endif - return buffer_segment(rx, ry, rz, - #if ENABLED(HANGPRINTER) - re1, - #endif - e, fr_mm_s, extruder, millimeters - ); + buffer_segment(rx, ry, rz, e, fr_mm_s, extruder); } /** @@ -610,12 +454,11 @@ class Planner { * The target is cartesian, it's translated to delta/scara if * needed. * - * cart - x,y,z,e CARTESIAN target in mm - * fr_mm_s - (target) speed of the move (mm/s) - * extruder - target extruder - * millimeters - the length of the movement, if known + * cart - x,y,z,e CARTESIAN target in mm + * fr_mm_s - (target) speed of the move (mm/s) + * extruder - target extruder */ - FORCE_INLINE static bool buffer_line_kinematic(const float (&cart)[XYZE], const float &fr_mm_s, const uint8_t extruder, const float millimeters = 0.0) { + FORCE_INLINE static void buffer_line_kinematic(const float (&cart)[XYZE], const float &fr_mm_s, const uint8_t extruder) { #if PLANNER_LEVELING float raw[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] }; apply_leveling(raw); @@ -624,16 +467,9 @@ class Planner { #endif #if IS_KINEMATIC inverse_kinematics(raw); - return buffer_segment( - #if ENABLED(HANGPRINTER) - line_lengths[A_AXIS], line_lengths[B_AXIS], line_lengths[C_AXIS], line_lengths[D_AXIS] - #else - delta[A_AXIS], delta[B_AXIS], delta[C_AXIS] - #endif - , cart[E_CART], fr_mm_s, extruder, millimeters - ); + buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS], fr_mm_s, extruder); #else - return buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], cart[E_CART], fr_mm_s, extruder, millimeters); + buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], cart[E_AXIS], fr_mm_s, extruder); #endif } @@ -646,69 +482,45 @@ class Planner { * * Clears previous speed values. */ - FORCE_INLINE static void set_position_mm(ARG_X, ARG_Y, ARG_Z, - #if ENABLED(HANGPRINTER) - ARG_E1, - #endif - const float &e - ) { + FORCE_INLINE static void set_position_mm(ARG_X, ARG_Y, ARG_Z, const float &e) { #if PLANNER_LEVELING && IS_CARTESIAN apply_leveling(rx, ry, rz); #endif - _set_position_mm(rx, ry, rz, - #if ENABLED(HANGPRINTER) - re1, - #endif - e - ); + _set_position_mm(rx, ry, rz, e); } static void set_position_mm_kinematic(const float (&cart)[XYZE]); static void set_position_mm(const AxisEnum axis, const float &v); FORCE_INLINE static void set_z_position_mm(const float &z) { set_position_mm(Z_AXIS, z); } - FORCE_INLINE static void set_e_position_mm(const float &e) { set_position_mm(E_AXIS, e); } + FORCE_INLINE static void set_e_position_mm(const float &e) { set_position_mm(AxisEnum(E_AXIS), e); } /** - * Get an axis position according to stepper position(s) - * For CORE machines apply translation from ABC to XYZ. + * Sync from the stepper positions. (e.g., after an interrupted move) */ - static float get_axis_position_mm(const AxisEnum axis); - - // SCARA AB axes are in degrees, not mm - #if IS_SCARA - FORCE_INLINE static float get_axis_position_degrees(const AxisEnum axis) { return get_axis_position_mm(axis); } - #endif - - // Called to force a quick stop of the machine (for example, when an emergency - // stop is required, or when endstops are hit) - static void quick_stop(); - - // Called when an endstop is triggered. Causes the machine to stop inmediately - static void endstop_triggered(const AxisEnum axis); - - // Triggered position of an axis in mm (not core-savvy) - static float triggered_position_mm(const AxisEnum axis); - - // Block until all buffered steps are executed / cleaned - static void synchronize(); - - // Wait for moves to finish and disable all steppers - static void finish_and_disable(); - - // Periodic tick to handle cleaning timeouts - // Called from the Temperature ISR at ~1kHz - static void tick() { - if (cleaning_buffer_counter) { - --cleaning_buffer_counter; - #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) - if (!cleaning_buffer_counter) enqueue_and_echo_commands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); - #endif - } - } + static void sync_from_steppers(); /** * Does the buffer have any blocks queued? */ - FORCE_INLINE static bool has_blocks_queued() { return (block_buffer_head != block_buffer_tail); } + static bool blocks_queued() { return (block_buffer_head != block_buffer_tail); } + + /** + * "Discard" the block and "release" the memory. + * Called when the current block is no longer needed. + */ + FORCE_INLINE static void discard_current_block() { + if (blocks_queued()) + block_buffer_tail = BLOCK_MOD(block_buffer_tail + 1); + } + + /** + * "Discard" the next block if it's continued. + * Called after an interrupted move to throw away the rest of the move. + */ + FORCE_INLINE static bool discard_continued_block() { + const bool discard = blocks_queued() && TEST(block_buffer[block_buffer_tail].flag, BLOCK_BIT_CONTINUED); + if (discard) discard_current_block(); + return discard; + } /** * The current block. NULL if the buffer is empty. @@ -716,71 +528,28 @@ class Planner { * WARNING: Called from Stepper ISR context! */ static block_t* get_current_block() { - - // Get the number of moves in the planner queue so far - const uint8_t nr_moves = movesplanned(); - - // If there are any moves queued ... - if (nr_moves) { - - // If there is still delay of delivery of blocks running, decrement it - if (delay_before_delivering) { - --delay_before_delivering; - // If the number of movements queued is less than 3, and there is still time - // to wait, do not deliver anything - if (nr_moves < 3 && delay_before_delivering) return NULL; - delay_before_delivering = 0; - } - - // If we are here, there is no excuse to deliver the block + if (blocks_queued()) { block_t * const block = &block_buffer[block_buffer_tail]; - - // No trapezoid calculated? Don't execute yet. - if (TEST(block->flag, BLOCK_BIT_RECALCULATE)) return NULL; - #if ENABLED(ULTRA_LCD) block_buffer_runtime_us -= block->segment_time_us; // We can't be sure how long an active block will take, so don't count it. #endif - - // As this block is busy, advance the nonbusy block pointer - block_buffer_nonbusy = next_block_index(block_buffer_tail); - - // Push block_buffer_planned pointer, if encountered. - if (block_buffer_tail == block_buffer_planned) - block_buffer_planned = block_buffer_nonbusy; - - // Return the block + SBI(block->flag, BLOCK_BIT_BUSY); return block; } - - // The queue became empty - #if ENABLED(ULTRA_LCD) - clear_block_buffer_runtime(); // paranoia. Buffer is empty now - so reset accumulated time to zero. - #endif - - return NULL; - } - - /** - * "Discard" the block and "release" the memory. - * Called when the current block is no longer needed. - * NB: There MUST be a current block to call this function!! - */ - FORCE_INLINE static void discard_current_block() { - if (has_blocks_queued()) - block_buffer_tail = next_block_index(block_buffer_tail); + else { + #if ENABLED(ULTRA_LCD) + clear_block_buffer_runtime(); // paranoia. Buffer is empty now - so reset accumulated time to zero. + #endif + return NULL; + } } #if ENABLED(ULTRA_LCD) static uint16_t block_buffer_runtime() { - bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - millis_t bbru = block_buffer_runtime_us; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - + CRITICAL_SECTION_START + millis_t bbru = block_buffer_runtime_us; + CRITICAL_SECTION_END // To translate µs to ms a division by 1000 would be required. // We introduce 2.4% error here by dividing by 1024. // Doesn't matter because block_buffer_runtime_us is already too small an estimation. @@ -790,13 +559,10 @@ class Planner { return bbru; } - static void clear_block_buffer_runtime() { - bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - block_buffer_runtime_us = 0; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); + static void clear_block_buffer_runtime(){ + CRITICAL_SECTION_START + block_buffer_runtime_us = 0; + CRITICAL_SECTION_END } #endif @@ -808,27 +574,13 @@ class Planner { static void autotemp_M104_M109(); #endif - #if ENABLED(JUNCTION_DEVIATION) - FORCE_INLINE static void recalculate_max_e_jerk() { - #define GET_MAX_E_JERK(N) SQRT(SQRT(0.5) * junction_deviation_mm * (N) * RECIPROCAL(1.0 - SQRT(0.5))) - #if ENABLED(LIN_ADVANCE) - #if ENABLED(DISTINCT_E_FACTORS) - for (uint8_t i = 0; i < EXTRUDERS; i++) - max_e_jerk[i] = GET_MAX_E_JERK(max_acceleration_mm_per_s2[E_AXIS + i]); - #else - max_e_jerk = GET_MAX_E_JERK(max_acceleration_mm_per_s2[E_AXIS]); - #endif - #endif - } - #endif - private: /** * Get the index of the next / previous block in the ring buffer */ - static constexpr uint8_t next_block_index(const uint8_t block_index) { return BLOCK_MOD(block_index + 1); } - static constexpr uint8_t prev_block_index(const uint8_t block_index) { return BLOCK_MOD(block_index - 1); } + static constexpr int8_t next_block_index(const int8_t block_index) { return BLOCK_MOD(block_index + 1); } + static constexpr int8_t prev_block_index(const int8_t block_index) { return BLOCK_MOD(block_index - 1); } /** * Calculate the distance (not time) it takes to accelerate @@ -853,27 +605,18 @@ class Planner { } /** - * Calculate the maximum allowable speed squared at this point, in order - * to reach 'target_velocity_sqr' using 'acceleration' within a given + * Calculate the maximum allowable speed at this point, in order + * to reach 'target_velocity' using 'acceleration' within a given * 'distance'. */ - static float max_allowable_speed_sqr(const float &accel, const float &target_velocity_sqr, const float &distance) { - return target_velocity_sqr - 2 * accel * distance; + static float max_allowable_speed(const float &accel, const float &target_velocity, const float &distance) { + return SQRT(sq(target_velocity) - 2 * accel * distance); } - #if ENABLED(S_CURVE_ACCELERATION) - /** - * Calculate the speed reached given initial speed, acceleration and distance - */ - static float final_speed(const float &initial_velocity, const float &accel, const float &distance) { - return SQRT(sq(initial_velocity) + 2 * accel * distance); - } - #endif - static void calculate_trapezoid_for_block(block_t* const block, const float &entry_factor, const float &exit_factor); static void reverse_pass_kernel(block_t* const current, const block_t * const next); - static void forward_pass_kernel(const block_t * const previous, block_t* const current, uint8_t block_index); + static void forward_pass_kernel(const block_t * const previous, block_t* const current); static void reverse_pass(); static void forward_pass(); @@ -882,26 +625,9 @@ class Planner { static void recalculate(); - #if ENABLED(JUNCTION_DEVIATION) - - FORCE_INLINE static void normalize_junction_vector(float (&vector)[XYZE]) { - float magnitude_sq = 0; - LOOP_XYZE(idx) if (vector[idx]) magnitude_sq += sq(vector[idx]); - const float inv_magnitude = RSQRT(magnitude_sq); - LOOP_XYZE(idx) vector[idx] *= inv_magnitude; - } - - FORCE_INLINE static float limit_value_by_axis_maximum(const float &max_value, float (&unit_vec)[XYZE]) { - float limit_value = max_value; - LOOP_XYZE(idx) if (unit_vec[idx]) // Avoid divide by zero - NOMORE(limit_value, ABS(max_acceleration_mm_per_s2[idx] / unit_vec[idx])); - return limit_value; - } - - #endif // JUNCTION_DEVIATION }; -#define PLANNER_XY_FEEDRATE() (MIN(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS])) +#define PLANNER_XY_FEEDRATE() (min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS])) extern Planner planner; diff --git a/Marlin/planner_bezier.cpp b/Marlin/planner_bezier.cpp index 6edc02b..d07863d 100644 --- a/Marlin/planner_bezier.cpp +++ b/Marlin/planner_bezier.cpp @@ -27,22 +27,22 @@ * */ -#include "MarlinConfig.h" +#include "Marlin.h" #if ENABLED(BEZIER_CURVE_SUPPORT) #include "planner.h" #include "language.h" #include "temperature.h" -#include "Marlin.h" // See the meaning in the documentation of cubic_b_spline(). -#define MIN_STEP 0.002f -#define MAX_STEP 0.1f -#define SIGMA 0.1f +#define MIN_STEP 0.002 +#define MAX_STEP 0.1 +#define SIGMA 0.1 -// Compute the linear interpolation between two real numbers. -inline static float interp(float a, float b, float t) { return (1.0f - t) * a + t * b; } +/* Compute the linear interpolation between to real numbers. +*/ +inline static float interp(float a, float b, float t) { return (1.0 - t) * a + t * b; } /** * Compute a Bézier curve using the De Casteljau's algorithm (see @@ -64,7 +64,7 @@ inline static float eval_bezier(float a, float b, float c, float d, float t) { * We approximate Euclidean distance with the sum of the coordinates * offset (so-called "norm 1"), which is quicker to compute. */ -inline static float dist1(float x1, float y1, float x2, float y2) { return ABS(x1 - x2) + ABS(y1 - y2); } +inline static float dist1(float x1, float y1, float x2, float y2) { return FABS(x1 - x2) + FABS(y1 - y2); } /** * The algorithm for computing the step is loosely based on the one in Kig @@ -105,22 +105,22 @@ inline static float dist1(float x1, float y1, float x2, float y2) { return ABS(x * 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 pos[XYZE], const float cart_target[XYZE], const float offset[4], float fr_mm_s, 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. - const float first0 = pos[X_AXIS] + offset[0], - first1 = pos[Y_AXIS] + offset[1], - second0 = cart_target[X_AXIS] + offset[2], - second1 = cart_target[Y_AXIS] + offset[3]; - float t = 0; + const float first0 = position[X_AXIS] + offset[0], + first1 = position[Y_AXIS] + offset[1], + second0 = target[X_AXIS] + offset[2], + second1 = target[Y_AXIS] + offset[3]; + float t = 0.0; - float bez_target[XYZE]; - bez_target[X_AXIS] = pos[X_AXIS]; - bez_target[Y_AXIS] = pos[Y_AXIS]; + float bez_target[4]; + bez_target[X_AXIS] = position[X_AXIS]; + bez_target[Y_AXIS] = position[Y_AXIS]; float step = MAX_STEP; millis_t next_idle_ms = millis() + 200UL; - while (t < 1) { + while (t < 1.0) { thermalManager.manage_heater(); millis_t now = millis(); @@ -133,16 +133,16 @@ void cubic_b_spline(const float pos[XYZE], const float cart_target[XYZE], const // close to a linear interpolation. bool did_reduce = false; float new_t = t + step; - NOMORE(new_t, 1); - float new_pos0 = eval_bezier(pos[X_AXIS], first0, second0, cart_target[X_AXIS], new_t), - new_pos1 = eval_bezier(pos[Y_AXIS], first1, second1, cart_target[Y_AXIS], new_t); + NOMORE(new_t, 1.0); + float new_pos0 = eval_bezier(position[X_AXIS], first0, second0, target[X_AXIS], new_t), + new_pos1 = eval_bezier(position[Y_AXIS], first1, second1, target[Y_AXIS], new_t); for (;;) { if (new_t - t < (MIN_STEP)) break; - const float candidate_t = 0.5f * (t + new_t), - candidate_pos0 = eval_bezier(pos[X_AXIS], first0, second0, cart_target[X_AXIS], candidate_t), - candidate_pos1 = eval_bezier(pos[Y_AXIS], first1, second1, cart_target[Y_AXIS], candidate_t), - interp_pos0 = 0.5f * (bez_target[X_AXIS] + new_pos0), - interp_pos1 = 0.5f * (bez_target[Y_AXIS] + new_pos1); + const float candidate_t = 0.5 * (t + new_t), + candidate_pos0 = eval_bezier(position[X_AXIS], first0, second0, target[X_AXIS], candidate_t), + candidate_pos1 = eval_bezier(position[Y_AXIS], first1, second1, target[Y_AXIS], candidate_t), + interp_pos0 = 0.5 * (bez_target[X_AXIS] + new_pos0), + interp_pos1 = 0.5 * (bez_target[Y_AXIS] + new_pos1); if (dist1(candidate_pos0, candidate_pos1, interp_pos0, interp_pos1) <= (SIGMA)) break; new_t = candidate_t; new_pos0 = candidate_pos0; @@ -153,12 +153,12 @@ void cubic_b_spline(const float pos[XYZE], const float cart_target[XYZE], const // If we did not reduce the step, maybe we should enlarge it. if (!did_reduce) for (;;) { if (new_t - t > MAX_STEP) break; - const float candidate_t = t + 2 * (new_t - t); - if (candidate_t >= 1) break; - const float candidate_pos0 = eval_bezier(pos[X_AXIS], first0, second0, cart_target[X_AXIS], candidate_t), - candidate_pos1 = eval_bezier(pos[Y_AXIS], first1, second1, cart_target[Y_AXIS], candidate_t), - interp_pos0 = 0.5f * (bez_target[X_AXIS] + candidate_pos0), - interp_pos1 = 0.5f * (bez_target[Y_AXIS] + candidate_pos1); + const float candidate_t = t + 2.0 * (new_t - t); + if (candidate_t >= 1.0) break; + const float candidate_pos0 = eval_bezier(position[X_AXIS], first0, second0, target[X_AXIS], candidate_t), + candidate_pos1 = eval_bezier(position[Y_AXIS], first1, second1, target[Y_AXIS], candidate_t), + interp_pos0 = 0.5 * (bez_target[X_AXIS] + candidate_pos0), + interp_pos1 = 0.5 * (bez_target[Y_AXIS] + candidate_pos1); if (dist1(new_pos0, new_pos1, interp_pos0, interp_pos1) > (SIGMA)) break; new_t = candidate_t; new_pos0 = candidate_pos0; @@ -184,19 +184,10 @@ void cubic_b_spline(const float pos[XYZE], const float cart_target[XYZE], const bez_target[Y_AXIS] = new_pos1; // FIXME. The following two are wrong, since the parameter t is // not linear in the distance. - bez_target[Z_AXIS] = interp(pos[Z_AXIS], cart_target[Z_AXIS], t); - bez_target[E_CART] = interp(pos[E_CART], cart_target[E_CART], t); + bez_target[Z_AXIS] = interp(position[Z_AXIS], target[Z_AXIS], t); + bez_target[E_AXIS] = interp(position[E_AXIS], target[E_AXIS], t); clamp_to_software_endstops(bez_target); - - #if HAS_UBL_AND_CURVES - float bez_copy[XYZ] = { bez_target[X_AXIS], bez_target[Y_AXIS], bez_target[Z_AXIS] }; - planner.apply_leveling(bez_copy); - if (!planner.buffer_segment(bez_copy[X_AXIS], bez_copy[Y_AXIS], bez_copy[Z_AXIS], bez_target[E_CART], fr_mm_s, active_extruder)) - break; - #else - if (!planner.buffer_line_kinematic(bez_target, fr_mm_s, extruder)) - break; - #endif + planner.buffer_line_kinematic(bez_target, fr_mm_s, extruder); } } diff --git a/Marlin/printcounter.cpp b/Marlin/printcounter.cpp index d1de7d1..6edc0ac 100644 --- a/Marlin/printcounter.cpp +++ b/Marlin/printcounter.cpp @@ -20,114 +20,98 @@ * */ -#include "MarlinConfig.h" - -#if DISABLED(PRINTCOUNTER) - -#include "stopwatch.h" -Stopwatch print_job_timer; // Global Print Job Timer instance - -#else // PRINTCOUNTER - +#include "Marlin.h" #include "printcounter.h" #include "duration_t.h" -#include "Marlin.h" -PrintCounter print_job_timer; // Global Print Job Timer instance - -#if ENABLED(I2C_EEPROM) || ENABLED(SPI_EEPROM) - // round up address to next page boundary (assuming 32 byte pages) - #define STATS_EEPROM_ADDRESS 0x40 -#else - #define STATS_EEPROM_ADDRESS 0x32 -#endif - -const PrintCounter::promdress PrintCounter::address = STATS_EEPROM_ADDRESS; - -const uint16_t PrintCounter::updateInterval = 10; -const uint16_t PrintCounter::saveInterval = 3600; -printStatistics PrintCounter::data; -millis_t PrintCounter::lastDuration; -bool PrintCounter::loaded = false; +PrintCounter::PrintCounter(): super() { + this->loadStats(); +} millis_t PrintCounter::deltaDuration() { #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("deltaDuration")); + PrintCounter::debug(PSTR("deltaDuration")); #endif - millis_t tmp = lastDuration; - lastDuration = duration(); - return lastDuration - tmp; + millis_t tmp = this->lastDuration; + this->lastDuration = this->duration(); + return this->lastDuration - tmp; } -void PrintCounter::incFilamentUsed(float const &amount) { +bool PrintCounter::isLoaded() { + return this->loaded; +} + +void PrintCounter::incFilamentUsed(double const &amount) { #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("incFilamentUsed")); + PrintCounter::debug(PSTR("incFilamentUsed")); #endif // Refuses to update data if object is not loaded - if (!isLoaded()) return; + if (!this->isLoaded()) return; - data.filamentUsed += amount; // mm + this->data.filamentUsed += amount; // mm } + void PrintCounter::initStats() { #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("initStats")); + PrintCounter::debug(PSTR("initStats")); #endif - loaded = true; - data = { 0, 0, 0, 0, 0.0 }; + this->loaded = true; + this->data = { 0, 0, 0, 0, 0.0 }; - saveStats(); - eeprom_write_byte((uint8_t*)address, 0x16); + this->saveStats(); + eeprom_write_byte((uint8_t *) this->address, 0x16); } void PrintCounter::loadStats() { #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("loadStats")); + PrintCounter::debug(PSTR("loadStats")); #endif // Checks if the EEPROM block is initialized - if (eeprom_read_byte((uint8_t*)address) != 0x16) initStats(); - else eeprom_read_block(&data, - (void*)(address + sizeof(uint8_t)), sizeof(printStatistics)); + 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)); - loaded = true; + this->loaded = true; } void PrintCounter::saveStats() { #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("saveStats")); + PrintCounter::debug(PSTR("saveStats")); #endif // Refuses to save data if object is not loaded - if (!isLoaded()) return; + if (!this->isLoaded()) return; // Saves the struct to EEPROM - eeprom_update_block(&data, - (void*)(address + sizeof(uint8_t)), sizeof(printStatistics)); + eeprom_update_block(&this->data, + (void *)(this->address + sizeof(uint8_t)), sizeof(printStatistics)); } void PrintCounter::showStats() { char buffer[21]; + duration_t elapsed; SERIAL_PROTOCOLPGM(MSG_STATS); SERIAL_ECHOPGM("Prints: "); - SERIAL_ECHO(data.totalPrints); + SERIAL_ECHO(this->data.totalPrints); SERIAL_ECHOPGM(", Finished: "); - SERIAL_ECHO(data.finishedPrints); + SERIAL_ECHO(this->data.finishedPrints); SERIAL_ECHOPGM(", Failed: "); // Note: Removes 1 from failures with an active counter - SERIAL_ECHO(data.totalPrints - data.finishedPrints - - ((isRunning() || isPaused()) ? 1 : 0)); + SERIAL_ECHO(this->data.totalPrints - this->data.finishedPrints + - ((this->isRunning() || this->isPaused()) ? 1 : 0)); SERIAL_EOL(); SERIAL_PROTOCOLPGM(MSG_STATS); - duration_t elapsed = data.printTime; + elapsed = this->data.printTime; elapsed.toString(buffer); SERIAL_ECHOPGM("Total time: "); @@ -135,11 +119,11 @@ void PrintCounter::showStats() { #if ENABLED(DEBUG_PRINTCOUNTER) SERIAL_ECHOPGM(" ("); - SERIAL_ECHO(data.printTime); + SERIAL_ECHO(this->data.printTime); SERIAL_CHAR(')'); #endif - elapsed = data.longestPrint; + elapsed = this->data.longestPrint; elapsed.toString(buffer); SERIAL_ECHOPGM(", Longest job: "); @@ -147,7 +131,7 @@ void PrintCounter::showStats() { #if ENABLED(DEBUG_PRINTCOUNTER) SERIAL_ECHOPGM(" ("); - SERIAL_ECHO(data.longestPrint); + SERIAL_ECHO(this->data.longestPrint); SERIAL_CHAR(')'); #endif @@ -155,14 +139,14 @@ void PrintCounter::showStats() { SERIAL_PROTOCOLPGM(MSG_STATS); SERIAL_ECHOPGM("Filament used: "); - SERIAL_ECHO(data.filamentUsed / 1000); - SERIAL_CHAR('m'); + SERIAL_ECHO(this->data.filamentUsed / 1000); + SERIAL_ECHOPGM("m"); SERIAL_EOL(); } void PrintCounter::tick() { - if (!isRunning()) return; + if (!this->isRunning()) return; static uint32_t update_last = millis(), eeprom_last = millis(); @@ -170,37 +154,37 @@ void PrintCounter::tick() { millis_t now = millis(); // Trying to get the amount of calculations down to the bare min - const static uint16_t i = updateInterval * 1000; + const static uint16_t i = this->updateInterval * 1000; if (now - update_last >= i) { #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("tick")); + PrintCounter::debug(PSTR("tick")); #endif - data.printTime += deltaDuration(); + this->data.printTime += this->deltaDuration(); update_last = now; } // Trying to get the amount of calculations down to the bare min - const static millis_t j = saveInterval * 1000; + const static millis_t j = this->saveInterval * 1000; if (now - eeprom_last >= j) { eeprom_last = now; - saveStats(); + this->saveStats(); } } // @Override bool PrintCounter::start() { #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("start")); + PrintCounter::debug(PSTR("start")); #endif - bool paused = isPaused(); + bool paused = this->isPaused(); if (super::start()) { if (!paused) { - data.totalPrints++; - lastDuration = 0; + this->data.totalPrints++; + this->lastDuration = 0; } return true; } @@ -211,17 +195,17 @@ bool PrintCounter::start() { // @Override bool PrintCounter::stop() { #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("stop")); + PrintCounter::debug(PSTR("stop")); #endif if (super::stop()) { - data.finishedPrints++; - data.printTime += deltaDuration(); + this->data.finishedPrints++; + this->data.printTime += this->deltaDuration(); - if (duration() > data.longestPrint) - data.longestPrint = duration(); + if (this->duration() > this->data.longestPrint) + this->data.longestPrint = this->duration(); - saveStats(); + this->saveStats(); return true; } else return false; @@ -230,11 +214,11 @@ bool PrintCounter::stop() { // @Override void PrintCounter::reset() { #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("stop")); + PrintCounter::debug(PSTR("stop")); #endif super::reset(); - lastDuration = 0; + this->lastDuration = 0; } #if ENABLED(DEBUG_PRINTCOUNTER) @@ -246,6 +230,5 @@ void PrintCounter::reset() { SERIAL_ECHOLNPGM("()"); } } -#endif -#endif // PRINTCOUNTER +#endif diff --git a/Marlin/printcounter.h b/Marlin/printcounter.h index 848d971..0eeded9 100644 --- a/Marlin/printcounter.h +++ b/Marlin/printcounter.h @@ -23,40 +23,35 @@ #ifndef PRINTCOUNTER_H #define PRINTCOUNTER_H -// Print debug messages with M111 S2 -//#define DEBUG_PRINTCOUNTER - #include "macros.h" #include "language.h" #include "stopwatch.h" #include -struct printStatistics { // 16 bytes + +// Print debug messages with M111 S2 +//#define DEBUG_PRINTCOUNTER + +struct printStatistics { // 16 bytes (20 with real doubles) //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; // Accumulated printing time uint32_t longestPrint; // Longest successful print job - float filamentUsed; // Accumulated filament consumed in mm + double filamentUsed; // Accumulated filament consumed in mm }; class PrintCounter: public Stopwatch { private: typedef Stopwatch super; - #if ENABLED(I2C_EEPROM) || ENABLED(SPI_EEPROM) - typedef uint32_t promdress; - #else - typedef uint16_t promdress; - #endif - - static printStatistics data; + printStatistics data; /** * @brief EEPROM address * @details Defines the start offset address where the data is stored. */ - static const promdress address; + const uint16_t address = 0x32; /** * @brief Interval in seconds between counter updates @@ -66,7 +61,7 @@ class PrintCounter: public Stopwatch { * @note The max value for this option is 60(s), otherwise integer * overflow will happen. */ - static const uint16_t updateInterval; + const uint16_t updateInterval = 10; /** * @brief Interval in seconds between EEPROM saves @@ -74,118 +69,107 @@ class PrintCounter: public Stopwatch { * EEPROM save cycle, the development team recommends to set this value * no lower than 3600 secs (1 hour). */ - static const uint16_t saveInterval; + const uint16_t saveInterval = 3600; /** * @brief Timestamp of the last call to deltaDuration() - * @details Store the timestamp of the last deltaDuration(), this is + * @details Stores the timestamp of the last deltaDuration(), this is * required due to the updateInterval cycle. */ - static millis_t lastDuration; + millis_t lastDuration; /** - * @brief Stats were loaded from EEPROM + * @brief Stats were loaded from EERPROM * @details If set to true it indicates if the statistical data was already * loaded from the EEPROM. */ - static bool loaded; + bool loaded = false; protected: /** * @brief dT since the last call - * @details Return the elapsed time in seconds since the last call, this is + * @details Returns the elapsed time in seconds since the last call, this is * used internally for print statistics accounting is not intended to be a * user callable function. */ - static millis_t deltaDuration(); + millis_t deltaDuration(); public: - /** - * @brief Initialize the print counter + * @brief Class constructor */ - static inline void init() { - super::init(); - loadStats(); - } + PrintCounter(); /** - * @brief Check if Print Statistics has been loaded - * @details Return true if the statistical data has been loaded. + * @brief Checks if Print Statistics has been loaded + * @details Returns true if the statistical data has been loaded. * @return bool */ - FORCE_INLINE static bool isLoaded() { return loaded; } + bool isLoaded(); /** - * @brief Increment the total filament used + * @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 */ - static void incFilamentUsed(float const &amount); + void incFilamentUsed(double const &amount); /** - * @brief Reset the Print Statistics - * @details Reset the statistics to zero and saves them to EEPROM creating + * @brief Resets the Print Statistics + * @details Resets the statistics to zero and saves them to EEPROM creating * also the magic header. */ - static void initStats(); + void initStats(); /** - * @brief Load the Print Statistics - * @details Load the statistics from EEPROM + * @brief Loads the Print Statistics + * @details Loads the statistics from EEPROM */ - static void loadStats(); + void loadStats(); /** - * @brief Save the Print Statistics - * @details Save the statistics to EEPROM + * @brief Saves the Print Statistics + * @details Saves the statistics to EEPROM */ - static void saveStats(); + void saveStats(); /** * @brief Serial output the Print Statistics * @details This function may change in the future, for now it directly * prints the statistical data to serial. */ - static void showStats(); + void showStats(); /** * @brief Return the currently loaded statistics * @details Return the raw data, in the same structure used internally */ - static printStatistics getStats() { return data; } + printStatistics getStats() { return this->data; } /** * @brief Loop function * @details This function should be called at loop, it will take care of * periodically save the statistical data to EEPROM and do time keeping. */ - static void tick(); + void tick(); /** * The following functions are being overridden */ - static bool start(); - static bool stop(); - static void reset(); + bool start(); + bool stop(); + void reset(); #if ENABLED(DEBUG_PRINTCOUNTER) /** - * @brief Print a debug message - * @details Print a simple debug message + * @brief Prints a debug message + * @details Prints a simple debug message "PrintCounter::function" */ static void debug(const char func[]); #endif }; -// Global Print Job Timer instance -#if ENABLED(PRINTCOUNTER) - extern PrintCounter print_job_timer; -#else - extern Stopwatch print_job_timer; -#endif - #endif // PRINTCOUNTER_H diff --git a/Marlin/serial.cpp b/Marlin/serial.cpp index 8b6a1c2..232a85c 100644 --- a/Marlin/serial.cpp +++ b/Marlin/serial.cpp @@ -25,12 +25,12 @@ const char errormagic[] PROGMEM = "Error:"; const char echomagic[] PROGMEM = "echo:"; -void serial_echopair_PGM(const char* s_P, const char *v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, char v) { serialprintPGM(s_P); SERIAL_CHAR(v); } -void serial_echopair_PGM(const char* s_P, int v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, float v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } +void serial_echopair_P(const char* s_P, const char *v) { serialprintPGM(s_P); SERIAL_ECHO(v); } +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 serial_spaces(uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR(' '); } +void serial_spaces(uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) MYSERIAL.write(' '); } diff --git a/Marlin/serial.h b/Marlin/serial.h index 139f99c..a2fd430 100644 --- a/Marlin/serial.h +++ b/Marlin/serial.h @@ -25,44 +25,34 @@ #include "MarlinConfig.h" -#if USE_MARLINSERIAL - #include "MarlinSerial.h" - #define MYSERIAL0 customizedSerial -#else +#ifdef USBCON #include #if ENABLED(BLUETOOTH) - extern HardwareSerial bluetoothSerial; - #define MYSERIAL0 bluetoothSerial + #define MYSERIAL bluetoothSerial #else - #define MYSERIAL0 Serial + #define MYSERIAL Serial #endif // BLUETOOTH +#else + #include "MarlinSerial.h" + #define MYSERIAL customizedSerial #endif extern const char echomagic[] PROGMEM; extern const char errormagic[] PROGMEM; -#define SERIAL_CHAR(x) ((void)MYSERIAL0.write(x)) +#define SERIAL_CHAR(x) ((void)MYSERIAL.write(x)) #define SERIAL_EOL() SERIAL_CHAR('\n') -#define SERIAL_PRINT(x,b) MYSERIAL0.print(x,b) -#define SERIAL_PRINTLN(x,b) MYSERIAL0.println(x,b) -#define SERIAL_PRINTF(args...) MYSERIAL0.printf(args) - -#define SERIAL_FLUSH() MYSERIAL0.flush() -#if TX_BUFFER_SIZE > 0 - #define SERIAL_FLUSHTX() MYSERIAL0.flushTX() -#endif - #define SERIAL_PROTOCOLCHAR(x) SERIAL_CHAR(x) -#define SERIAL_PROTOCOL(x) MYSERIAL0.print(x) -#define SERIAL_PROTOCOL_F(x,y) MYSERIAL0.print(x,y) -#define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x)) -#define SERIAL_PROTOCOLLN(x) do{ MYSERIAL0.print(x); SERIAL_EOL(); }while(0) -#define SERIAL_PROTOCOLLNPGM(x) serialprintPGM(PSTR(x "\n")) -#define SERIAL_PROTOCOLPAIR(name, value) serial_echopair_PGM(PSTR(name),(value)) +#define SERIAL_PROTOCOL(x) (MYSERIAL.print(x)) +#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) (serialprintPGM(PSTR(x "\n"))) +#define SERIAL_PROTOCOLPAIR(name, value) (serial_echopair_P(PSTR(name),(value))) #define SERIAL_PROTOCOLLNPAIR(name, value) do{ SERIAL_PROTOCOLPAIR(name, value); SERIAL_EOL(); }while(0) -#define SERIAL_ECHO_START() serialprintPGM(echomagic) +#define SERIAL_ECHO_START() (serialprintPGM(echomagic)) #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x) #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x) #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x) @@ -71,7 +61,7 @@ extern const char errormagic[] PROGMEM; #define SERIAL_ECHOLNPAIR(pre,value) SERIAL_PROTOCOLLNPAIR(pre, value) #define SERIAL_ECHO_F(x,y) SERIAL_PROTOCOL_F(x,y) -#define SERIAL_ERROR_START() serialprintPGM(errormagic) +#define SERIAL_ERROR_START() (serialprintPGM(errormagic)) #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x) #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x) #define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x) @@ -83,29 +73,29 @@ extern const char errormagic[] PROGMEM; #define SERIAL_ECHOPAIR_F(pre,value) SERIAL_ECHOPAIR(pre, FIXFLOAT(value)) #define SERIAL_ECHOLNPAIR_F(pre, value) SERIAL_ECHOLNPAIR(pre, FIXFLOAT(value)) -// -// Functions for serial printing from PROGMEM. (Saves loads of SRAM.) -// -FORCE_INLINE void serialprintPGM(const char* str) { - while (char ch = pgm_read_byte(str++)) SERIAL_CHAR(ch); -} - -void serial_echopair_PGM(const char* s_P, const char *v); -void serial_echopair_PGM(const char* s_P, char v); -void serial_echopair_PGM(const char* s_P, int v); -void serial_echopair_PGM(const char* s_P, long v); -void serial_echopair_PGM(const char* s_P, float v); -void serial_echopair_PGM(const char* s_P, double v); -void serial_echopair_PGM(const char* s_P, unsigned int v); -void serial_echopair_PGM(const char* s_P, unsigned long v); -FORCE_INLINE void serial_echopair_PGM(const char* s_P, uint8_t v) { serial_echopair_PGM(s_P, (int)v); } -FORCE_INLINE void serial_echopair_PGM(const char* s_P, uint16_t v) { serial_echopair_PGM(s_P, (int)v); } -FORCE_INLINE void serial_echopair_PGM(const char* s_P, bool v) { serial_echopair_PGM(s_P, (int)v); } -FORCE_INLINE void serial_echopair_PGM(const char* s_P, void *v) { serial_echopair_PGM(s_P, (unsigned long)v); } +void serial_echopair_P(const char* s_P, const char *v); +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 int 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); } void serial_spaces(uint8_t count); #define SERIAL_ECHO_SP(C) serial_spaces(C) #define SERIAL_ERROR_SP(C) serial_spaces(C) #define SERIAL_PROTOCOL_SP(C) serial_spaces(C) +// +// Functions for serial printing from PROGMEM. (Saves loads of SRAM.) +// +FORCE_INLINE void serialprintPGM(const char* str) { + while (char ch = pgm_read_byte(str++)) MYSERIAL.write(ch); +} + #endif // __SERIAL_H__ diff --git a/Marlin/servo.cpp b/Marlin/servo.cpp index e1d1157..d6b7b70 100644 --- a/Marlin/servo.cpp +++ b/Marlin/servo.cpp @@ -58,7 +58,6 @@ #include #include "servo.h" -#include "utility.h" #define usToTicks(_us) (( clockCyclesPerMicrosecond()* _us) / 8) // converts microseconds to tick (assumes prescale of 8) // 12 Aug 2009 #define ticksToUs(_ticks) (( (unsigned)_ticks * 8)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds @@ -237,6 +236,7 @@ static bool isTimerActive(timer16_Sequence_t timer) { return false; } + /****************** end of static functions ******************************/ Servo::Servo() { @@ -248,18 +248,18 @@ Servo::Servo() { this->servoIndex = INVALID_SERVO; // too many servos } -int8_t Servo::attach(const int pin) { +int8_t Servo::attach(int pin) { return this->attach(pin, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH); } -int8_t Servo::attach(const int pin, const int min, const int max) { +int8_t Servo::attach(int pin, int min, int max) { if (this->servoIndex >= MAX_SERVOS) return -1; if (pin > 0) servo_info[this->servoIndex].Pin.nbr = pin; pinMode(servo_info[this->servoIndex].Pin.nbr, OUTPUT); // set servo pin to output - // todo min/max check: ABS(min - MIN_PULSE_WIDTH) /4 < 128 + // todo min/max check: abs(min - MIN_PULSE_WIDTH) /4 < 128 this->min = (MIN_PULSE_WIDTH - min) / 4; //resolution of min/max is 4 uS this->max = (MAX_PULSE_WIDTH - max) / 4; @@ -307,16 +307,16 @@ int Servo::readMicroseconds() { bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; } -void Servo::move(const int value) { +void Servo::move(int value) { constexpr uint16_t servo_delay[] = SERVO_DELAY; static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); if (this->attach(0) >= 0) { this->write(value); - safe_delay(servo_delay[this->servoIndex]); + delay(servo_delay[this->servoIndex]); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) this->detach(); #endif } } -#endif // HAS_SERVOS +#endif diff --git a/Marlin/servo.h b/Marlin/servo.h index 1649646..ad75b6b 100644 --- a/Marlin/servo.h +++ b/Marlin/servo.h @@ -21,53 +21,53 @@ */ /** - * servo.h - 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.h - 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 +*/ /** - * - * 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 sequence used to seize timers is defined in timers.h - * - * 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 - * 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. - * move(angle) - Sequence of attach(0), write(angle), - * With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY and detach. + + 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 sequence used to seize timers is defined in timers.h + + 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 + 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. + move(angle) - Sequence of attach(0), write(angle), + With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY and detach. */ -#ifndef SERVO_H -#define SERVO_H +#ifndef servo_h +#define servo_h #include @@ -114,6 +114,7 @@ typedef enum { _Nbr_16timers } timer16_Sequence_t; + #define Servo_VERSION 2 // software version of this library #define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo @@ -139,12 +140,12 @@ typedef struct { class Servo { public: Servo(); - int8_t attach(const int pin); // attach the given pin to the next free channel, set pinMode, return channel number (-1 on fail) - int8_t attach(const int pin, const int min, const int max); // as above but also sets min and max values for writes. + int8_t attach(int pin); // attach the given pin to the next free channel, set pinMode, return channel number (-1 on fail) + int8_t attach(int pin, int min, int max); // as above but also sets min and max values for writes. void detach(); void write(int value); // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds void writeMicroseconds(int value); // write pulse width in microseconds - void move(const int value); // attach the servo, then move to value + 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_DELAY, then detach int read(); // returns current pulse width as an angle between 0 and 180 degrees @@ -157,4 +158,4 @@ class Servo { int8_t max; // maximum is this value times 4 added to MAX_PULSE_WIDTH }; -#endif // SERVO_H +#endif diff --git a/Marlin/softspi.h b/Marlin/softspi.h index c9fbea0..3b77e44 100644 --- a/Marlin/softspi.h +++ b/Marlin/softspi.h @@ -42,10 +42,11 @@ bool fastDigitalRead(uint8_t pin){ */ static inline __attribute__((always_inline)) void fastDigitalWrite(uint8_t pin, bool value){ - if (value) + if(value) { g_APinDescription[pin].pPort->PIO_SODR = g_APinDescription[pin].ulPin; - else + } else { g_APinDescription[pin].pPort->PIO_CODR = g_APinDescription[pin].ulPin; + } } #endif // CORE_TEENSY //------------------------------------------------------------------------------ diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 0bbda6d..664022b 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -41,41 +41,8 @@ * along with Grbl. If not, see . */ -/** - * Timer calculations informed by the 'RepRap cartesian firmware' by Zack Smith - * and Philipp Tiefenbacher. - */ - -/** - * __________________________ - * /| |\ _________________ ^ - * / | | \ /| |\ | - * / | | \ / | | \ s - * / | | | | | \ p - * / | | | | | \ e - * +-----+------------------------+---+--+---------------+----+ e - * | BLOCK 1 | BLOCK 2 | d - * - * time -----> - * - * The trapezoid is the shape the speed curve over time. It starts at block->initial_rate, accelerates - * first block->accelerate_until step_events_completed, then keeps going at constant speed until - * step_events_completed reaches block->decelerate_after after which it decelerates until the trapezoid generator is reset. - * The slope of acceleration is calculated using v = u + at where t is the accumulated timer values of the steps so far. - */ - -/** - * Marlin uses the Bresenham algorithm. For a detailed explanation of theory and - * method see https://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html - */ - -/** - * Jerk controlled movements planner added Apr 2018 by Eduardo José Tagle. - * Equations based on Synthethos TinyG2 sources, but the fixed-point - * implementation is new, as we are running the ISR with a variable period. - * Also implemented the Bézier velocity curve evaluation in ARM assembler, - * to avoid impacting ISR speed. - */ +/* The timer calculations of this module informed by the 'RepRap cartesian firmware' by Zack Smith + and Philipp Tiefenbacher. */ #include "Marlin.h" #include "stepper.h" @@ -86,7 +53,10 @@ #include "language.h" #include "cardreader.h" #include "speed_lookuptable.h" -#include "delay.h" + +#if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL) + #include "ubl.h" +#endif #if HAS_DIGIPOTSS #include @@ -96,8 +66,14 @@ Stepper stepper; // Singleton // public: +block_t* Stepper::current_block = NULL; // A pointer to the block currently being traced + +#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) + bool Stepper::abort_on_endstop_hit = false; +#endif + #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - bool Stepper::homing_dual_axis = false; + bool Stepper::performing_homing = false; #endif #if HAS_MOTOR_CURRENT_PWM @@ -106,135 +82,120 @@ Stepper stepper; // Singleton // private: -block_t* Stepper::current_block = NULL; // A pointer to the block currently being traced - -uint8_t Stepper::last_direction_bits = 0, - Stepper::axis_did_move; - -bool Stepper::abort_current_block; - -#if DISABLED(MIXING_EXTRUDER) - uint8_t Stepper::last_moved_extruder = 0xFF; -#endif +uint8_t Stepper::last_direction_bits = 0; // The next stepping-bits to be output +int16_t Stepper::cleaning_buffer_counter = 0; #if ENABLED(X_DUAL_ENDSTOPS) - bool Stepper::locked_X_motor = false, Stepper::locked_X2_motor = false; + bool Stepper::locked_x_motor = false, Stepper::locked_x2_motor = false; #endif #if ENABLED(Y_DUAL_ENDSTOPS) - bool Stepper::locked_Y_motor = false, Stepper::locked_Y2_motor = false; + bool Stepper::locked_y_motor = false, Stepper::locked_y2_motor = false; #endif #if ENABLED(Z_DUAL_ENDSTOPS) - bool Stepper::locked_Z_motor = false, Stepper::locked_Z2_motor = false; + bool Stepper::locked_z_motor = false, Stepper::locked_z2_motor = false; #endif -uint32_t Stepper::acceleration_time, Stepper::deceleration_time; -uint8_t Stepper::steps_per_isr; +long Stepper::counter_X = 0, + Stepper::counter_Y = 0, + Stepper::counter_Z = 0, + Stepper::counter_E = 0; -#if DISABLED(ADAPTIVE_STEP_SMOOTHING) - constexpr -#endif - uint8_t Stepper::oversampling_factor; - -int32_t Stepper::delta_error[NUM_AXIS] = { 0 }; -uint32_t Stepper::advance_dividend[NUM_AXIS] = { 0 }, - Stepper::advance_divisor = 0, - Stepper::step_events_completed = 0, // The number of step events executed in the current block - Stepper::accelerate_until, // The point from where we need to stop acceleration - Stepper::decelerate_after, // The point from where we need to start decelerating - Stepper::step_event_count; // The total event count for the current block - -#if ENABLED(MIXING_EXTRUDER) - int32_t Stepper::delta_error_m[MIXING_STEPPERS]; - uint32_t Stepper::advance_dividend_m[MIXING_STEPPERS], - Stepper::advance_divisor_m; -#else - int8_t Stepper::active_extruder; // Active extruder -#endif - -#if ENABLED(S_CURVE_ACCELERATION) - int32_t __attribute__((used)) Stepper::bezier_A __asm__("bezier_A"); // A coefficient in Bézier speed curve with alias for assembler - int32_t __attribute__((used)) Stepper::bezier_B __asm__("bezier_B"); // B coefficient in Bézier speed curve with alias for assembler - int32_t __attribute__((used)) Stepper::bezier_C __asm__("bezier_C"); // C coefficient in Bézier speed curve with alias for assembler - uint32_t __attribute__((used)) Stepper::bezier_F __asm__("bezier_F"); // F coefficient in Bézier speed curve with alias for assembler - uint32_t __attribute__((used)) Stepper::bezier_AV __asm__("bezier_AV"); // AV coefficient in Bézier speed curve with alias for assembler - bool __attribute__((used)) Stepper::A_negative __asm__("A_negative"); // If A coefficient was negative - bool Stepper::bezier_2nd_half; // =false If Bézier curve has been initialized or not -#endif - -uint32_t Stepper::nextMainISR = 0; +volatile uint32_t Stepper::step_events_completed = 0; // The number of step events executed in the current block #if ENABLED(LIN_ADVANCE) - constexpr uint32_t LA_ADV_NEVER = 0xFFFFFFFF; - uint32_t Stepper::nextAdvanceISR = LA_ADV_NEVER, - Stepper::LA_isr_rate = LA_ADV_NEVER; - uint16_t Stepper::LA_current_adv_steps = 0, - Stepper::LA_final_adv_steps, - Stepper::LA_max_adv_steps; + constexpr uint16_t ADV_NEVER = 65535; - int8_t Stepper::LA_steps = 0; + uint16_t Stepper::nextMainISR = 0, + Stepper::nextAdvanceISR = ADV_NEVER, + Stepper::eISR_Rate = ADV_NEVER; - bool Stepper::LA_use_advance_lead; + volatile int Stepper::e_steps[E_STEPPERS]; + int Stepper::final_estep_rate, + Stepper::current_estep_rate[E_STEPPERS], + Stepper::current_adv_steps[E_STEPPERS]; + + /** + * See https://github.com/MarlinFirmware/Marlin/issues/5699#issuecomment-309264382 + * + * This fix isn't perfect and may lose steps - but better than locking up completely + * in future the planner should slow down if advance stepping rate would be too high + */ + FORCE_INLINE uint16_t adv_rate(const int steps, const uint16_t timer, const uint8_t loops) { + if (steps) { + const uint16_t rate = (timer * loops) / abs(steps); + //return constrain(rate, 1, ADV_NEVER - 1) + return rate ? rate : 1; + } + return ADV_NEVER; + } #endif // LIN_ADVANCE -int32_t Stepper::ticks_nominal = -1; +long Stepper::acceleration_time, Stepper::deceleration_time; -#if DISABLED(S_CURVE_ACCELERATION) - uint32_t Stepper::acc_step_rate; // needed for deceleration start point +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 -volatile int32_t Stepper::endstops_trigsteps[XYZ], - Stepper::count_position[NUM_AXIS] = { 0 }; -int8_t Stepper::count_direction[NUM_AXIS] = { - 1, 1, 1, 1 - #if ENABLED(HANGPRINTER) - , 1 - #endif -}; +uint8_t Stepper::step_loops, Stepper::step_loops_nominal; + +uint16_t Stepper::OCR1A_nominal, + Stepper::acc_step_rate; // needed for deceleration start point + +volatile long Stepper::endstops_trigsteps[XYZ]; #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - #define DUAL_ENDSTOP_APPLY_STEP(A,V) \ - if (homing_dual_axis) { \ - if (A##_HOME_DIR < 0) { \ - if (!(TEST(endstops.state(), A##_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##_motor) A##_STEP_WRITE(V); \ - if (!(TEST(endstops.state(), A##2_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \ - } \ - else { \ - if (!(TEST(endstops.state(), A##_MAX) && count_direction[_AXIS(A)] > 0) && !locked_##A##_motor) A##_STEP_WRITE(V); \ - if (!(TEST(endstops.state(), A##2_MAX) && count_direction[_AXIS(A)] > 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \ - } \ - } \ - else { \ - A##_STEP_WRITE(V); \ - A##2_STEP_WRITE(V); \ + #define LOCKED_X_MOTOR locked_x_motor + #define LOCKED_Y_MOTOR locked_y_motor + #define LOCKED_Z_MOTOR locked_z_motor + #define LOCKED_X2_MOTOR locked_x2_motor + #define LOCKED_Y2_MOTOR locked_y2_motor + #define LOCKED_Z2_MOTOR locked_z2_motor + #define DUAL_ENDSTOP_APPLY_STEP(AXIS,v) \ + if (performing_homing) { \ + if (AXIS##_HOME_DIR < 0) { \ + if (!(TEST(endstops.old_endstop_bits, AXIS##_MIN) && (count_direction[AXIS##_AXIS] < 0)) && !LOCKED_##AXIS##_MOTOR) AXIS##_STEP_WRITE(v); \ + if (!(TEST(endstops.old_endstop_bits, AXIS##2_MIN) && (count_direction[AXIS##_AXIS] < 0)) && !LOCKED_##AXIS##2_MOTOR) AXIS##2_STEP_WRITE(v); \ + } \ + else { \ + if (!(TEST(endstops.old_endstop_bits, AXIS##_MAX) && (count_direction[AXIS##_AXIS] > 0)) && !LOCKED_##AXIS##_MOTOR) AXIS##_STEP_WRITE(v); \ + if (!(TEST(endstops.old_endstop_bits, AXIS##2_MAX) && (count_direction[AXIS##_AXIS] > 0)) && !LOCKED_##AXIS##2_MOTOR) AXIS##2_STEP_WRITE(v); \ + } \ + } \ + else { \ + AXIS##_STEP_WRITE(v); \ + AXIS##2_STEP_WRITE(v); \ } #endif #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) - #if ENABLED(X_DUAL_ENDSTOPS) + #if ENABLED(DUAL_X_CARRIAGE) + #define X_APPLY_DIR(v,ALWAYS) \ + if (extruder_duplication_enabled || ALWAYS) { \ + X_DIR_WRITE(v); \ + X2_DIR_WRITE(v); \ + } \ + else { \ + if (current_block->active_extruder) X2_DIR_WRITE(v); else X_DIR_WRITE(v); \ + } + #define X_APPLY_STEP(v,ALWAYS) \ + if (extruder_duplication_enabled || ALWAYS) { \ + X_STEP_WRITE(v); \ + X2_STEP_WRITE(v); \ + } \ + else { \ + if (current_block->active_extruder) X2_STEP_WRITE(v); else X_STEP_WRITE(v); \ + } + #elif ENABLED(X_DUAL_ENDSTOPS) #define X_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(X,v) #else #define X_APPLY_STEP(v,Q) do{ X_STEP_WRITE(v); X2_STEP_WRITE(v); }while(0) #endif -#elif ENABLED(DUAL_X_CARRIAGE) - #define X_APPLY_DIR(v,ALWAYS) \ - if (extruder_duplication_enabled || ALWAYS) { \ - X_DIR_WRITE(v); \ - X2_DIR_WRITE(v); \ - } \ - else { \ - if (movement_extruder()) X2_DIR_WRITE(v); else X_DIR_WRITE(v); \ - } - #define X_APPLY_STEP(v,ALWAYS) \ - if (extruder_duplication_enabled || ALWAYS) { \ - X_STEP_WRITE(v); \ - X2_STEP_WRITE(v); \ - } \ - else { \ - if (movement_extruder()) X2_STEP_WRITE(v); else X_STEP_WRITE(v); \ - } #else #define X_APPLY_DIR(v,Q) X_DIR_WRITE(v) #define X_APPLY_STEP(v,Q) X_STEP_WRITE(v) @@ -264,92 +225,85 @@ int8_t Stepper::count_direction[NUM_AXIS] = { #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v) #endif -/** - * Hangprinter's mapping {A,B,C,D} <-> {X,Y,Z,E1} happens here. - * If you have two extruders: {A,B,C,D} <-> {X,Y,Z,E2} - * ... etc up to max 4 extruders. - * Place D connector on your first "free" extruder output. - */ -#if ENABLED(HANGPRINTER) - #define A_APPLY_DIR(v,Q) X_APPLY_DIR(v,Q) - #define A_APPLY_STEP(v,Q) X_APPLY_STEP(v,Q) - - #define B_APPLY_DIR(v,Q) Y_APPLY_DIR(v,Q) - #define B_APPLY_STEP(v,Q) Y_APPLY_STEP(v,Q) - - #define C_APPLY_DIR(v,Q) Z_APPLY_DIR(v,Q) - #define C_APPLY_STEP(v,Q) Z_APPLY_STEP(v,Q) - - #define __D_APPLY(I,T,v) E##I##_##T##_WRITE(v) - #define _D_APPLY(I,T,v) __D_APPLY(I,T,v) - #define D_APPLY_DIR(v,Q) _D_APPLY(EXTRUDERS, DIR, v) - #define D_APPLY_STEP(v,Q) _D_APPLY(EXTRUDERS, STEP, v) -#endif - #if DISABLED(MIXING_EXTRUDER) - #define E_APPLY_STEP(v,Q) E_STEP_WRITE(active_extruder, v) + #define E_APPLY_STEP(v,Q) E_STEP_WRITE(v) #endif // intRes = longIn1 * longIn2 >> 24 // uses: -// A[tmp] to store 0 -// B[tmp] to store bits 16-23 of the 48bit result. The top bit is used to round the two byte result. +// r26 to store 0 +// r27 to store bits 16-23 of the 48bit result. The top bit is used to round the two byte result. // note that the lower two bytes and the upper byte of the 48bit result are not calculated. // this can cause the result to be out by one as the lower bytes may cause carries into the upper ones. -// B A are bits 24-39 and are the returned value -// C B A is longIn1 -// D C B A is longIn2 +// B0 A0 are bits 24-39 and are the returned value +// C1 B1 A1 is longIn1 +// D2 C2 B2 A2 is longIn2 // -static FORCE_INLINE uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2) { - register uint8_t tmp1; - register uint8_t tmp2; - register uint16_t intRes; - __asm__ __volatile__( - A("clr %[tmp1]") - A("mul %A[longIn1], %B[longIn2]") - A("mov %[tmp2], r1") - A("mul %B[longIn1], %C[longIn2]") - A("movw %A[intRes], r0") - A("mul %C[longIn1], %C[longIn2]") - A("add %B[intRes], r0") - A("mul %C[longIn1], %B[longIn2]") - A("add %A[intRes], r0") - A("adc %B[intRes], r1") - A("mul %A[longIn1], %C[longIn2]") - A("add %[tmp2], r0") - A("adc %A[intRes], r1") - A("adc %B[intRes], %[tmp1]") - A("mul %B[longIn1], %B[longIn2]") - A("add %[tmp2], r0") - A("adc %A[intRes], r1") - A("adc %B[intRes], %[tmp1]") - A("mul %C[longIn1], %A[longIn2]") - A("add %[tmp2], r0") - A("adc %A[intRes], r1") - A("adc %B[intRes], %[tmp1]") - A("mul %B[longIn1], %A[longIn2]") - A("add %[tmp2], r1") - A("adc %A[intRes], %[tmp1]") - A("adc %B[intRes], %[tmp1]") - A("lsr %[tmp2]") - A("adc %A[intRes], %[tmp1]") - A("adc %B[intRes], %[tmp1]") - A("mul %D[longIn2], %A[longIn1]") - A("add %A[intRes], r0") - A("adc %B[intRes], r1") - A("mul %D[longIn2], %B[longIn1]") - A("add %B[intRes], r0") - A("clr r1") - : [intRes] "=&r" (intRes), - [tmp1] "=&r" (tmp1), - [tmp2] "=&r" (tmp2) - : [longIn1] "d" (longIn1), - [longIn2] "d" (longIn2) - : "cc" - ); - return intRes; -} +#define MultiU24X32toH16(intRes, longIn1, longIn2) \ + asm volatile ( \ + "clr r26 \n\t" \ + "mul %A1, %B2 \n\t" \ + "mov r27, r1 \n\t" \ + "mul %B1, %C2 \n\t" \ + "movw %A0, r0 \n\t" \ + "mul %C1, %C2 \n\t" \ + "add %B0, r0 \n\t" \ + "mul %C1, %B2 \n\t" \ + "add %A0, r0 \n\t" \ + "adc %B0, r1 \n\t" \ + "mul %A1, %C2 \n\t" \ + "add r27, r0 \n\t" \ + "adc %A0, r1 \n\t" \ + "adc %B0, r26 \n\t" \ + "mul %B1, %B2 \n\t" \ + "add r27, r0 \n\t" \ + "adc %A0, r1 \n\t" \ + "adc %B0, r26 \n\t" \ + "mul %C1, %A2 \n\t" \ + "add r27, r0 \n\t" \ + "adc %A0, r1 \n\t" \ + "adc %B0, r26 \n\t" \ + "mul %B1, %A2 \n\t" \ + "add r27, r1 \n\t" \ + "adc %A0, r26 \n\t" \ + "adc %B0, r26 \n\t" \ + "lsr r27 \n\t" \ + "adc %A0, r26 \n\t" \ + "adc %B0, r26 \n\t" \ + "mul %D2, %A1 \n\t" \ + "add %A0, r0 \n\t" \ + "adc %B0, r1 \n\t" \ + "mul %D2, %B1 \n\t" \ + "add %B0, r0 \n\t" \ + "clr r1 \n\t" \ + : \ + "=&r" (intRes) \ + : \ + "d" (longIn1), \ + "d" (longIn2) \ + : \ + "r26" , "r27" \ + ) +// Some useful constants + +/** + * __________________________ + * /| |\ _________________ ^ + * / | | \ /| |\ | + * / | | \ / | | \ s + * / | | | | | \ p + * / | | | | | \ e + * +-----+------------------------+---+--+---------------+----+ e + * | BLOCK 1 | BLOCK 2 | d + * + * time -----> + * + * The trapezoid is the shape the speed curve over time. It starts at block->initial_rate, accelerates + * first block->accelerate_until step_events_completed, then keeps going at constant speed until + * step_events_completed reaches block->decelerate_after after which it decelerates until the trapezoid generator is reset. + * The slope of acceleration is calculated using v = u + at where t is the accumulated timer values of the steps so far. + */ void Stepper::wake_up() { // TCNT1 = 0; ENABLE_STEPPER_DRIVER_INTERRUPT(); @@ -364,14 +318,14 @@ void Stepper::wake_up() { */ void Stepper::set_directions() { - #define SET_STEP_DIR(A) \ - if (motor_direction(_AXIS(A))) { \ - A##_APPLY_DIR(INVERT_## A##_DIR, false); \ - count_direction[_AXIS(A)] = -1; \ + #define SET_STEP_DIR(AXIS) \ + if (motor_direction(AXIS ##_AXIS)) { \ + AXIS ##_APPLY_DIR(INVERT_## AXIS ##_DIR, false); \ + count_direction[AXIS ##_AXIS] = -1; \ } \ else { \ - A##_APPLY_DIR(!INVERT_## A##_DIR, false); \ - count_direction[_AXIS(A)] = 1; \ + AXIS ##_APPLY_DIR(!INVERT_## AXIS ##_DIR, false); \ + count_direction[AXIS ##_AXIS] = 1; \ } #if HAS_X_DIR @@ -383,1058 +337,331 @@ void Stepper::set_directions() { #if HAS_Z_DIR SET_STEP_DIR(Z); // C #endif - #if ENABLED(HANGPRINTER) - SET_STEP_DIR(D); - #endif #if DISABLED(LIN_ADVANCE) - #if ENABLED(MIXING_EXTRUDER) - if (motor_direction(E_AXIS)) { - MIXING_STEPPERS_LOOP(j) REV_E_DIR(j); - count_direction[E_AXIS] = -1; - } - else { - MIXING_STEPPERS_LOOP(j) NORM_E_DIR(j); - count_direction[E_AXIS] = 1; - } - #else - if (motor_direction(E_AXIS)) { - REV_E_DIR(active_extruder); - count_direction[E_AXIS] = -1; - } - else { - NORM_E_DIR(active_extruder); - count_direction[E_AXIS] = 1; - } - #endif + if (motor_direction(E_AXIS)) { + REV_E_DIR(); + count_direction[E_AXIS] = -1; + } + else { + NORM_E_DIR(); + count_direction[E_AXIS] = 1; + } #endif // !LIN_ADVANCE - - // A small delay may be needed after changing direction - #if MINIMUM_STEPPER_DIR_DELAY > 0 - DELAY_NS(MINIMUM_STEPPER_DIR_DELAY); - #endif } -#if ENABLED(S_CURVE_ACCELERATION) - /** - * This uses a quintic (fifth-degree) Bézier polynomial for the velocity curve, giving - * a "linear pop" velocity curve; with pop being the sixth derivative of position: - * velocity - 1st, acceleration - 2nd, jerk - 3rd, snap - 4th, crackle - 5th, pop - 6th - * - * The Bézier curve takes the form: - * - * V(t) = P_0 * B_0(t) + P_1 * B_1(t) + P_2 * B_2(t) + P_3 * B_3(t) + P_4 * B_4(t) + P_5 * B_5(t) - * - * Where 0 <= t <= 1, and V(t) is the velocity. P_0 through P_5 are the control points, and B_0(t) - * through B_5(t) are the Bernstein basis as follows: - * - * B_0(t) = (1-t)^5 = -t^5 + 5t^4 - 10t^3 + 10t^2 - 5t + 1 - * B_1(t) = 5(1-t)^4 * t = 5t^5 - 20t^4 + 30t^3 - 20t^2 + 5t - * B_2(t) = 10(1-t)^3 * t^2 = -10t^5 + 30t^4 - 30t^3 + 10t^2 - * B_3(t) = 10(1-t)^2 * t^3 = 10t^5 - 20t^4 + 10t^3 - * B_4(t) = 5(1-t) * t^4 = -5t^5 + 5t^4 - * B_5(t) = t^5 = t^5 - * ^ ^ ^ ^ ^ ^ - * | | | | | | - * A B C D E F - * - * Unfortunately, we cannot use forward-differencing to calculate each position through - * the curve, as Marlin uses variable timer periods. So, we require a formula of the form: - * - * V_f(t) = A*t^5 + B*t^4 + C*t^3 + D*t^2 + E*t + F - * - * Looking at the above B_0(t) through B_5(t) expanded forms, if we take the coefficients of t^5 - * through t of the Bézier form of V(t), we can determine that: - * - * A = -P_0 + 5*P_1 - 10*P_2 + 10*P_3 - 5*P_4 + P_5 - * B = 5*P_0 - 20*P_1 + 30*P_2 - 20*P_3 + 5*P_4 - * C = -10*P_0 + 30*P_1 - 30*P_2 + 10*P_3 - * D = 10*P_0 - 20*P_1 + 10*P_2 - * E = - 5*P_0 + 5*P_1 - * F = P_0 - * - * Now, since we will (currently) *always* want the initial acceleration and jerk values to be 0, - * We set P_i = P_0 = P_1 = P_2 (initial velocity), and P_t = P_3 = P_4 = P_5 (target velocity), - * which, after simplification, resolves to: - * - * A = - 6*P_i + 6*P_t = 6*(P_t - P_i) - * B = 15*P_i - 15*P_t = 15*(P_i - P_t) - * C = -10*P_i + 10*P_t = 10*(P_t - P_i) - * D = 0 - * E = 0 - * F = P_i - * - * As the t is evaluated in non uniform steps here, there is no other way rather than evaluating - * the Bézier curve at each point: - * - * V_f(t) = A*t^5 + B*t^4 + C*t^3 + F [0 <= t <= 1] - * - * Floating point arithmetic execution time cost is prohibitive, so we will transform the math to - * use fixed point values to be able to evaluate it in realtime. Assuming a maximum of 250000 steps - * per second (driver pulses should at least be 2µS hi/2µS lo), and allocating 2 bits to avoid - * overflows on the evaluation of the Bézier curve, means we can use - * - * t: unsigned Q0.32 (0 <= t < 1) |range 0 to 0xFFFFFFFF unsigned - * A: signed Q24.7 , |range = +/- 250000 * 6 * 128 = +/- 192000000 = 0x0B71B000 | 28 bits + sign - * B: signed Q24.7 , |range = +/- 250000 *15 * 128 = +/- 480000000 = 0x1C9C3800 | 29 bits + sign - * C: signed Q24.7 , |range = +/- 250000 *10 * 128 = +/- 320000000 = 0x1312D000 | 29 bits + sign - * F: signed Q24.7 , |range = +/- 250000 * 128 = 32000000 = 0x01E84800 | 25 bits + sign - * - * The trapezoid generator state contains the following information, that we will use to create and evaluate - * the Bézier curve: - * - * blk->step_event_count [TS] = The total count of steps for this movement. (=distance) - * blk->initial_rate [VI] = The initial steps per second (=velocity) - * blk->final_rate [VF] = The ending steps per second (=velocity) - * and the count of events completed (step_events_completed) [CS] (=distance until now) - * - * Note the abbreviations we use in the following formulae are between []s - * - * For Any 32bit CPU: - * - * At the start of each trapezoid, calculate the coefficients A,B,C,F and Advance [AV], as follows: - * - * A = 6*128*(VF - VI) = 768*(VF - VI) - * B = 15*128*(VI - VF) = 1920*(VI - VF) - * C = 10*128*(VF - VI) = 1280*(VF - VI) - * F = 128*VI = 128*VI - * AV = (1<<32)/TS ~= 0xFFFFFFFF / TS (To use ARM UDIV, that is 32 bits) (this is computed at the planner, to offload expensive calculations from the ISR) - * - * And for each point, evaluate the curve with the following sequence: - * - * void lsrs(uint32_t& d, uint32_t s, int cnt) { - * d = s >> cnt; - * } - * void lsls(uint32_t& d, uint32_t s, int cnt) { - * d = s << cnt; - * } - * void lsrs(int32_t& d, uint32_t s, int cnt) { - * d = uint32_t(s) >> cnt; - * } - * void lsls(int32_t& d, uint32_t s, int cnt) { - * d = uint32_t(s) << cnt; - * } - * void umull(uint32_t& rlo, uint32_t& rhi, uint32_t op1, uint32_t op2) { - * uint64_t res = uint64_t(op1) * op2; - * rlo = uint32_t(res & 0xFFFFFFFF); - * rhi = uint32_t((res >> 32) & 0xFFFFFFFF); - * } - * void smlal(int32_t& rlo, int32_t& rhi, int32_t op1, int32_t op2) { - * int64_t mul = int64_t(op1) * op2; - * int64_t s = int64_t(uint32_t(rlo) | ((uint64_t(uint32_t(rhi)) << 32U))); - * mul += s; - * rlo = int32_t(mul & 0xFFFFFFFF); - * rhi = int32_t((mul >> 32) & 0xFFFFFFFF); - * } - * int32_t _eval_bezier_curve_arm(uint32_t curr_step) { - * register uint32_t flo = 0; - * register uint32_t fhi = bezier_AV * curr_step; - * register uint32_t t = fhi; - * register int32_t alo = bezier_F; - * register int32_t ahi = 0; - * register int32_t A = bezier_A; - * register int32_t B = bezier_B; - * register int32_t C = bezier_C; - * - * lsrs(ahi, alo, 1); // a = F << 31 - * lsls(alo, alo, 31); // - * umull(flo, fhi, fhi, t); // f *= t - * umull(flo, fhi, fhi, t); // f>>=32; f*=t - * lsrs(flo, fhi, 1); // - * smlal(alo, ahi, flo, C); // a+=(f>>33)*C - * umull(flo, fhi, fhi, t); // f>>=32; f*=t - * lsrs(flo, fhi, 1); // - * smlal(alo, ahi, flo, B); // a+=(f>>33)*B - * umull(flo, fhi, fhi, t); // f>>=32; f*=t - * lsrs(flo, fhi, 1); // f>>=33; - * smlal(alo, ahi, flo, A); // a+=(f>>33)*A; - * lsrs(alo, ahi, 6); // a>>=38 - * - * return alo; - * } - * - * This is rewritten in ARM assembly for optimal performance (43 cycles to execute). - * - * For AVR, the precision of coefficients is scaled so the Bézier curve can be evaluated in real-time: - * Let's reduce precision as much as possible. After some experimentation we found that: - * - * Assume t and AV with 24 bits is enough - * A = 6*(VF - VI) - * B = 15*(VI - VF) - * C = 10*(VF - VI) - * F = VI - * AV = (1<<24)/TS (this is computed at the planner, to offload expensive calculations from the ISR) - * - * Instead of storing sign for each coefficient, we will store its absolute value, - * and flag the sign of the A coefficient, so we can save to store the sign bit. - * It always holds that sign(A) = - sign(B) = sign(C) - * - * So, the resulting range of the coefficients are: - * - * t: unsigned (0 <= t < 1) |range 0 to 0xFFFFFF unsigned - * A: signed Q24 , range = 250000 * 6 = 1500000 = 0x16E360 | 21 bits - * B: signed Q24 , range = 250000 *15 = 3750000 = 0x393870 | 22 bits - * C: signed Q24 , range = 250000 *10 = 2500000 = 0x1312D0 | 21 bits - * F: signed Q24 , range = 250000 = 250000 = 0x0ED090 | 20 bits - * - * And for each curve, estimate its coefficients with: - * - * void _calc_bezier_curve_coeffs(int32_t v0, int32_t v1, uint32_t av) { - * // Calculate the Bézier coefficients - * if (v1 < v0) { - * A_negative = true; - * bezier_A = 6 * (v0 - v1); - * bezier_B = 15 * (v0 - v1); - * bezier_C = 10 * (v0 - v1); - * } - * else { - * A_negative = false; - * bezier_A = 6 * (v1 - v0); - * bezier_B = 15 * (v1 - v0); - * bezier_C = 10 * (v1 - v0); - * } - * bezier_F = v0; - * } - * - * And for each point, evaluate the curve with the following sequence: - * - * // unsigned multiplication of 24 bits x 24bits, return upper 16 bits - * void umul24x24to16hi(uint16_t& r, uint24_t op1, uint24_t op2) { - * r = (uint64_t(op1) * op2) >> 8; - * } - * // unsigned multiplication of 16 bits x 16bits, return upper 16 bits - * void umul16x16to16hi(uint16_t& r, uint16_t op1, uint16_t op2) { - * r = (uint32_t(op1) * op2) >> 16; - * } - * // unsigned multiplication of 16 bits x 24bits, return upper 24 bits - * void umul16x24to24hi(uint24_t& r, uint16_t op1, uint24_t op2) { - * r = uint24_t((uint64_t(op1) * op2) >> 16); - * } - * - * int32_t _eval_bezier_curve(uint32_t curr_step) { - * // To save computing, the first step is always the initial speed - * if (!curr_step) - * return bezier_F; - * - * uint16_t t; - * umul24x24to16hi(t, bezier_AV, curr_step); // t: Range 0 - 1^16 = 16 bits - * uint16_t f = t; - * umul16x16to16hi(f, f, t); // Range 16 bits (unsigned) - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^3 (unsigned) - * uint24_t acc = bezier_F; // Range 20 bits (unsigned) - * if (A_negative) { - * uint24_t v; - * umul16x24to24hi(v, f, bezier_C); // Range 21bits - * acc -= v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^4 (unsigned) - * umul16x24to24hi(v, f, bezier_B); // Range 22bits - * acc += v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^5 (unsigned) - * umul16x24to24hi(v, f, bezier_A); // Range 21bits + 15 = 36bits (plus sign) - * acc -= v; - * } - * else { - * uint24_t v; - * umul16x24to24hi(v, f, bezier_C); // Range 21bits - * acc += v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^4 (unsigned) - * umul16x24to24hi(v, f, bezier_B); // Range 22bits - * acc -= v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^5 (unsigned) - * umul16x24to24hi(v, f, bezier_A); // Range 21bits + 15 = 36bits (plus sign) - * acc += v; - * } - * return acc; - * } - * These functions are translated to assembler for optimal performance. - * Coefficient calculation takes 70 cycles. Bezier point evaluation takes 150 cycles. - */ - - // For AVR we use assembly to maximize speed - void Stepper::_calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av) { - - // Store advance - bezier_AV = av; - - // Calculate the rest of the coefficients - register uint8_t r2 = v0 & 0xFF; - register uint8_t r3 = (v0 >> 8) & 0xFF; - register uint8_t r12 = (v0 >> 16) & 0xFF; - register uint8_t r5 = v1 & 0xFF; - register uint8_t r6 = (v1 >> 8) & 0xFF; - register uint8_t r7 = (v1 >> 16) & 0xFF; - register uint8_t r4,r8,r9,r10,r11; - - __asm__ __volatile__( - /* Calculate the Bézier coefficients */ - /* %10:%1:%0 = v0*/ - /* %5:%4:%3 = v1*/ - /* %7:%6:%10 = temporary*/ - /* %9 = val (must be high register!)*/ - /* %10 (must be high register!)*/ - - /* Store initial velocity*/ - A("sts bezier_F, %0") - A("sts bezier_F+1, %1") - A("sts bezier_F+2, %10") /* bezier_F = %10:%1:%0 = v0 */ - - /* Get delta speed */ - A("ldi %2,-1") /* %2 = 0xFF, means A_negative = true */ - A("clr %8") /* %8 = 0 */ - A("sub %0,%3") - A("sbc %1,%4") - A("sbc %10,%5") /* v0 -= v1, C=1 if result is negative */ - A("brcc 1f") /* branch if result is positive (C=0), that means v0 >= v1 */ - - /* Result was negative, get the absolute value*/ - A("com %10") - A("com %1") - A("neg %0") - A("sbc %1,%2") - A("sbc %10,%2") /* %10:%1:%0 +1 -> %10:%1:%0 = -(v0 - v1) = (v1 - v0) */ - A("clr %2") /* %2 = 0, means A_negative = false */ - - /* Store negative flag*/ - L("1") - A("sts A_negative, %2") /* Store negative flag */ - - /* Compute coefficients A,B and C [20 cycles worst case]*/ - A("ldi %9,6") /* %9 = 6 */ - A("mul %0,%9") /* r1:r0 = 6*LO(v0-v1) */ - A("sts bezier_A, r0") - A("mov %6,r1") - A("clr %7") /* %7:%6:r0 = 6*LO(v0-v1) */ - A("mul %1,%9") /* r1:r0 = 6*MI(v0-v1) */ - A("add %6,r0") - A("adc %7,r1") /* %7:%6:?? += 6*MI(v0-v1) << 8 */ - A("mul %10,%9") /* r1:r0 = 6*HI(v0-v1) */ - A("add %7,r0") /* %7:%6:?? += 6*HI(v0-v1) << 16 */ - A("sts bezier_A+1, %6") - A("sts bezier_A+2, %7") /* bezier_A = %7:%6:?? = 6*(v0-v1) [35 cycles worst] */ - - A("ldi %9,15") /* %9 = 15 */ - A("mul %0,%9") /* r1:r0 = 5*LO(v0-v1) */ - A("sts bezier_B, r0") - A("mov %6,r1") - A("clr %7") /* %7:%6:?? = 5*LO(v0-v1) */ - A("mul %1,%9") /* r1:r0 = 5*MI(v0-v1) */ - A("add %6,r0") - A("adc %7,r1") /* %7:%6:?? += 5*MI(v0-v1) << 8 */ - A("mul %10,%9") /* r1:r0 = 5*HI(v0-v1) */ - A("add %7,r0") /* %7:%6:?? += 5*HI(v0-v1) << 16 */ - A("sts bezier_B+1, %6") - A("sts bezier_B+2, %7") /* bezier_B = %7:%6:?? = 5*(v0-v1) [50 cycles worst] */ - - A("ldi %9,10") /* %9 = 10 */ - A("mul %0,%9") /* r1:r0 = 10*LO(v0-v1) */ - A("sts bezier_C, r0") - A("mov %6,r1") - A("clr %7") /* %7:%6:?? = 10*LO(v0-v1) */ - A("mul %1,%9") /* r1:r0 = 10*MI(v0-v1) */ - A("add %6,r0") - A("adc %7,r1") /* %7:%6:?? += 10*MI(v0-v1) << 8 */ - A("mul %10,%9") /* r1:r0 = 10*HI(v0-v1) */ - A("add %7,r0") /* %7:%6:?? += 10*HI(v0-v1) << 16 */ - A("sts bezier_C+1, %6") - " sts bezier_C+2, %7" /* bezier_C = %7:%6:?? = 10*(v0-v1) [65 cycles worst] */ - : "+r" (r2), - "+d" (r3), - "=r" (r4), - "+r" (r5), - "+r" (r6), - "+r" (r7), - "=r" (r8), - "=r" (r9), - "=r" (r10), - "=d" (r11), - "+r" (r12) - : - : "r0", "r1", "cc", "memory" - ); - } - - FORCE_INLINE int32_t Stepper::_eval_bezier_curve(const uint32_t curr_step) { - - // If dealing with the first step, save expensive computing and return the initial speed - if (!curr_step) - return bezier_F; - - register uint8_t r0 = 0; /* Zero register */ - register uint8_t r2 = (curr_step) & 0xFF; - register uint8_t r3 = (curr_step >> 8) & 0xFF; - register uint8_t r4 = (curr_step >> 16) & 0xFF; - register uint8_t r1,r5,r6,r7,r8,r9,r10,r11; /* Temporary registers */ - - __asm__ __volatile( - /* umul24x24to16hi(t, bezier_AV, curr_step); t: Range 0 - 1^16 = 16 bits*/ - A("lds %9,bezier_AV") /* %9 = LO(AV)*/ - A("mul %9,%2") /* r1:r0 = LO(bezier_AV)*LO(curr_step)*/ - A("mov %7,r1") /* %7 = LO(bezier_AV)*LO(curr_step) >> 8*/ - A("clr %8") /* %8:%7 = LO(bezier_AV)*LO(curr_step) >> 8*/ - A("lds %10,bezier_AV+1") /* %10 = MI(AV)*/ - A("mul %10,%2") /* r1:r0 = MI(bezier_AV)*LO(curr_step)*/ - A("add %7,r0") - A("adc %8,r1") /* %8:%7 += MI(bezier_AV)*LO(curr_step)*/ - A("lds r1,bezier_AV+2") /* r11 = HI(AV)*/ - A("mul r1,%2") /* r1:r0 = HI(bezier_AV)*LO(curr_step)*/ - A("add %8,r0") /* %8:%7 += HI(bezier_AV)*LO(curr_step) << 8*/ - A("mul %9,%3") /* r1:r0 = LO(bezier_AV)*MI(curr_step)*/ - A("add %7,r0") - A("adc %8,r1") /* %8:%7 += LO(bezier_AV)*MI(curr_step)*/ - A("mul %10,%3") /* r1:r0 = MI(bezier_AV)*MI(curr_step)*/ - A("add %8,r0") /* %8:%7 += LO(bezier_AV)*MI(curr_step) << 8*/ - A("mul %9,%4") /* r1:r0 = LO(bezier_AV)*HI(curr_step)*/ - A("add %8,r0") /* %8:%7 += LO(bezier_AV)*HI(curr_step) << 8*/ - /* %8:%7 = t*/ - - /* uint16_t f = t;*/ - A("mov %5,%7") /* %6:%5 = f*/ - A("mov %6,%8") - /* %6:%5 = f*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits (unsigned) [17] */ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %9,r1") /* store MIL(LO(f) * LO(t)) in %9, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %9,r0") /* %9 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %9,r0") /* %9 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t)) */ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 = */ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^3 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - /* [15 +17*2] = [49]*/ - - /* %4:%3:%2 will be acc from now on*/ - - /* uint24_t acc = bezier_F; / Range 20 bits (unsigned)*/ - A("clr %9") /* "decimal place we get for free"*/ - A("lds %2,bezier_F") - A("lds %3,bezier_F+1") - A("lds %4,bezier_F+2") /* %4:%3:%2 = acc*/ - - /* if (A_negative) {*/ - A("lds r0,A_negative") - A("or r0,%0") /* Is flag signalling negative? */ - A("brne 3f") /* If yes, Skip next instruction if A was negative*/ - A("rjmp 1f") /* Otherwise, jump */ - - /* uint24_t v; */ - /* umul16x24to24hi(v, f, bezier_C); / Range 21bits [29] */ - /* acc -= v; */ - L("3") - A("lds %10, bezier_C") /* %10 = LO(bezier_C)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_C) * LO(f)*/ - A("sub %9,r1") - A("sbc %2,%0") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(LO(bezier_C) * LO(f))*/ - A("lds %11, bezier_C+1") /* %11 = MI(bezier_C)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_C) * LO(f)*/ - A("lds %1, bezier_C+2") /* %1 = HI(bezier_C)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(bezier_C) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_C) * MI(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= LO(bezier_C) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_C) * MI(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_C) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_C) * LO(f)*/ - A("sub %3,r0") - A("sbc %4,r1") /* %4:%3:%2:%9 -= HI(bezier_C) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^3 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_B); / Range 22bits [29]*/ - /* acc += v; */ - A("lds %10, bezier_B") /* %10 = LO(bezier_B)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_B) * LO(f)*/ - A("add %9,r1") - A("adc %2,%0") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(LO(bezier_B) * LO(f))*/ - A("lds %11, bezier_B+1") /* %11 = MI(bezier_B)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_B) * LO(f)*/ - A("lds %1, bezier_B+2") /* %1 = HI(bezier_B)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(bezier_B) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_B) * MI(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += LO(bezier_B) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_B) * MI(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_B) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_B) * LO(f)*/ - A("add %3,r0") - A("adc %4,r1") /* %4:%3:%2:%9 += HI(bezier_B) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^5 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_A); / Range 21bits [29]*/ - /* acc -= v; */ - A("lds %10, bezier_A") /* %10 = LO(bezier_A)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_A) * LO(f)*/ - A("sub %9,r1") - A("sbc %2,%0") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(LO(bezier_A) * LO(f))*/ - A("lds %11, bezier_A+1") /* %11 = MI(bezier_A)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_A) * LO(f)*/ - A("lds %1, bezier_A+2") /* %1 = HI(bezier_A)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(bezier_A) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_A) * MI(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= LO(bezier_A) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_A) * MI(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_A) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_A) * LO(f)*/ - A("sub %3,r0") - A("sbc %4,r1") /* %4:%3:%2:%9 -= HI(bezier_A) * LO(f) << 16*/ - A("jmp 2f") /* Done!*/ - - L("1") - - /* uint24_t v; */ - /* umul16x24to24hi(v, f, bezier_C); / Range 21bits [29]*/ - /* acc += v; */ - A("lds %10, bezier_C") /* %10 = LO(bezier_C)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_C) * LO(f)*/ - A("add %9,r1") - A("adc %2,%0") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(LO(bezier_C) * LO(f))*/ - A("lds %11, bezier_C+1") /* %11 = MI(bezier_C)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_C) * LO(f)*/ - A("lds %1, bezier_C+2") /* %1 = HI(bezier_C)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(bezier_C) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_C) * MI(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += LO(bezier_C) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_C) * MI(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_C) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_C) * LO(f)*/ - A("add %3,r0") - A("adc %4,r1") /* %4:%3:%2:%9 += HI(bezier_C) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^3 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_B); / Range 22bits [29]*/ - /* acc -= v;*/ - A("lds %10, bezier_B") /* %10 = LO(bezier_B)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_B) * LO(f)*/ - A("sub %9,r1") - A("sbc %2,%0") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(LO(bezier_B) * LO(f))*/ - A("lds %11, bezier_B+1") /* %11 = MI(bezier_B)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_B) * LO(f)*/ - A("lds %1, bezier_B+2") /* %1 = HI(bezier_B)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(bezier_B) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_B) * MI(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= LO(bezier_B) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_B) * MI(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_B) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_B) * LO(f)*/ - A("sub %3,r0") - A("sbc %4,r1") /* %4:%3:%2:%9 -= HI(bezier_B) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^5 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_A); / Range 21bits [29]*/ - /* acc += v; */ - A("lds %10, bezier_A") /* %10 = LO(bezier_A)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_A) * LO(f)*/ - A("add %9,r1") - A("adc %2,%0") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(LO(bezier_A) * LO(f))*/ - A("lds %11, bezier_A+1") /* %11 = MI(bezier_A)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_A) * LO(f)*/ - A("lds %1, bezier_A+2") /* %1 = HI(bezier_A)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(bezier_A) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_A) * MI(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += LO(bezier_A) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_A) * MI(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_A) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_A) * LO(f)*/ - A("add %3,r0") - A("adc %4,r1") /* %4:%3:%2:%9 += HI(bezier_A) * LO(f) << 16*/ - L("2") - " clr __zero_reg__" /* C runtime expects r1 = __zero_reg__ = 0 */ - : "+r"(r0), - "+r"(r1), - "+r"(r2), - "+r"(r3), - "+r"(r4), - "+r"(r5), - "+r"(r6), - "+r"(r7), - "+r"(r8), - "+r"(r9), - "+r"(r10), - "+r"(r11) - : - :"cc","r0","r1" - ); - return (r2 | (uint16_t(r3) << 8)) | (uint32_t(r4) << 16); - } - -#endif // S_CURVE_ACCELERATION +#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) + extern volatile uint8_t e_hit; +#endif /** * Stepper Driver Interrupt * * Directly pulses the stepper motors at high frequency. + * Timer 1 runs at a base frequency of 2MHz, with this ISR using OCR1A compare mode. + * + * OCR1A Frequency + * 1 2 MHz + * 50 40 KHz + * 100 20 KHz - capped max rate + * 200 10 KHz - nominal max rate + * 2000 1 KHz - sleep rate + * 4000 500 Hz - init rate */ - -HAL_STEP_TIMER_ISR { - HAL_timer_isr_prologue(STEP_TIMER_NUM); - - Stepper::isr(); - - HAL_timer_isr_epilogue(STEP_TIMER_NUM); +ISR(TIMER1_COMPA_vect) { + #if ENABLED(LIN_ADVANCE) + Stepper::advance_isr_scheduler(); + #else + Stepper::isr(); + #endif } -#define STEP_MULTIPLY(A,B) MultiU24X32toH16(A, B) +#define _ENABLE_ISRs() do { cli(); if (thermalManager.in_temp_isr) CBI(TIMSK0, OCIE0B); else SBI(TIMSK0, OCIE0B); ENABLE_STEPPER_DRIVER_INTERRUPT(); } while(0) void Stepper::isr() { - DISABLE_ISRS(); - // Program timer compare for the maximum period, so it does NOT - // flag an interrupt while this ISR is running - So changes from small - // periods to big periods are respected and the timer does not reset to 0 - HAL_timer_set_compare(STEP_TIMER_NUM, HAL_TIMER_TYPE_MAX); + uint16_t ocr_val; - // Count of ticks for the next ISR - hal_timer_t next_isr_ticks = 0; + #define ENDSTOP_NOMINAL_OCR_VAL 3000 // Check endstops every 1.5ms to guarantee two stepper ISRs within 5ms for BLTouch + #define OCR_VAL_TOLERANCE 1000 // First max delay is 2.0ms, last min delay is 0.5ms, all others 1.5ms - // Limit the amount of iterations - uint8_t max_loops = 10; + #if DISABLED(LIN_ADVANCE) + // Disable Timer0 ISRs and enable global ISR again to capture UART events (incoming chars) + CBI(TIMSK0, OCIE0B); // Temperature ISR + DISABLE_STEPPER_DRIVER_INTERRUPT(); + sei(); + #endif - // We need this variable here to be able to use it in the following loop - hal_timer_t min_ticks; - do { - // Enable ISRs to reduce USART processing latency - ENABLE_ISRS(); + #define _SPLIT(L) (ocr_val = (uint16_t)L) + #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - // Run main stepping pulse phase ISR if we have to - if (!nextMainISR) Stepper::stepper_pulse_phase_isr(); + #define SPLIT(L) _SPLIT(L) - #if ENABLED(LIN_ADVANCE) - // Run linear advance stepper ISR if we have to - if (!nextAdvanceISR) nextAdvanceISR = Stepper::advance_isr(); - #endif + #else // !ENDSTOP_INTERRUPTS_FEATURE : Sample endstops between stepping ISRs - // ^== Time critical. NOTHING besides pulse generation should be above here!!! + static uint32_t step_remaining = 0; - // Run main stepping block processing ISR if we have to - if (!nextMainISR) nextMainISR = Stepper::stepper_block_phase_isr(); + #define SPLIT(L) do { \ + _SPLIT(L); \ + if (ENDSTOPS_ENABLED && L > ENDSTOP_NOMINAL_OCR_VAL) { \ + const uint16_t remainder = (uint16_t)L % (ENDSTOP_NOMINAL_OCR_VAL); \ + ocr_val = (remainder < OCR_VAL_TOLERANCE) ? ENDSTOP_NOMINAL_OCR_VAL + remainder : ENDSTOP_NOMINAL_OCR_VAL; \ + step_remaining = (uint16_t)L - ocr_val; \ + } \ + }while(0) - uint32_t interval = - #if ENABLED(LIN_ADVANCE) - MIN(nextAdvanceISR, nextMainISR) // Nearest time interval - #else - nextMainISR // Remaining stepper ISR time - #endif - ; + if (step_remaining && ENDSTOPS_ENABLED) { // Just check endstops - not yet time for a step + endstops.update(); - // Limit the value to the maximum possible value of the timer - NOMORE(interval, HAL_TIMER_TYPE_MAX); + // Next ISR either for endstops or stepping + ocr_val = step_remaining <= ENDSTOP_NOMINAL_OCR_VAL ? step_remaining : ENDSTOP_NOMINAL_OCR_VAL; + step_remaining -= ocr_val; + _NEXT_ISR(ocr_val); + NOLESS(OCR1A, TCNT1 + 16); + _ENABLE_ISRs(); // re-enable ISRs + return; + } - // Compute the time remaining for the main isr - nextMainISR -= interval; + #endif // !ENDSTOP_INTERRUPTS_FEATURE - #if ENABLED(LIN_ADVANCE) - // Compute the time remaining for the advance isr - if (nextAdvanceISR != LA_ADV_NEVER) nextAdvanceISR -= interval; - #endif - - /** - * This needs to avoid a race-condition caused by interleaving - * of interrupts required by both the LA and Stepper algorithms. - * - * Assume the following tick times for stepper pulses: - * Stepper ISR (S): 1 1000 2000 3000 4000 - * Linear Adv. (E): 10 1010 2010 3010 4010 - * - * The current algorithm tries to interleave them, giving: - * 1:S 10:E 1000:S 1010:E 2000:S 2010:E 3000:S 3010:E 4000:S 4010:E - * - * Ideal timing would yield these delta periods: - * 1:S 9:E 990:S 10:E 990:S 10:E 990:S 10:E 990:S 10:E - * - * But, since each event must fire an ISR with a minimum duration, the - * minimum delta might be 900, so deltas under 900 get rounded up: - * 900:S d900:E d990:S d900:E d990:S d900:E d990:S d900:E d990:S d900:E - * - * It works, but divides the speed of all motors by half, leading to a sudden - * reduction to 1/2 speed! Such jumps in speed lead to lost steps (not even - * accounting for double/quad stepping, which makes it even worse). - */ - - // Compute the tick count for the next ISR - next_isr_ticks += interval; - - /** - * The following section must be done with global interrupts disabled. - * We want nothing to interrupt it, as that could mess the calculations - * we do for the next value to program in the period register of the - * stepper timer and lead to skipped ISRs (if the value we happen to program - * is less than the current count due to something preempting between the - * read and the write of the new period value). - */ - DISABLE_ISRS(); - - /** - * Get the current tick value + margin - * Assuming at least 6µs between calls to this ISR... - * On AVR the ISR epilogue+prologue is estimated at 100 instructions - Give 8µs as margin - * On ARM the ISR epilogue+prologue is estimated at 20 instructions - Give 1µs as margin - */ - min_ticks = HAL_timer_get_count(STEP_TIMER_NUM) + hal_timer_t((STEPPER_TIMER_TICKS_PER_US) * 8); - - /** - * NB: If for some reason the stepper monopolizes the MPU, eventually the - * timer will wrap around (and so will 'next_isr_ticks'). So, limit the - * loop to 10 iterations. Beyond that, there's no way to ensure correct pulse - * timing, since the MCU isn't fast enough. - */ - if (!--max_loops) next_isr_ticks = min_ticks; - - // Advance pulses if not enough time to wait for the next ISR - } while (next_isr_ticks < min_ticks); - - // Now 'next_isr_ticks' contains the period to the next Stepper ISR - And we are - // sure that the time has not arrived yet - Warrantied by the scheduler - - // Set the next ISR to fire at the proper time - HAL_timer_set_compare(STEP_TIMER_NUM, hal_timer_t(next_isr_ticks)); - - // Don't forget to finally reenable interrupts - ENABLE_ISRS(); -} - -/** - * This phase of the ISR should ONLY create the pulses for the steppers. - * This prevents jitter caused by the interval between the start of the - * interrupt and the start of the pulses. DON'T add any logic ahead of the - * call to this method that might cause variation in the timing. The aim - * is to keep pulse timing as regular as possible. - */ -#if ENABLED(UNREGISTERED_MOVE_SUPPORT) - #define COUNT_IT current_block->count_it -#else - #define COUNT_IT true -#endif - -void Stepper::stepper_pulse_phase_isr() { - - // If we must abort the current block, do so! - if (abort_current_block) { - abort_current_block = false; - if (current_block) { - axis_did_move = 0; - current_block = NULL; + // + // When cleaning, discard the current block and run fast + // + if (cleaning_buffer_counter) { + if (cleaning_buffer_counter < 0) { // Count up for endstop hit + if (current_block) planner.discard_current_block(); // Discard the active block that led to the trigger + if (!planner.discard_continued_block()) // Discard next CONTINUED block + cleaning_buffer_counter = 0; // Keep discarding until non-CONTINUED + } + else { planner.discard_current_block(); + --cleaning_buffer_counter; // Count down for abort print + #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) + if (!cleaning_buffer_counter) enqueue_and_echo_commands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); + #endif + } + current_block = NULL; // Prep to get a new block after cleaning + _NEXT_ISR(200); // Run at max speed - 10 KHz + _ENABLE_ISRs(); + return; + } + + // If there is no current block, attempt to pop one from the buffer + if (!current_block) { + // Anything in the buffer? + if ((current_block = planner.get_current_block())) { + trapezoid_generator_reset(); + + // 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(ENDSTOP_INTERRUPTS_FEATURE) + e_hit = 2; // Needed for the case an endstop is already triggered before the new move begins. + // No 'change' can be detected. + #endif + + #if ENABLED(Z_LATE_ENABLE) + if (current_block->steps[Z_AXIS] > 0) { + enable_Z(); + _NEXT_ISR(2000); // Run at slow speed - 1 KHz + _ENABLE_ISRs(); // re-enable ISRs + return; + } + #endif + } + else { + _NEXT_ISR(2000); // Run at slow speed - 1 KHz + _ENABLE_ISRs(); // re-enable ISRs + return; } } - // If there is no current block, do nothing - if (!current_block) return; - - // Count of pending loops and events for this iteration - const uint32_t pending_events = step_event_count - step_events_completed; - uint8_t events_to_do = MIN(pending_events, steps_per_isr); - - // Just update the value we will get at the end of the loop - step_events_completed += events_to_do; - - // Get the timer count and estimate the end of the pulse - hal_timer_t pulse_end = HAL_timer_get_count(PULSE_TIMER_NUM) + hal_timer_t(MIN_PULSE_TICKS); - - const hal_timer_t added_step_ticks = hal_timer_t(ADDED_STEP_TICKS); + // Update endstops state, if enabled + #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) + if (e_hit && ENDSTOPS_ENABLED) { + endstops.update(); + e_hit--; + } + #else + if (ENDSTOPS_ENABLED) endstops.update(); + #endif // Take multiple steps per interrupt (For high speed moves) - do { + bool all_steps_done = false; + for (uint8_t i = step_loops; i--;) { + #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]; + motor_direction(E_AXIS) ? --e_steps[TOOL_E_INDEX] : ++e_steps[TOOL_E_INDEX]; + #endif + } + + #if ENABLED(MIXING_EXTRUDER) + // Step mixing steppers proportionally + const bool dir = motor_direction(E_AXIS); + 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]; + dir ? --e_steps[j] : ++e_steps[j]; + } + } + #endif + + #endif // LIN_ADVANCE + + #define _COUNTER(AXIS) counter_## AXIS #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP #define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN - // Start an active pulse, if Bresenham says so, and update position - #define PULSE_START(AXIS) do{ \ - delta_error[_AXIS(AXIS)] += advance_dividend[_AXIS(AXIS)]; \ - if (delta_error[_AXIS(AXIS)] >= 0) { \ - _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), 0); \ - if (COUNT_IT) count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \ - } \ - }while(0) + // Advance the Bresenham counter; start a pulse if the axis needs a step + #define PULSE_START(AXIS) \ + _COUNTER(AXIS) += current_block->steps[_AXIS(AXIS)]; \ + if (_COUNTER(AXIS) > 0) { _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS),0); } - // Stop an active pulse, if any, and adjust error term - #define PULSE_STOP(AXIS) do { \ - if (delta_error[_AXIS(AXIS)] >= 0) { \ - delta_error[_AXIS(AXIS)] -= advance_divisor; \ - _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), 0); \ - } \ - }while(0) + // Stop an active pulse, reset the Bresenham counter, update the position + #define PULSE_STOP(AXIS) \ + if (_COUNTER(AXIS) > 0) { \ + _COUNTER(AXIS) -= current_block->step_event_count; \ + count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \ + _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0); \ + } - // Pulse start - #if ENABLED(HANGPRINTER) - #if HAS_A_STEP - PULSE_START(A); - #endif - #if HAS_B_STEP - PULSE_START(B); - #endif - #if HAS_C_STEP - PULSE_START(C); - #endif - #if HAS_D_STEP - PULSE_START(D); + /** + * Estimate the number of cycles that the stepper logic already takes + * up between the start and stop of the X stepper pulse. + * + * Currently this uses very modest estimates of around 5 cycles. + * True values may be derived by careful testing. + * + * Once any delay is added, the cost of the delay code itself + * may be subtracted from this value to get a more accurate delay. + * Delays under 20 cycles (1.25µs) will be very accurate, using NOPs. + * Longer delays use a loop. The resolution is 8 cycles. + */ + #if HAS_X_STEP + #define _CYCLE_APPROX_1 5 + #else + #define _CYCLE_APPROX_1 0 + #endif + #if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define _CYCLE_APPROX_2 _CYCLE_APPROX_1 + 4 + #else + #define _CYCLE_APPROX_2 _CYCLE_APPROX_1 + #endif + #if HAS_Y_STEP + #define _CYCLE_APPROX_3 _CYCLE_APPROX_2 + 5 + #else + #define _CYCLE_APPROX_3 _CYCLE_APPROX_2 + #endif + #if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define _CYCLE_APPROX_4 _CYCLE_APPROX_3 + 4 + #else + #define _CYCLE_APPROX_4 _CYCLE_APPROX_3 + #endif + #if HAS_Z_STEP + #define _CYCLE_APPROX_5 _CYCLE_APPROX_4 + 5 + #else + #define _CYCLE_APPROX_5 _CYCLE_APPROX_4 + #endif + #if ENABLED(Z_DUAL_STEPPER_DRIVERS) + #define _CYCLE_APPROX_6 _CYCLE_APPROX_5 + 4 + #else + #define _CYCLE_APPROX_6 _CYCLE_APPROX_5 + #endif + #if DISABLED(LIN_ADVANCE) + #if ENABLED(MIXING_EXTRUDER) + #define _CYCLE_APPROX_7 _CYCLE_APPROX_6 + (MIXING_STEPPERS) * 6 + #else + #define _CYCLE_APPROX_7 _CYCLE_APPROX_6 + 5 #endif #else - #if HAS_X_STEP - PULSE_START(X); - #endif - #if HAS_Y_STEP - PULSE_START(Y); - #endif - #if HAS_Z_STEP - PULSE_START(Z); - #endif - #endif // HANGPRINTER + #define _CYCLE_APPROX_7 _CYCLE_APPROX_6 + #endif - // Pulse E/Mixing extruders - #if ENABLED(LIN_ADVANCE) - // Tick the E axis, correct error term and update position - delta_error[E_AXIS] += advance_dividend[E_AXIS]; - if (delta_error[E_AXIS] >= 0) { - if (COUNT_IT) count_position[E_AXIS] += count_direction[E_AXIS]; - delta_error[E_AXIS] -= advance_divisor; + #define CYCLES_EATEN_XYZE _CYCLE_APPROX_7 + #define EXTRA_CYCLES_XYZE (STEP_PULSE_CYCLES - (CYCLES_EATEN_XYZE)) - // Don't step E here - But remember the number of steps to perform - motor_direction(E_AXIS) ? --LA_steps : ++LA_steps; - } - #else // !LIN_ADVANCE - use linear interpolation for E also + /** + * If a minimum pulse time was specified get the timer 0 value. + * + * TCNT0 has an 8x prescaler, so it increments every 8 cycles. + * That's every 0.5µs on 16MHz and every 0.4µs on 20MHz. + * 20 counts of TCNT0 -by itself- is a good pulse delay. + * 10µs = 160 or 200 cycles. + */ + #if EXTRA_CYCLES_XYZE > 20 + uint32_t pulse_start = TCNT0; + #endif + + #if HAS_X_STEP + PULSE_START(X); + #endif + #if HAS_Y_STEP + PULSE_START(Y); + #endif + #if HAS_Z_STEP + PULSE_START(Z); + #endif + + // For non-advance use linear interpolation for E also + #if DISABLED(LIN_ADVANCE) #if ENABLED(MIXING_EXTRUDER) - - // Tick the E axis - delta_error[E_AXIS] += advance_dividend[E_AXIS]; - if (delta_error[E_AXIS] >= 0) { - if (COUNT_IT) count_position[E_AXIS] += count_direction[E_AXIS]; - delta_error[E_AXIS] -= advance_divisor; - } - - // Tick the counters used for this mix in proper proportion + // 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) - delta_error_m[j] += advance_dividend_m[j]; + counter_m[j] += current_block->steps[E_AXIS]; // Step when the counter goes over zero - if (delta_error_m[j] >= 0) E_STEP_WRITE(j, !INVERT_E_STEP_PIN); + if (counter_m[j] > 0) En_STEP_WRITE(j, !INVERT_E_STEP_PIN); } - #else // !MIXING_EXTRUDER PULSE_START(E); #endif #endif // !LIN_ADVANCE - #if MINIMUM_STEPPER_PULSE - // Just wait for the requested pulse duration - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } + // For minimum pulse time wait before stopping pulses + #if EXTRA_CYCLES_XYZE > 20 + while (EXTRA_CYCLES_XYZE > (uint32_t)(TCNT0 - pulse_start) * (INT0_PRESCALER)) { /* nada */ } + pulse_start = TCNT0; + #elif EXTRA_CYCLES_XYZE > 0 + DELAY_NOPS(EXTRA_CYCLES_XYZE); #endif - // Add the delay needed to ensure the maximum driver rate is enforced - if (signed(added_step_ticks) > 0) pulse_end += hal_timer_t(added_step_ticks); - - #if ENABLED(HANGPRINTER) - #if HAS_A_STEP - PULSE_STOP(A); - #endif - #if HAS_B_STEP - PULSE_STOP(B); - #endif - #if HAS_C_STEP - PULSE_STOP(C); - #endif - #if HAS_D_STEP - PULSE_STOP(D); - #endif - #else - #if HAS_X_STEP - PULSE_STOP(X); - #endif - #if HAS_Y_STEP - PULSE_STOP(Y); - #endif - #if HAS_Z_STEP - PULSE_STOP(Z); - #endif + #if HAS_X_STEP + PULSE_STOP(X); + #endif + #if HAS_Y_STEP + PULSE_STOP(Y); + #endif + #if HAS_Z_STEP + PULSE_STOP(Z); #endif #if 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 (delta_error_m[j] >= 0) { - delta_error_m[j] -= advance_divisor_m; - E_STEP_WRITE(j, INVERT_E_STEP_PIN); + 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 @@ -1442,486 +669,271 @@ void Stepper::stepper_pulse_phase_isr() { #endif #endif // !LIN_ADVANCE - // Decrement the count of pending pulses to do - --events_to_do; + if (++step_events_completed >= current_block->step_event_count) { + all_steps_done = true; + break; + } // For minimum pulse time wait after stopping pulses also - if (events_to_do) { - // Just wait for the requested pulse duration - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #if MINIMUM_STEPPER_PULSE - // Add to the value, the time that the pulse must be active (to be used on the next loop) - pulse_end += hal_timer_t(MIN_PULSE_TICKS); - #endif - } + #if EXTRA_CYCLES_XYZE > 20 + if (i) while (EXTRA_CYCLES_XYZE > (uint32_t)(TCNT0 - pulse_start) * (INT0_PRESCALER)) { /* nada */ } + #elif EXTRA_CYCLES_XYZE > 0 + if (i) DELAY_NOPS(EXTRA_CYCLES_XYZE); + #endif - } while (events_to_do); -} + } // steps_loop -// This is the last half of the stepper interrupt: This one processes and -// properly schedules blocks from the planner. This is executed after creating -// the step pulses, so it is not time critical, as pulses are already done. - -uint32_t Stepper::stepper_block_phase_isr() { - - // If no queued movements, just wait 1ms for the next move - uint32_t interval = (STEPPER_TIMER_RATE / 1000); - - // If there is a current block - if (current_block) { - - // If current block is finished, reset pointer - if (step_events_completed >= step_event_count) { - axis_did_move = 0; - current_block = NULL; - planner.discard_current_block(); - } - else { - // Step events not completed yet... - - // Are we in acceleration phase ? - if (step_events_completed <= accelerate_until) { // Calculate new timer value - - #if ENABLED(S_CURVE_ACCELERATION) - // Get the next speed to use (Jerk limited!) - uint32_t acc_step_rate = - acceleration_time < current_block->acceleration_time - ? _eval_bezier_curve(acceleration_time) - : current_block->cruise_rate; - #else - acc_step_rate = STEP_MULTIPLY(acceleration_time, current_block->acceleration_rate) + current_block->initial_rate; - NOMORE(acc_step_rate, current_block->nominal_rate); - #endif - - // acc_step_rate is in steps/second - - // step_rate to timer interval and steps per stepper isr - interval = calc_timer_interval(acc_step_rate, oversampling_factor, &steps_per_isr); - acceleration_time += interval; - - #if ENABLED(LIN_ADVANCE) - if (LA_use_advance_lead) { - // Fire ISR if final adv_rate is reached - if (LA_steps && LA_isr_rate != current_block->advance_speed) nextAdvanceISR = 0; - } - else if (LA_steps) nextAdvanceISR = 0; - #endif // LIN_ADVANCE - } - // Are we in Deceleration phase ? - else if (step_events_completed > decelerate_after) { - uint32_t step_rate; - - #if ENABLED(S_CURVE_ACCELERATION) - // If this is the 1st time we process the 2nd half of the trapezoid... - if (!bezier_2nd_half) { - // Initialize the Bézier speed curve - _calc_bezier_curve_coeffs(current_block->cruise_rate, current_block->final_rate, current_block->deceleration_time_inverse); - bezier_2nd_half = true; - // The first point starts at cruise rate. Just save evaluation of the Bézier curve - step_rate = current_block->cruise_rate; - } - else { - // Calculate the next speed to use - step_rate = deceleration_time < current_block->deceleration_time - ? _eval_bezier_curve(deceleration_time) - : current_block->final_rate; - } - #else - - // Using the old trapezoidal control - step_rate = STEP_MULTIPLY(deceleration_time, current_block->acceleration_rate); - if (step_rate < acc_step_rate) { // Still decelerating? - step_rate = acc_step_rate - step_rate; - NOLESS(step_rate, current_block->final_rate); - } - else - step_rate = current_block->final_rate; - #endif - - // step_rate is in steps/second - - // step_rate to timer interval and steps per stepper isr - interval = calc_timer_interval(step_rate, oversampling_factor, &steps_per_isr); - deceleration_time += interval; - - #if ENABLED(LIN_ADVANCE) - if (LA_use_advance_lead) { - // Wake up eISR on first deceleration loop and fire ISR if final adv_rate is reached - if (step_events_completed <= decelerate_after + steps_per_isr || (LA_steps && LA_isr_rate != current_block->advance_speed)) { - nextAdvanceISR = 0; - LA_isr_rate = current_block->advance_speed; - } - } - else if (LA_steps) nextAdvanceISR = 0; - #endif // LIN_ADVANCE - } - // We must be in cruise phase otherwise - else { - - #if ENABLED(LIN_ADVANCE) - // If there are any esteps, fire the next advance_isr "now" - if (LA_steps && LA_isr_rate != current_block->advance_speed) nextAdvanceISR = 0; - #endif - - // Calculate the ticks_nominal for this nominal speed, if not done yet - if (ticks_nominal < 0) { - // step_rate to timer interval and loops for the nominal speed - ticks_nominal = calc_timer_interval(current_block->nominal_rate, oversampling_factor, &steps_per_isr); - } - - // The timer interval is just the nominal value for the nominal speed - interval = ticks_nominal; - } - } - } - - // If there is no current block at this point, attempt to pop one from the buffer - // and prepare its movement - if (!current_block) { - - // Anything in the buffer? - if ((current_block = planner.get_current_block())) { - - // Sync block? Sync the stepper counts and return - while (TEST(current_block->flag, BLOCK_BIT_SYNC_POSITION)) { - _set_position( - current_block->position[A_AXIS], current_block->position[B_AXIS], current_block->position[C_AXIS], - #if ENABLED(HANGPRINTER) - current_block->position[D_AXIS], - #endif - current_block->position[E_AXIS] - ); - planner.discard_current_block(); - - // Try to get a new block - if (!(current_block = planner.get_current_block())) - return interval; // No more queued movements! - } - - // Flag all moving axes for proper endstop handling - - #if IS_CORE - // Define conditions for checking endstops - #define S_(N) current_block->steps[CORE_AXIS_##N] - #define D_(N) TEST(current_block->direction_bits, CORE_AXIS_##N) - #endif - - #if CORE_IS_XY || CORE_IS_XZ - /** - * Head direction in -X axis for CoreXY and CoreXZ bots. - * - * If steps differ, both axes are moving. - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z, handled below) - * If DeltaA == DeltaB, the movement is only in the 1st axis (X) - */ - #if ENABLED(COREXY) || ENABLED(COREXZ) - #define X_CMP == - #else - #define X_CMP != - #endif - #define X_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) X_CMP D_(2)) ) - #else - #define X_MOVE_TEST !!current_block->steps[A_AXIS] - #endif - - #if CORE_IS_XY || CORE_IS_YZ - /** - * Head direction in -Y axis for CoreXY / CoreYZ bots. - * - * If steps differ, both axes are moving - * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y) - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z) - */ - #if ENABLED(COREYX) || ENABLED(COREYZ) - #define Y_CMP == - #else - #define Y_CMP != - #endif - #define Y_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) Y_CMP D_(2)) ) - #else - #define Y_MOVE_TEST !!current_block->steps[B_AXIS] - #endif - - #if CORE_IS_XZ || CORE_IS_YZ - /** - * Head direction in -Z axis for CoreXZ or CoreYZ bots. - * - * If steps differ, both axes are moving - * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y, already handled above) - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Z) - */ - #if ENABLED(COREZX) || ENABLED(COREZY) - #define Z_CMP == - #else - #define Z_CMP != - #endif - #define Z_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) Z_CMP D_(2)) ) - #else - #define Z_MOVE_TEST !!current_block->steps[C_AXIS] - #endif - - uint8_t axis_bits = 0; - if (X_MOVE_TEST) SBI(axis_bits, A_AXIS); - if (Y_MOVE_TEST) SBI(axis_bits, B_AXIS); - if (Z_MOVE_TEST) SBI(axis_bits, C_AXIS); - //if (!!current_block->steps[E_AXIS]) SBI(axis_bits, E_AXIS); - //if (!!current_block->steps[A_AXIS]) SBI(axis_bits, X_HEAD); - //if (!!current_block->steps[B_AXIS]) SBI(axis_bits, Y_HEAD); - //if (!!current_block->steps[C_AXIS]) SBI(axis_bits, Z_HEAD); - axis_did_move = axis_bits; - - // No acceleration / deceleration time elapsed so far - acceleration_time = deceleration_time = 0; - - uint8_t oversampling = 0; // Assume we won't use it - - #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - // At this point, we must decide if we can use Stepper movement axis smoothing. - uint32_t max_rate = current_block->nominal_rate; // Get the maximum rate (maximum event speed) - while (max_rate < MIN_STEP_ISR_FREQUENCY) { - max_rate <<= 1; - if (max_rate >= MAX_STEP_ISR_FREQUENCY_1X) break; - ++oversampling; - } - oversampling_factor = oversampling; - #endif - - // Based on the oversampling factor, do the calculations - step_event_count = current_block->step_event_count << oversampling; - - // Initialize Bresenham delta errors to 1/2 - #if ENABLED(HANGPRINTER) - delta_error[A_AXIS] = delta_error[B_AXIS] = delta_error[C_AXIS] = delta_error[D_AXIS] = delta_error[E_AXIS] = -int32_t(step_event_count); - #else - delta_error[X_AXIS] = delta_error[Y_AXIS] = delta_error[Z_AXIS] = delta_error[E_AXIS] = -int32_t(step_event_count); - #endif - - // Calculate Bresenham dividends - #if ENABLED(HANGPRINTER) - advance_dividend[A_AXIS] = current_block->steps[A_AXIS] << 1; - advance_dividend[B_AXIS] = current_block->steps[B_AXIS] << 1; - advance_dividend[C_AXIS] = current_block->steps[C_AXIS] << 1; - advance_dividend[D_AXIS] = current_block->steps[D_AXIS] << 1; - #else - advance_dividend[X_AXIS] = current_block->steps[X_AXIS] << 1; - advance_dividend[Y_AXIS] = current_block->steps[Y_AXIS] << 1; - advance_dividend[Z_AXIS] = current_block->steps[Z_AXIS] << 1; - #endif - advance_dividend[E_AXIS] = current_block->steps[E_AXIS] << 1; - - // Calculate Bresenham divisor - advance_divisor = step_event_count << 1; - - // No step events completed so far - step_events_completed = 0; - - // Compute the acceleration and deceleration points - accelerate_until = current_block->accelerate_until << oversampling; - decelerate_after = current_block->decelerate_after << oversampling; + #if ENABLED(LIN_ADVANCE) + if (current_block->use_advance_lead) { + const int delta_adv_steps = current_estep_rate[TOOL_E_INDEX] - current_adv_steps[TOOL_E_INDEX]; + current_adv_steps[TOOL_E_INDEX] += delta_adv_steps; #if ENABLED(MIXING_EXTRUDER) - const uint32_t e_steps = ( - #if ENABLED(LIN_ADVANCE) - current_block->steps[E_AXIS] - #else - step_event_count - #endif - ); - MIXING_STEPPERS_LOOP(i) { - delta_error_m[i] = -int32_t(e_steps); - advance_dividend_m[i] = current_block->mix_steps[i] << 1; - } - advance_divisor_m = e_steps << 1; + // Mixing extruders apply advance lead proportionally + MIXING_STEPPERS_LOOP(j) + e_steps[j] += delta_adv_steps * current_block->step_event_count / current_block->mix_event_count[j]; #else - active_extruder = current_block->active_extruder; + // For most extruders, advance the single E stepper + e_steps[TOOL_E_INDEX] += delta_adv_steps; #endif - - // Initialize the trapezoid generator from the current block. - #if ENABLED(LIN_ADVANCE) - #if DISABLED(MIXING_EXTRUDER) && E_STEPPERS > 1 - // If the now active extruder wasn't in use during the last move, its pressure is most likely gone. - if (active_extruder != last_moved_extruder) LA_current_adv_steps = 0; - #endif - - if ((LA_use_advance_lead = current_block->use_advance_lead)) { - LA_final_adv_steps = current_block->final_adv_steps; - LA_max_adv_steps = current_block->max_adv_steps; - //Start the ISR - nextAdvanceISR = 0; - LA_isr_rate = current_block->advance_speed; - } - else LA_isr_rate = LA_ADV_NEVER; - #endif - - if (current_block->direction_bits != last_direction_bits - #if DISABLED(MIXING_EXTRUDER) - || active_extruder != last_moved_extruder - #endif - ) { - last_direction_bits = current_block->direction_bits; - #if DISABLED(MIXING_EXTRUDER) - last_moved_extruder = active_extruder; - #endif - set_directions(); - } - - // At this point, we must ensure the movement about to execute isn't - // trying to force the head against a limit switch. If using interrupt- - // driven change detection, and already against a limit then no call to - // the endstop_triggered method will be done and the movement will be - // done against the endstop. So, check the limits here: If the movement - // is against the limits, the block will be marked as to be killed, and - // on the next call to this ISR, will be discarded. - endstops.update(); - - #if ENABLED(Z_LATE_ENABLE) - // If delayed Z enable, enable it now. This option will severely interfere with - // timing between pulses when chaining motion between blocks, and it could lead - // to lost steps in both X and Y axis, so avoid using it unless strictly necessary!! - if (current_block->steps[Z_AXIS]) enable_Z(); - #endif - - // Mark the time_nominal as not calculated yet - ticks_nominal = -1; - - #if DISABLED(S_CURVE_ACCELERATION) - // Set as deceleration point the initial rate of the block - acc_step_rate = current_block->initial_rate; - #endif - - #if ENABLED(S_CURVE_ACCELERATION) - // Initialize the Bézier speed curve - _calc_bezier_curve_coeffs(current_block->initial_rate, current_block->cruise_rate, current_block->acceleration_time_inverse); - // We haven't started the 2nd half of the trapezoid - bezier_2nd_half = false; - #endif - - // Calculate the initial timer interval - interval = calc_timer_interval(current_block->initial_rate, oversampling_factor, &steps_per_isr); } + // If we have esteps to execute, fire the next advance_isr "now" + if (e_steps[TOOL_E_INDEX]) nextAdvanceISR = 0; + + #endif // LIN_ADVANCE + + // Calculate new timer value + if (step_events_completed <= (uint32_t)current_block->accelerate_until) { + + MultiU24X32toH16(acc_step_rate, acceleration_time, current_block->acceleration_rate); + acc_step_rate += current_block->initial_rate; + + // upper limit + NOMORE(acc_step_rate, current_block->nominal_rate); + + // step_rate to timer interval + const uint16_t interval = calc_timer_interval(acc_step_rate); + + SPLIT(interval); // split step into multiple ISRs if larger than ENDSTOP_NOMINAL_OCR_VAL + _NEXT_ISR(ocr_val); + + acceleration_time += interval; + + #if ENABLED(LIN_ADVANCE) + + if (current_block->use_advance_lead) { + #if ENABLED(MIXING_EXTRUDER) + MIXING_STEPPERS_LOOP(j) + current_estep_rate[j] = ((uint32_t)acc_step_rate * current_block->abs_adv_steps_multiplier8 * current_block->step_event_count / current_block->mix_event_count[j]) >> 17; + #else + current_estep_rate[TOOL_E_INDEX] = ((uint32_t)acc_step_rate * current_block->abs_adv_steps_multiplier8) >> 17; + #endif + } + eISR_Rate = adv_rate(e_steps[TOOL_E_INDEX], interval, step_loops); + + #endif // LIN_ADVANCE + } + else if (step_events_completed > (uint32_t)current_block->decelerate_after) { + uint16_t step_rate; + MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate); + + if (step_rate < acc_step_rate) { // Still decelerating? + step_rate = acc_step_rate - step_rate; + NOLESS(step_rate, current_block->final_rate); + } + else + step_rate = current_block->final_rate; + + // step_rate to timer interval + const uint16_t interval = calc_timer_interval(step_rate); + + SPLIT(interval); // split step into multiple ISRs if larger than ENDSTOP_NOMINAL_OCR_VAL + _NEXT_ISR(ocr_val); + + deceleration_time += interval; + + #if ENABLED(LIN_ADVANCE) + + if (current_block->use_advance_lead) { + #if ENABLED(MIXING_EXTRUDER) + MIXING_STEPPERS_LOOP(j) + current_estep_rate[j] = ((uint32_t)step_rate * current_block->abs_adv_steps_multiplier8 * current_block->step_event_count / current_block->mix_event_count[j]) >> 17; + #else + current_estep_rate[TOOL_E_INDEX] = ((uint32_t)step_rate * current_block->abs_adv_steps_multiplier8) >> 17; + #endif + } + eISR_Rate = adv_rate(e_steps[TOOL_E_INDEX], interval, step_loops); + + #endif // LIN_ADVANCE + } + else { + + #if ENABLED(LIN_ADVANCE) + + if (current_block->use_advance_lead) + current_estep_rate[TOOL_E_INDEX] = final_estep_rate; + + eISR_Rate = adv_rate(e_steps[TOOL_E_INDEX], OCR1A_nominal, step_loops_nominal); + + #endif + + SPLIT(OCR1A_nominal); // split step into multiple ISRs if larger than ENDSTOP_NOMINAL_OCR_VAL + _NEXT_ISR(ocr_val); + + // ensure we're running at the correct step rate, even if we just came off an acceleration + step_loops = step_loops_nominal; } - // Return the interval to wait - return interval; + #if DISABLED(LIN_ADVANCE) + NOLESS(OCR1A, TCNT1 + 16); + #endif + + // If current block is finished, reset pointer + if (all_steps_done) { + current_block = NULL; + planner.discard_current_block(); + } + #if DISABLED(LIN_ADVANCE) + _ENABLE_ISRs(); // re-enable ISRs + #endif } #if ENABLED(LIN_ADVANCE) - // Timer interrupt for E. LA_steps is set in the main routine - uint32_t Stepper::advance_isr() { - uint32_t interval; + #define CYCLES_EATEN_E (E_STEPPERS * 5) + #define EXTRA_CYCLES_E (STEP_PULSE_CYCLES - (CYCLES_EATEN_E)) - if (LA_use_advance_lead) { - if (step_events_completed > decelerate_after && LA_current_adv_steps > LA_final_adv_steps) { - LA_steps--; - LA_current_adv_steps--; - interval = LA_isr_rate; + // Timer interrupt for E. e_steps is set in the main routine; + + void Stepper::advance_isr() { + + nextAdvanceISR = eISR_Rate; + + #if ENABLED(MK2_MULTIPLEXER) + // Even-numbered steppers are reversed + #define SET_E_STEP_DIR(INDEX) \ + if (e_steps[INDEX]) E## INDEX ##_DIR_WRITE(e_steps[INDEX] < 0 ? !INVERT_E## INDEX ##_DIR ^ TEST(INDEX, 0) : INVERT_E## INDEX ##_DIR ^ TEST(INDEX, 0)) + #else + #define SET_E_STEP_DIR(INDEX) \ + if (e_steps[INDEX]) E## INDEX ##_DIR_WRITE(e_steps[INDEX] < 0 ? INVERT_E## INDEX ##_DIR : !INVERT_E## INDEX ##_DIR) + #endif + + #define START_E_PULSE(INDEX) \ + if (e_steps[INDEX]) E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN) + + #define STOP_E_PULSE(INDEX) \ + if (e_steps[INDEX]) { \ + e_steps[INDEX] < 0 ? ++e_steps[INDEX] : --e_steps[INDEX]; \ + E## INDEX ##_STEP_WRITE(INVERT_E_STEP_PIN); \ } - else if (step_events_completed < decelerate_after && LA_current_adv_steps < LA_max_adv_steps) { - //step_events_completed <= (uint32_t)accelerate_until) { - LA_steps++; - LA_current_adv_steps++; - interval = LA_isr_rate; - } - else - interval = LA_isr_rate = LA_ADV_NEVER; - } - else - interval = LA_ADV_NEVER; - #if ENABLED(MIXING_EXTRUDER) - if (LA_steps >= 0) - MIXING_STEPPERS_LOOP(j) NORM_E_DIR(j); - else - MIXING_STEPPERS_LOOP(j) REV_E_DIR(j); - #else - if (LA_steps >= 0) - NORM_E_DIR(active_extruder); - else - REV_E_DIR(active_extruder); + SET_E_STEP_DIR(0); + #if E_STEPPERS > 1 + SET_E_STEP_DIR(1); + #if E_STEPPERS > 2 + SET_E_STEP_DIR(2); + #if E_STEPPERS > 3 + SET_E_STEP_DIR(3); + #if E_STEPPERS > 4 + SET_E_STEP_DIR(4); + #endif + #endif + #endif + #endif + + // Step all E steppers that have steps + for (uint8_t i = step_loops; i--;) { + + #if EXTRA_CYCLES_E > 20 + uint32_t pulse_start = TCNT0; #endif - // Get the timer count and estimate the end of the pulse - hal_timer_t pulse_end = HAL_timer_get_count(PULSE_TIMER_NUM) + hal_timer_t(MIN_PULSE_TICKS); - - const hal_timer_t added_step_ticks = hal_timer_t(ADDED_STEP_TICKS); - - // Step E stepper if we have steps - while (LA_steps) { - - // Set the STEP pulse ON - #if ENABLED(MIXING_EXTRUDER) - MIXING_STEPPERS_LOOP(j) { - // Step mixing steppers (proportionally) - delta_error_m[j] += advance_dividend_m[j]; - // Step when the counter goes over zero - if (delta_error_m[j] >= 0) E_STEP_WRITE(j, !INVERT_E_STEP_PIN); - } - #else - E_STEP_WRITE(active_extruder, !INVERT_E_STEP_PIN); + START_E_PULSE(0); + #if E_STEPPERS > 1 + START_E_PULSE(1); + #if E_STEPPERS > 2 + START_E_PULSE(2); + #if E_STEPPERS > 3 + START_E_PULSE(3); + #if E_STEPPERS > 4 + START_E_PULSE(4); + #endif + #endif + #endif #endif - // Enforce a minimum duration for STEP pulse ON - #if MINIMUM_STEPPER_PULSE - // Just wait for the requested pulse duration - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } + // For minimum pulse time wait before stopping pulses + #if EXTRA_CYCLES_E > 20 + while (EXTRA_CYCLES_E > (uint32_t)(TCNT0 - pulse_start) * (INT0_PRESCALER)) { /* nada */ } + pulse_start = TCNT0; + #elif EXTRA_CYCLES_E > 0 + DELAY_NOPS(EXTRA_CYCLES_E); #endif - // Add the delay needed to ensure the maximum driver rate is enforced - if (signed(added_step_ticks) > 0) pulse_end += hal_timer_t(added_step_ticks); - - LA_steps < 0 ? ++LA_steps : --LA_steps; - - // Set the STEP pulse OFF - #if ENABLED(MIXING_EXTRUDER) - MIXING_STEPPERS_LOOP(j) { - if (delta_error_m[j] >= 0) { - delta_error_m[j] -= advance_divisor_m; - E_STEP_WRITE(j, INVERT_E_STEP_PIN); - } - } - #else - E_STEP_WRITE(active_extruder, INVERT_E_STEP_PIN); + STOP_E_PULSE(0); + #if E_STEPPERS > 1 + STOP_E_PULSE(1); + #if E_STEPPERS > 2 + STOP_E_PULSE(2); + #if E_STEPPERS > 3 + STOP_E_PULSE(3); + #if E_STEPPERS > 4 + STOP_E_PULSE(4); + #endif + #endif + #endif #endif // For minimum pulse time wait before looping - // Just wait for the requested pulse duration - if (LA_steps) { - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #if MINIMUM_STEPPER_PULSE - // Add to the value, the time that the pulse must be active (to be used on the next loop) - pulse_end += hal_timer_t(MIN_PULSE_TICKS); - #endif - } - } // LA_steps + #if EXTRA_CYCLES_E > 20 + if (i) while (EXTRA_CYCLES_E > (uint32_t)(TCNT0 - pulse_start) * (INT0_PRESCALER)) { /* nada */ } + #elif EXTRA_CYCLES_E > 0 + if (i) DELAY_NOPS(EXTRA_CYCLES_E); + #endif - return interval; + } // steps_loop } + + void Stepper::advance_isr_scheduler() { + // Disable Timer0 ISRs and enable global ISR again to capture UART events (incoming chars) + CBI(TIMSK0, OCIE0B); // Temperature ISR + DISABLE_STEPPER_DRIVER_INTERRUPT(); + sei(); + + // Run main stepping ISR if flagged + if (!nextMainISR) isr(); + + // Run Advance stepping ISR if flagged + if (!nextAdvanceISR) advance_isr(); + + // Is the next advance ISR scheduled before the next main ISR? + if (nextAdvanceISR <= nextMainISR) { + // Set up the next interrupt + OCR1A = nextAdvanceISR; + // New interval for the next main ISR + if (nextMainISR) nextMainISR -= nextAdvanceISR; + // Will call Stepper::advance_isr on the next interrupt + nextAdvanceISR = 0; + } + else { + // The next main ISR comes first + OCR1A = nextMainISR; + // New interval for the next advance ISR, if any + if (nextAdvanceISR && nextAdvanceISR != ADV_NEVER) + nextAdvanceISR -= nextMainISR; + // Will call Stepper::isr on the next interrupt + nextMainISR = 0; + } + + // Don't run the ISR faster than possible + NOLESS(OCR1A, TCNT1 + 16); + + // Restore original ISR settings + _ENABLE_ISRs(); + } + #endif // LIN_ADVANCE -// Check if the given block is busy or not - Must not be called from ISR contexts -// The current_block could change in the middle of the read by an Stepper ISR, so -// we must explicitly prevent that! -bool Stepper::is_block_busy(const block_t* const block) { - #define sw_barrier() asm volatile("": : :"memory"); - - // Keep reading until 2 consecutive reads return the same value, - // meaning there was no update in-between caused by an interrupt. - // This works because stepper ISRs happen at a slower rate than - // successive reads of a variable, so 2 consecutive reads with - // the same value means no interrupt updated it. - block_t* vold, *vnew = current_block; - sw_barrier(); - do { - vold = vnew; - vnew = current_block; - sw_barrier(); - } while (vold != vnew); - - // Return if the block is busy or not - return block == vnew; -} - void Stepper::init() { // Init Digipot Motor Current @@ -1934,6 +946,31 @@ void Stepper::init() { microstep_init(); #endif + // Init TMC Steppers + #if ENABLED(HAVE_TMCDRIVER) + tmc_init(); + #endif + + // Init TMC2130 Steppers + #if ENABLED(HAVE_TMC2130) + tmc2130_init(); + #endif + + // Init TMC2208 Steppers + #if ENABLED(HAVE_TMC2208) + tmc2208_init(); + #endif + + // TRAMS, TMC2130 and TMC2208 advanced settings + #if HAS_TRINAMIC + TMC_ADV() + #endif + + // Init L6470 Steppers + #if ENABLED(HAVE_L6470DRIVER) + L6470_init(); + #endif + // Init Dir Pins #if HAS_X_DIR X_DIR_INIT; @@ -1973,7 +1010,7 @@ void Stepper::init() { #if HAS_X_ENABLE X_ENABLE_INIT; if (!X_ENABLE_ON) X_ENABLE_WRITE(HIGH); - #if (ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS)) && HAS_X2_ENABLE + #if ENABLED(DUAL_X_CARRIAGE) && HAS_X2_ENABLE X2_ENABLE_INIT; if (!X_ENABLE_ON) X2_ENABLE_WRITE(HIGH); #endif @@ -2015,6 +1052,9 @@ void Stepper::init() { if (!E_ENABLE_ON) E4_ENABLE_WRITE(HIGH); #endif + // Init endstops and pullups + endstops.init(); + #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT #define _WRITE_STEP(AXIS, HIGHLOW) AXIS ##_STEP_WRITE(HIGHLOW) #define _DISABLE(AXIS) disable_## AXIS() @@ -2051,33 +1091,57 @@ void Stepper::init() { AXIS_INIT(Z, Z); #endif - #if E_STEPPERS > 0 && HAS_E0_STEP + #if HAS_E0_STEP E_AXIS_INIT(0); #endif - #if (E_STEPPERS > 1 || (E_STEPPERS == 1 && ENABLED(HANGPRINTER))) && HAS_E1_STEP + #if HAS_E1_STEP E_AXIS_INIT(1); #endif - #if (E_STEPPERS > 2 || (E_STEPPERS == 2 && ENABLED(HANGPRINTER))) && HAS_E2_STEP + #if HAS_E2_STEP E_AXIS_INIT(2); #endif - #if (E_STEPPERS > 3 || (E_STEPPERS == 3 && ENABLED(HANGPRINTER))) && HAS_E3_STEP + #if HAS_E3_STEP E_AXIS_INIT(3); #endif - #if (E_STEPPERS > 4 || (E_STEPPERS == 4 && ENABLED(HANGPRINTER))) && HAS_E4_STEP + #if HAS_E4_STEP E_AXIS_INIT(4); #endif - // Init Stepper ISR to 122 Hz for quick starting - HAL_timer_start(STEP_TIMER_NUM, 122); // OCR1A = 0x4000 + // waveform generation = 0100 = CTC + SET_WGM(1, CTC_OCRnA); + // output mode = 00 (disconnected) + SET_COMA(1, NORMAL); + + // Set the timer pre-scaler + // Generally we use a divider of 8, resulting in a 2MHz timer + // frequency on a 16MHz MCU. If you are going to change this, be + // sure to regenerate speed_lookuptable.h with + // create_speed_lookuptable.py + SET_CS(1, PRESCALER_8); // CS 2 = 1/8 prescaler + + // Init Stepper ISR to 122 Hz for quick starting + OCR1A = 0x4000; + TCNT1 = 0; ENABLE_STEPPER_DRIVER_INTERRUPT(); + #if ENABLED(LIN_ADVANCE) + for (uint8_t i = 0; i < COUNT(e_steps); i++) e_steps[i] = 0; + ZERO(current_adv_steps); + #endif + endstops.enable(true); // Start with endstops active. After homing they can be disabled sei(); set_directions(); // Init directions to last_direction_bits = 0 } + +/** + * Block until all buffered steps are executed / cleaned + */ +void Stepper::synchronize() { while (planner.blocks_queued() || cleaning_buffer_counter) idle(); } + /** * Set the stepper positions directly in steps * @@ -2087,12 +1151,12 @@ void Stepper::init() { * This allows get_axis_position_mm to correctly * derive the current XYZ position later on. */ -void Stepper::_set_position(const int32_t &a, const int32_t &b, const int32_t &c, - #if ENABLED(HANGPRINTER) - const int32_t &d, - #endif - const int32_t &e -) { +void Stepper::set_position(const long &a, const long &b, const long &c, const long &e) { + + synchronize(); // Bad to set stepper counts in the middle of a move + + CRITICAL_SECTION_START; + #if CORE_IS_XY // corexy positioning // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html @@ -2114,36 +1178,77 @@ void Stepper::_set_position(const int32_t &a, const int32_t &b, const int32_t &c count_position[X_AXIS] = a; count_position[Y_AXIS] = b; count_position[Z_AXIS] = c; - #if ENABLED(HANGPRINTER) - count_position[D_AXIS] = d; - #endif #endif + count_position[E_AXIS] = e; + CRITICAL_SECTION_END; +} + +void Stepper::set_position(const AxisEnum &axis, const long &v) { + CRITICAL_SECTION_START; + count_position[axis] = v; + CRITICAL_SECTION_END; +} + +void Stepper::set_e_position(const long &e) { + CRITICAL_SECTION_START; + count_position[E_AXIS] = e; + CRITICAL_SECTION_END; } /** * Get a stepper's position in steps. */ -int32_t Stepper::position(const AxisEnum axis) { - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - const int32_t v = count_position[axis]; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - return v; +long Stepper::position(const AxisEnum axis) { + CRITICAL_SECTION_START; + const long count_pos = count_position[axis]; + CRITICAL_SECTION_END; + return count_pos; } -// Signal endstops were triggered - This function can be called from -// an ISR context (Temperature, Stepper or limits ISR), so we must -// be very careful here. If the interrupt being preempted was the -// Stepper ISR (this CAN happen with the endstop limits ISR) then -// when the stepper ISR resumes, we must be very sure that the movement -// is properly cancelled -void Stepper::endstop_triggered(const AxisEnum axis) { +/** + * Get an axis position according to stepper position(s) + * For CORE machines apply translation from ABC to XYZ. + */ +float Stepper::get_axis_position_mm(const AxisEnum axis) { + float axis_steps; + #if IS_CORE + // Requesting one of the "core" axes? + if (axis == CORE_AXIS_1 || axis == CORE_AXIS_2) { + CRITICAL_SECTION_START; + // ((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 = 0.5f * ( + axis == CORE_AXIS_2 ? CORESIGN(count_position[CORE_AXIS_1] - count_position[CORE_AXIS_2]) + : count_position[CORE_AXIS_1] + count_position[CORE_AXIS_2] + ); + CRITICAL_SECTION_END; + } + else + axis_steps = position(axis); + #else + axis_steps = position(axis); + #endif + return axis_steps * planner.steps_to_mm[axis]; +} - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); +void Stepper::finish_and_disable() { + synchronize(); + disable_all_steppers(); +} + +void Stepper::quick_stop() { + cleaning_buffer_counter = 5000; + DISABLE_STEPPER_DRIVER_INTERRUPT(); + while (planner.blocks_queued()) planner.discard_current_block(); + current_block = NULL; + ENABLE_STEPPER_DRIVER_INTERRUPT(); + #if ENABLED(ULTRA_LCD) + planner.clear_block_buffer_runtime(); + #endif +} + +void Stepper::endstop_triggered(AxisEnum axis) { #if IS_CORE @@ -2158,74 +1263,43 @@ void Stepper::endstop_triggered(const AxisEnum axis) { #endif // !COREXY && !COREXZ && !COREYZ - // Discard the rest of the move if there is a current block - quick_stop(); - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); -} - -int32_t Stepper::triggered_position(const AxisEnum axis) { - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - const int32_t v = endstops_trigsteps[axis]; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - - return v; + kill_current_block(); + cleaning_buffer_counter = -1; // Discard the rest of the move } void Stepper::report_positions() { + CRITICAL_SECTION_START; + const long xpos = count_position[X_AXIS], + ypos = count_position[Y_AXIS], + zpos = count_position[Z_AXIS]; + CRITICAL_SECTION_END; - // Protect the access to the position. - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - const int32_t xpos = count_position[X_AXIS], - ypos = count_position[Y_AXIS], - #if ENABLED(HANGPRINTER) - dpos = count_position[D_AXIS], - #endif - zpos = count_position[Z_AXIS]; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - - #if CORE_IS_XY || CORE_IS_XZ || IS_DELTA || IS_SCARA || ENABLED(HANGPRINTER) + #if CORE_IS_XY || CORE_IS_XZ || IS_SCARA SERIAL_PROTOCOLPGM(MSG_COUNT_A); #else SERIAL_PROTOCOLPGM(MSG_COUNT_X); #endif SERIAL_PROTOCOL(xpos); - #if CORE_IS_XY || CORE_IS_YZ || IS_DELTA || IS_SCARA || ENABLED(HANGPRINTER) + #if CORE_IS_XY || CORE_IS_YZ || IS_SCARA SERIAL_PROTOCOLPGM(" B:"); #else SERIAL_PROTOCOLPGM(" Y:"); #endif SERIAL_PROTOCOL(ypos); - #if CORE_IS_XZ || CORE_IS_YZ || IS_DELTA || ENABLED(HANGPRINTER) + #if CORE_IS_XZ || CORE_IS_YZ SERIAL_PROTOCOLPGM(" C:"); #else SERIAL_PROTOCOLPGM(" Z:"); #endif SERIAL_PROTOCOL(zpos); - #if ENABLED(HANGPRINTER) - SERIAL_PROTOCOLPAIR(" D:", dpos); - #endif - SERIAL_EOL(); } #if ENABLED(BABYSTEPPING) - #if MINIMUM_STEPPER_PULSE - #define STEP_PULSE_CYCLES ((MINIMUM_STEPPER_PULSE) * CYCLES_PER_MICROSECOND) - #else - #define STEP_PULSE_CYCLES 0 - #endif - #if ENABLED(DELTA) #define CYCLES_EATEN_BABYSTEP (2 * 15) #else @@ -2239,31 +1313,30 @@ void Stepper::report_positions() { #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true) #if EXTRA_CYCLES_BABYSTEP > 20 - #define _SAVE_START const hal_timer_t pulse_start = HAL_timer_get_count(PULSE_TIMER_NUM) - #define _PULSE_WAIT while (EXTRA_CYCLES_BABYSTEP > (uint32_t)(HAL_timer_get_count(PULSE_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ } + #define _SAVE_START const uint32_t pulse_start = TCNT0 + #define _PULSE_WAIT while (EXTRA_CYCLES_BABYSTEP > (uint32_t)(TCNT0 - pulse_start) * (INT0_PRESCALER)) { /* nada */ } #else #define _SAVE_START NOOP #if EXTRA_CYCLES_BABYSTEP > 0 - #define _PULSE_WAIT DELAY_NS(EXTRA_CYCLES_BABYSTEP * NANOSECONDS_PER_CYCLE) + #define _PULSE_WAIT DELAY_NOPS(EXTRA_CYCLES_BABYSTEP) #elif STEP_PULSE_CYCLES > 0 #define _PULSE_WAIT NOOP #elif ENABLED(DELTA) - #define _PULSE_WAIT DELAY_US(2); + #define _PULSE_WAIT delayMicroseconds(2); #else - #define _PULSE_WAIT DELAY_US(4); + #define _PULSE_WAIT delayMicroseconds(4); #endif #endif - #define BABYSTEP_AXIS(AXIS, INVERT, DIR) { \ - const uint8_t old_dir = _READ_DIR(AXIS); \ - _ENABLE(AXIS); \ - _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \ - DELAY_NS(MINIMUM_STEPPER_DIR_DELAY); \ - _SAVE_START; \ - _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \ - _PULSE_WAIT; \ - _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \ - _APPLY_DIR(AXIS, old_dir); \ + #define BABYSTEP_AXIS(AXIS, INVERT) { \ + const uint8_t old_dir = _READ_DIR(AXIS); \ + _ENABLE(AXIS); \ + _SAVE_START; \ + _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^direction^INVERT); \ + _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \ + _PULSE_WAIT; \ + _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \ + _APPLY_DIR(AXIS, old_dir); \ } // MUST ONLY BE CALLED BY AN ISR, @@ -2276,43 +1349,20 @@ void Stepper::report_positions() { #if ENABLED(BABYSTEP_XY) case X_AXIS: - #if CORE_IS_XY - BABYSTEP_AXIS(X, false, direction); - BABYSTEP_AXIS(Y, false, direction); - #elif CORE_IS_XZ - BABYSTEP_AXIS(X, false, direction); - BABYSTEP_AXIS(Z, false, direction); - #else - BABYSTEP_AXIS(X, false, direction); - #endif + BABYSTEP_AXIS(X, false); break; case Y_AXIS: - #if CORE_IS_XY - BABYSTEP_AXIS(X, false, direction); - BABYSTEP_AXIS(Y, false, direction^(CORESIGN(1)<0)); - #elif CORE_IS_YZ - BABYSTEP_AXIS(Y, false, direction); - BABYSTEP_AXIS(Z, false, direction^(CORESIGN(1)<0)); - #else - BABYSTEP_AXIS(Y, false, direction); - #endif + BABYSTEP_AXIS(Y, false); break; #endif case Z_AXIS: { - #if CORE_IS_XZ - BABYSTEP_AXIS(X, BABYSTEP_INVERT_Z, direction); - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction^(CORESIGN(1)<0)); + #if DISABLED(DELTA) - #elif CORE_IS_YZ - BABYSTEP_AXIS(Y, BABYSTEP_INVERT_Z, direction); - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction^(CORESIGN(1)<0)); - - #elif DISABLED(DELTA) - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction); + BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z); #else // DELTA @@ -2330,10 +1380,6 @@ void Stepper::report_positions() { Y_DIR_WRITE(INVERT_Y_DIR ^ z_direction); Z_DIR_WRITE(INVERT_Z_DIR ^ z_direction); - #if MINIMUM_STEPPER_DIR_DELAY > 0 - DELAY_NS(MINIMUM_STEPPER_DIR_DELAY); - #endif - _SAVE_START; X_STEP_WRITE(!INVERT_X_STEP_PIN); @@ -2562,15 +1608,10 @@ void Stepper::report_positions() { void Stepper::microstep_mode(const uint8_t driver, const uint8_t stepping_mode) { switch (stepping_mode) { case 1: microstep_ms(driver, MICROSTEP1); break; - #if ENABLED(HEROIC_STEPPER_DRIVERS) - case 128: microstep_ms(driver, MICROSTEP128); break; - #else - case 2: microstep_ms(driver, MICROSTEP2); break; - case 4: microstep_ms(driver, MICROSTEP4); break; - #endif + case 2: microstep_ms(driver, MICROSTEP2); break; + case 4: microstep_ms(driver, MICROSTEP4); break; case 8: microstep_ms(driver, MICROSTEP8); break; case 16: microstep_ms(driver, MICROSTEP16); break; - default: SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("Microsteps unavailable"); break; } } diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 786a376..0115125 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -43,191 +43,55 @@ #ifndef STEPPER_H #define STEPPER_H -#include "MarlinConfig.h" - -// Disable multiple steps per ISR -//#define DISABLE_MULTI_STEPPING - -// -// Estimate the amount of time the Stepper ISR will take to execute -// - -#ifndef MINIMUM_STEPPER_PULSE - #define MINIMUM_STEPPER_PULSE 0UL -#endif - -#ifndef MAXIMUM_STEPPER_RATE - #if MINIMUM_STEPPER_PULSE - #define MAXIMUM_STEPPER_RATE (1000000UL / (2UL * (unsigned long)(MINIMUM_STEPPER_PULSE))) - #else - #define MAXIMUM_STEPPER_RATE 500000UL - #endif -#endif - -// The base ISR takes 752 cycles -#define ISR_BASE_CYCLES 752UL - -// Linear advance base time is 32 cycles -#if ENABLED(LIN_ADVANCE) - #define ISR_LA_BASE_CYCLES 32UL -#else - #define ISR_LA_BASE_CYCLES 0UL -#endif - -// S curve interpolation adds 160 cycles -#if ENABLED(S_CURVE_ACCELERATION) - #define ISR_S_CURVE_CYCLES 160UL -#else - #define ISR_S_CURVE_CYCLES 0UL -#endif - -// Stepper Loop base cycles -#define ISR_LOOP_BASE_CYCLES 32UL - -// To start the step pulse, in the worst case takes -#define ISR_START_STEPPER_CYCLES 57UL - -// And each stepper (start + stop pulse) takes in worst case -#define ISR_STEPPER_CYCLES 88UL - -// Add time for each stepper -#ifdef HAS_X_STEP - #define ISR_START_X_STEPPER_CYCLES ISR_START_STEPPER_CYCLES - #define ISR_X_STEPPER_CYCLES ISR_STEPPER_CYCLES -#else - #define ISR_START_X_STEPPER_CYCLES 0UL - #define ISR_X_STEPPER_CYCLES 0UL -#endif -#ifdef HAS_Y_STEP - #define ISR_START_Y_STEPPER_CYCLES ISR_START_STEPPER_CYCLES - #define ISR_Y_STEPPER_CYCLES ISR_STEPPER_CYCLES -#else - #define ISR_START_Y_STEPPER_CYCLES 0UL - #define ISR_Y_STEPPER_CYCLES 0UL -#endif -#ifdef HAS_Z_STEP - #define ISR_START_Z_STEPPER_CYCLES ISR_START_STEPPER_CYCLES - #define ISR_Z_STEPPER_CYCLES ISR_STEPPER_CYCLES -#else - #define ISR_START_Z_STEPPER_CYCLES 0UL - #define ISR_Z_STEPPER_CYCLES 0UL -#endif - -// E is always interpolated, even for mixing extruders -#define ISR_START_E_STEPPER_CYCLES ISR_START_STEPPER_CYCLES -#define ISR_E_STEPPER_CYCLES ISR_STEPPER_CYCLES - -// If linear advance is disabled, then the loop also handles them -#if DISABLED(LIN_ADVANCE) && ENABLED(MIXING_EXTRUDER) - #define ISR_START_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * (ISR_START_STEPPER_CYCLES)) - #define ISR_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES)) -#else - #define ISR_START_MIXING_STEPPER_CYCLES 0UL - #define ISR_MIXING_STEPPER_CYCLES 0UL -#endif - -// Calculate the minimum time to start all stepper pulses in the ISR loop -#define MIN_ISR_START_LOOP_CYCLES (ISR_START_X_STEPPER_CYCLES + ISR_START_Y_STEPPER_CYCLES + ISR_START_Z_STEPPER_CYCLES + ISR_START_E_STEPPER_CYCLES + ISR_START_MIXING_STEPPER_CYCLES) - -// And the total minimum loop time, not including the base -#define MIN_ISR_LOOP_CYCLES (ISR_X_STEPPER_CYCLES + ISR_Y_STEPPER_CYCLES + ISR_Z_STEPPER_CYCLES + ISR_E_STEPPER_CYCLES + ISR_MIXING_STEPPER_CYCLES) - -// Calculate the minimum MPU cycles needed per pulse to enforce, limited to the max stepper rate -#define _MIN_STEPPER_PULSE_CYCLES(N) MAX((unsigned long)((F_CPU) / (MAXIMUM_STEPPER_RATE)), ((F_CPU) / 500000UL) * (N)) -#if MINIMUM_STEPPER_PULSE - #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES((unsigned long)(MINIMUM_STEPPER_PULSE)) -#else - #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES(1UL) -#endif - -// Calculate the minimum ticks of the PULSE timer that must elapse with the step pulse enabled -// adding the "start stepper pulse" code section execution cycles to account for that not all -// pulses start at the beginning of the loop, so an extra time must be added to compensate so -// the last generated pulse (usually the extruder stepper) has the right length -#define MIN_PULSE_TICKS (((PULSE_TIMER_TICKS_PER_US) * (unsigned long)(MINIMUM_STEPPER_PULSE)) + ((MIN_ISR_START_LOOP_CYCLES) / (unsigned long)(PULSE_TIMER_PRESCALE))) - -// Calculate the extra ticks of the PULSE timer between step pulses -#define ADDED_STEP_TICKS (((MIN_STEPPER_PULSE_CYCLES) / (PULSE_TIMER_PRESCALE)) - (MIN_PULSE_TICKS)) - -// But the user could be enforcing a minimum time, so the loop time is -#define ISR_LOOP_CYCLES (ISR_LOOP_BASE_CYCLES + MAX(MIN_STEPPER_PULSE_CYCLES, MIN_ISR_LOOP_CYCLES)) - -// If linear advance is enabled, then it is handled separately -#if ENABLED(LIN_ADVANCE) - - // Estimate the minimum LA loop time - #if ENABLED(MIXING_EXTRUDER) - #define MIN_ISR_LA_LOOP_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES)) - #else - #define MIN_ISR_LA_LOOP_CYCLES ISR_STEPPER_CYCLES - #endif - - // And the real loop time - #define ISR_LA_LOOP_CYCLES MAX(MIN_STEPPER_PULSE_CYCLES, MIN_ISR_LA_LOOP_CYCLES) - -#else - #define ISR_LA_LOOP_CYCLES 0UL -#endif - -// Now estimate the total ISR execution time in cycles given a step per ISR multiplier -#define ISR_EXECUTION_CYCLES(R) (((ISR_BASE_CYCLES + ISR_S_CURVE_CYCLES + (ISR_LOOP_CYCLES) * (R) + ISR_LA_BASE_CYCLES + ISR_LA_LOOP_CYCLES)) / (R)) - -// The maximum allowable stepping frequency when doing x128-x1 stepping (in Hz) -#define MAX_STEP_ISR_FREQUENCY_128X ((F_CPU) / ISR_EXECUTION_CYCLES(128)) -#define MAX_STEP_ISR_FREQUENCY_64X ((F_CPU) / ISR_EXECUTION_CYCLES(64)) -#define MAX_STEP_ISR_FREQUENCY_32X ((F_CPU) / ISR_EXECUTION_CYCLES(32)) -#define MAX_STEP_ISR_FREQUENCY_16X ((F_CPU) / ISR_EXECUTION_CYCLES(16)) -#define MAX_STEP_ISR_FREQUENCY_8X ((F_CPU) / ISR_EXECUTION_CYCLES(8)) -#define MAX_STEP_ISR_FREQUENCY_4X ((F_CPU) / ISR_EXECUTION_CYCLES(4)) -#define MAX_STEP_ISR_FREQUENCY_2X ((F_CPU) / ISR_EXECUTION_CYCLES(2)) -#define MAX_STEP_ISR_FREQUENCY_1X ((F_CPU) / ISR_EXECUTION_CYCLES(1)) - -// The minimum allowable frequency for step smoothing will be 1/10 of the maximum nominal frequency (in Hz) -#define MIN_STEP_ISR_FREQUENCY MAX_STEP_ISR_FREQUENCY_1X - -// -// Stepper class definition -// - #include "planner.h" #include "speed_lookuptable.h" #include "stepper_indirection.h" #include "language.h" #include "types.h" +class Stepper; +extern Stepper stepper; + +#define ENABLE_STEPPER_DRIVER_INTERRUPT() SBI(TIMSK1, OCIE1A) +#define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A) + // intRes = intIn1 * intIn2 >> 16 // uses: // r26 to store 0 // r27 to store the byte 1 of the 24 bit result -static FORCE_INLINE uint16_t MultiU16X8toH16(uint8_t charIn1, uint16_t intIn2) { - register uint8_t tmp; - register uint16_t intRes; - __asm__ __volatile__ ( - A("clr %[tmp]") - A("mul %[charIn1], %B[intIn2]") - A("movw %A[intRes], r0") - A("mul %[charIn1], %A[intIn2]") - A("add %A[intRes], r1") - A("adc %B[intRes], %[tmp]") - A("lsr r0") - A("adc %A[intRes], %[tmp]") - A("adc %B[intRes], %[tmp]") - A("clr r1") - : [intRes] "=&r" (intRes), - [tmp] "=&r" (tmp) - : [charIn1] "d" (charIn1), - [intIn2] "d" (intIn2) - : "cc" - ); - return intRes; -} +#define MultiU16X8toH16(intRes, charIn1, intIn2) \ + asm volatile ( \ + "clr r26 \n\t" \ + "mul %A1, %B2 \n\t" \ + "movw %A0, r0 \n\t" \ + "mul %A1, %A2 \n\t" \ + "add %A0, r1 \n\t" \ + "adc %B0, r26 \n\t" \ + "lsr r0 \n\t" \ + "adc %A0, r26 \n\t" \ + "adc %B0, r26 \n\t" \ + "clr r1 \n\t" \ + : \ + "=&r" (intRes) \ + : \ + "d" (charIn1), \ + "d" (intIn2) \ + : \ + "r26" \ + ) class Stepper { public: + static block_t* current_block; // A pointer to the block currently being traced + + #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) + static bool abort_on_endstop_hit; + #endif + #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - static bool homing_dual_axis; + static bool performing_homing; #endif #if HAS_MOTOR_CURRENT_PWM @@ -237,92 +101,70 @@ class Stepper { static uint32_t motor_current_setting[3]; #endif + static int16_t cleaning_buffer_counter; + private: - static block_t* current_block; // A pointer to the block currently being traced - - static uint8_t last_direction_bits, // The next stepping-bits to be output - axis_did_move; // Last Movement in the given direction is not null, as computed when the last movement was fetched from planner - - static bool abort_current_block; // Signals to the stepper that current block should be aborted - - #if DISABLED(MIXING_EXTRUDER) - static uint8_t last_moved_extruder; // Last-moved extruder, as set when the last movement was fetched from planner - #endif + static uint8_t last_direction_bits; // The next stepping-bits to be output #if ENABLED(X_DUAL_ENDSTOPS) - static bool locked_X_motor, locked_X2_motor; + static bool locked_x_motor, locked_x2_motor; #endif #if ENABLED(Y_DUAL_ENDSTOPS) - static bool locked_Y_motor, locked_Y2_motor; + static bool locked_y_motor, locked_y2_motor; #endif #if ENABLED(Z_DUAL_ENDSTOPS) - static bool locked_Z_motor, locked_Z2_motor; + static bool locked_z_motor, locked_z2_motor; #endif - static uint32_t acceleration_time, deceleration_time; // time measured in Stepper Timer ticks - static uint8_t steps_per_isr; // Count of steps to perform per Stepper ISR call + // Counter variables for the Bresenham line tracer + static long counter_X, counter_Y, counter_Z, counter_E; + static volatile uint32_t step_events_completed; // The number of step events executed in the current block - #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - static uint8_t oversampling_factor; // Oversampling factor (log2(multiplier)) to increase temporal resolution of axis - #else - static constexpr uint8_t oversampling_factor = 0; - #endif - - // Delta error variables for the Bresenham line tracer - static int32_t delta_error[NUM_AXIS]; - static uint32_t advance_dividend[NUM_AXIS], - advance_divisor, - step_events_completed, // The number of step events executed in the current block - accelerate_until, // The point from where we need to stop acceleration - decelerate_after, // The point from where we need to start decelerating - step_event_count; // The total event count for the current block - - // Mixing extruder mix delta_errors for bresenham tracing - #if ENABLED(MIXING_EXTRUDER) - static int32_t delta_error_m[MIXING_STEPPERS]; - static uint32_t advance_dividend_m[MIXING_STEPPERS], - advance_divisor_m; - #define MIXING_STEPPERS_LOOP(VAR) \ - for (uint8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++) - #else - static int8_t active_extruder; // Active extruder - #endif - - #if ENABLED(S_CURVE_ACCELERATION) - static int32_t bezier_A, // A coefficient in Bézier speed curve - bezier_B, // B coefficient in Bézier speed curve - bezier_C; // C coefficient in Bézier speed curve - static uint32_t bezier_F, // F coefficient in Bézier speed curve - bezier_AV; // AV coefficient in Bézier speed curve - static bool A_negative, // If A coefficient was negative - bezier_2nd_half; // If Bézier curve has been initialized or not - #endif - - static uint32_t nextMainISR; // time remaining for the next Step ISR #if ENABLED(LIN_ADVANCE) - static uint32_t nextAdvanceISR, LA_isr_rate; - static uint16_t LA_current_adv_steps, LA_final_adv_steps, LA_max_adv_steps; // Copy from current executed block. Needed because current_block is set to NULL "too early". - static int8_t LA_steps; - static bool LA_use_advance_lead; - #endif // LIN_ADVANCE - static int32_t ticks_nominal; - #if DISABLED(S_CURVE_ACCELERATION) - static uint32_t acc_step_rate; // needed for deceleration start point - #endif + static uint16_t nextMainISR, nextAdvanceISR, eISR_Rate; + #define _NEXT_ISR(T) nextMainISR = T + static volatile int e_steps[E_STEPPERS]; + 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 // !LIN_ADVANCE - static volatile int32_t endstops_trigsteps[XYZ]; + #define _NEXT_ISR(T) OCR1A = T + + #endif // !LIN_ADVANCE + + static long acceleration_time, deceleration_time; + static uint8_t step_loops, step_loops_nominal; + + static uint16_t OCR1A_nominal, + acc_step_rate; // needed for deceleration start point + + static volatile long endstops_trigsteps[XYZ]; + static volatile long endstops_stepsTotal, endstops_stepsDone; // // Positions of stepper motors, in step units // - static volatile int32_t count_position[NUM_AXIS]; + static volatile long count_position[NUM_AXIS]; // // Current direction of stepper motors (+1 or -1) // - static int8_t count_direction[NUM_AXIS]; + 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: @@ -331,64 +173,82 @@ class Stepper { // Stepper() { }; + // // Initialize stepper hardware + // static void init(); + // // Interrupt Service Routines + // - // The ISR scheduler static void isr(); - // The stepper pulse phase ISR - static void stepper_pulse_phase_isr(); - - // The stepper block processing phase ISR - static uint32_t stepper_block_phase_isr(); - #if ENABLED(LIN_ADVANCE) - // The Linear advance stepper ISR - static uint32_t advance_isr(); + static void advance_isr(); + static void advance_isr_scheduler(); #endif - // Check if the given block is busy or not - Must not be called from ISR contexts - static bool is_block_busy(const block_t* const block); + // + // Block until all buffered steps are executed + // + static void synchronize(); + // + // Set the current position in steps + // + static void set_position(const long &a, const long &b, const long &c, const long &e); + static void set_position(const AxisEnum &a, const long &v); + static void set_e_position(const long &e); + + // + // Set direction bits for all steppers + // + static void set_directions(); + + // // Get the position of a stepper, in steps - static int32_t position(const AxisEnum axis); + // + static long position(const AxisEnum axis); + // // Report the positions of the steppers, in steps + // static void report_positions(); + // + // Get the position (mm) of an axis based on stepper position(s) + // + static float get_axis_position_mm(const AxisEnum axis); + + // + // SCARA AB axes are in degrees, not mm + // + #if IS_SCARA + FORCE_INLINE static float get_axis_position_degrees(const AxisEnum axis) { return get_axis_position_mm(axis); } + #endif + + // // 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. + // static void wake_up(); - // Quickly stop all steppers - FORCE_INLINE static void quick_stop() { abort_current_block = true; } + // + // Wait for moves to finish and disable all steppers + // + static void finish_and_disable(); + // + // Quickly stop all steppers and clear the blocks queue + // + static void quick_stop(); + + // // The direction of a single motor + // FORCE_INLINE static bool motor_direction(const AxisEnum axis) { return TEST(last_direction_bits, axis); } - // The last movement direction was not null on the specified axis. Note that motor direction is not necessarily the same. - FORCE_INLINE static bool axis_is_moving(const AxisEnum axis) { return TEST(axis_did_move, axis); } - - // The extruder associated to the last movement - FORCE_INLINE static uint8_t movement_extruder() { - return - #if ENABLED(MIXING_EXTRUDER) - 0 - #else - last_moved_extruder - #endif - ; - } - - // Handle a triggered endstop - static void endstop_triggered(const AxisEnum axis); - - // Triggered position of an axis in steps - static int32_t triggered_position(const AxisEnum axis); - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM static void digitalPotWrite(const int16_t address, const int16_t value); static void digipot_current(const uint8_t driver, const int16_t current); @@ -400,135 +260,126 @@ class Stepper { static void microstep_readings(); #endif - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - FORCE_INLINE static void set_homing_dual_axis(const bool state) { homing_dual_axis = state; } - #endif #if ENABLED(X_DUAL_ENDSTOPS) - FORCE_INLINE static void set_x_lock(const bool state) { locked_X_motor = state; } - FORCE_INLINE static void set_x2_lock(const bool state) { locked_X2_motor = state; } + FORCE_INLINE static void set_homing_flag_x(const bool state) { performing_homing = state; } + FORCE_INLINE static void set_x_lock(const bool state) { locked_x_motor = state; } + FORCE_INLINE static void set_x2_lock(const bool state) { locked_x2_motor = state; } #endif #if ENABLED(Y_DUAL_ENDSTOPS) - FORCE_INLINE static void set_y_lock(const bool state) { locked_Y_motor = state; } - FORCE_INLINE static void set_y2_lock(const bool state) { locked_Y2_motor = state; } + FORCE_INLINE static void set_homing_flag_y(const bool state) { performing_homing = state; } + FORCE_INLINE static void set_y_lock(const bool state) { locked_y_motor = state; } + FORCE_INLINE static void set_y2_lock(const bool state) { locked_y2_motor = state; } #endif #if ENABLED(Z_DUAL_ENDSTOPS) - FORCE_INLINE static void set_z_lock(const bool state) { locked_Z_motor = state; } - FORCE_INLINE static void set_z2_lock(const bool state) { locked_Z2_motor = state; } + FORCE_INLINE static void set_homing_flag_z(const bool state) { performing_homing = state; } + FORCE_INLINE static void set_z_lock(const bool state) { locked_z_motor = state; } + FORCE_INLINE static void set_z2_lock(const bool state) { locked_z2_motor = state; } #endif #if ENABLED(BABYSTEPPING) static void babystep(const AxisEnum axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention #endif + static inline void kill_current_block() { + step_events_completed = current_block->step_event_count; + } + + // + // Handle a triggered endstop + // + static void endstop_triggered(const AxisEnum axis); + + // + // Triggered position of an axis in mm (not core-savvy) + // + FORCE_INLINE static float triggered_position_mm(const AxisEnum axis) { + return endstops_trigsteps[axis] * planner.steps_to_mm[axis]; + } + #if HAS_MOTOR_CURRENT_PWM static void refresh_motor_power(); #endif - // Set the current position in steps - inline static void set_position(const int32_t &a, const int32_t &b, const int32_t &c - #if ENABLED(HANGPRINTER) - , const int32_t &d - #endif - , const int32_t &e - ) { - planner.synchronize(); - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - _set_position(a, b, c - #if ENABLED(HANGPRINTER) - , d - #endif - , e - ); - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - } - - inline static void set_position(const AxisEnum a, const int32_t &v) { - planner.synchronize(); - - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - count_position[a] = v; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - } - private: - // Set the current position in steps - static void _set_position(const int32_t &a, const int32_t &b, const int32_t &c - #if ENABLED(HANGPRINTER) - , const int32_t &d - #endif - , const int32_t &e - ); + FORCE_INLINE static unsigned short calc_timer_interval(unsigned short step_rate) { + unsigned short timer; - // Set direction bits for all steppers - static void set_directions(); + NOMORE(step_rate, MAX_STEP_FREQUENCY); - // Allow reset_stepper_drivers to access private set_directions - friend void reset_stepper_drivers(); + if (step_rate > 20000) { // If steprate > 20kHz >> step 4 times + step_rate >>= 2; + step_loops = 4; + } + else if (step_rate > 10000) { // If steprate > 10kHz >> step 2 times + step_rate >>= 1; + step_loops = 2; + } + else { + step_loops = 1; + } - FORCE_INLINE static uint32_t calc_timer_interval(uint32_t step_rate, uint8_t scale, uint8_t* loops) { - uint32_t timer; - - // Scale the frequency, as requested by the caller - step_rate <<= scale; - - uint8_t multistep = 1; - #if DISABLED(DISABLE_MULTI_STEPPING) - - // The stepping frequency limits for each multistepping rate - static const uint32_t limit[] PROGMEM = { - ( MAX_STEP_ISR_FREQUENCY_1X ), - ( MAX_STEP_ISR_FREQUENCY_2X >> 1), - ( MAX_STEP_ISR_FREQUENCY_4X >> 2), - ( MAX_STEP_ISR_FREQUENCY_8X >> 3), - ( MAX_STEP_ISR_FREQUENCY_16X >> 4), - ( MAX_STEP_ISR_FREQUENCY_32X >> 5), - ( MAX_STEP_ISR_FREQUENCY_64X >> 6), - (MAX_STEP_ISR_FREQUENCY_128X >> 7) - }; - - // Select the proper multistepping - uint8_t idx = 0; - while (idx < 7 && step_rate > (uint32_t)pgm_read_dword(&limit[idx])) { - step_rate >>= 1; - multistep <<= 1; - ++idx; - }; - #else - NOMORE(step_rate, uint32_t(MAX_STEP_ISR_FREQUENCY_1X)); - #endif - *loops = multistep; - - constexpr uint32_t min_step_rate = F_CPU / 500000U; - NOLESS(step_rate, min_step_rate); - step_rate -= min_step_rate; // Correct for minimal speed + NOLESS(step_rate, F_CPU / 500000); + step_rate -= F_CPU / 500000; // Correct for minimal speed if (step_rate >= (8 * 256)) { // higher step rate - const uint8_t tmp_step_rate = (step_rate & 0x00FF); - const uint16_t table_address = (uint16_t)&speed_lookuptable_fast[(uint8_t)(step_rate >> 8)][0], - gain = (uint16_t)pgm_read_word_near(table_address + 2); - timer = MultiU16X8toH16(tmp_step_rate, gain); - timer = (uint16_t)pgm_read_word_near(table_address) - timer; + unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate >> 8)][0]; + unsigned char tmp_step_rate = (step_rate & 0x00FF); + unsigned short gain = (unsigned short)pgm_read_word_near(table_address + 2); + MultiU16X8toH16(timer, tmp_step_rate, gain); + timer = (unsigned short)pgm_read_word_near(table_address) - timer; } else { // lower step rates - uint16_t table_address = (uint16_t)&speed_lookuptable_slow[0][0]; + unsigned short table_address = (unsigned short)&speed_lookuptable_slow[0][0]; table_address += ((step_rate) >> 1) & 0xFFFC; - timer = (uint16_t)pgm_read_word_near(table_address) - - (((uint16_t)pgm_read_word_near(table_address + 2) * (uint8_t)(step_rate & 0x0007)) >> 3); + timer = (unsigned short)pgm_read_word_near(table_address); + timer -= (((unsigned short)pgm_read_word_near(table_address + 2) * (unsigned char)(step_rate & 0x0007)) >> 3); + } + if (timer < 100) { // (20kHz - this should never happen) + timer = 100; + MYSERIAL.print(MSG_STEPPER_TOO_HIGH); + MYSERIAL.println(step_rate); } - // (there is no need to limit the timer value here. All limits have been - // applied above, and AVR is able to keep up at 30khz Stepping ISR rate) - return timer; } - #if ENABLED(S_CURVE_ACCELERATION) - static void _calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av); - static int32_t _eval_bezier_curve(const uint32_t curr_step); - #endif + // Initialize the trapezoid generator from the current block. + // Called whenever a new block begins. + FORCE_INLINE static void trapezoid_generator_reset() { + + static int8_t last_extruder = -1; + + if (current_block->direction_bits != last_direction_bits || current_block->active_extruder != last_extruder) { + last_direction_bits = current_block->direction_bits; + last_extruder = current_block->active_extruder; + set_directions(); + } + + deceleration_time = 0; + // step_rate to timer interval + OCR1A_nominal = calc_timer_interval(current_block->nominal_rate); + // make a note of the number of step loops required at nominal speed + step_loops_nominal = step_loops; + acc_step_rate = current_block->initial_rate; + acceleration_time = calc_timer_interval(acc_step_rate); + _NEXT_ISR(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->abs_adv_steps_multiplier8) >> 17; + final_estep_rate = (current_block->nominal_rate * current_block->abs_adv_steps_multiplier8) >> 17; + } + #endif + + // SERIAL_ECHO_START(); + // SERIAL_ECHOPGM("advance :"); + // SERIAL_ECHO(current_block->advance/256.0); + // SERIAL_ECHOPGM("advance rate :"); + // SERIAL_ECHO(current_block->advance_rate/256.0); + // SERIAL_ECHOPGM("initial advance :"); + // SERIAL_ECHO(current_block->initial_advance/256.0); + // SERIAL_ECHOPGM("final advance :"); + // SERIAL_ECHOLN(current_block->final_advance/256.0); + } #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM static void digipot_init(); @@ -540,6 +391,4 @@ class Stepper { }; -extern Stepper stepper; - #endif // STEPPER_H diff --git a/Marlin/stepper_dac.cpp b/Marlin/stepper_dac.cpp index d5f713f..f7161e3 100644 --- a/Marlin/stepper_dac.cpp +++ b/Marlin/stepper_dac.cpp @@ -91,8 +91,8 @@ mcp4728_simpleCommand(UPDATE); } - static float dac_perc(int8_t n) { return 100.0f * mcp4728_getValue(dac_order[n]) * (1.0f / (DAC_STEPPER_MAX)); } - static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * (1.0f / (DAC_STEPPER_SENSE)); } + static float dac_perc(int8_t n) { return 100.0 * mcp4728_getValue(dac_order[n]) * (1.0 / (DAC_STEPPER_MAX)); } + static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * (1.0 / (DAC_STEPPER_SENSE)); } uint8_t dac_current_get_percent(const AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); } void dac_current_set_percents(const uint8_t pct[XYZE]) { @@ -114,7 +114,7 @@ SERIAL_ECHOPAIR(" (", dac_amps(Z_AXIS)); SERIAL_ECHOPAIR(") E:", dac_perc(E_AXIS)); SERIAL_ECHOPAIR(" (", dac_amps(E_AXIS)); - SERIAL_ECHOLNPGM(")"); + SERIAL_ECHOLN(")"); } void dac_commit_eeprom() { diff --git a/Marlin/stepper_indirection.cpp b/Marlin/stepper_indirection.cpp index cde4c31..8811ed0 100644 --- a/Marlin/stepper_indirection.cpp +++ b/Marlin/stepper_indirection.cpp @@ -35,165 +35,154 @@ #include "MarlinConfig.h" -#include "stepper.h" - // // TMC26X Driver objects and inits // -#if HAS_DRIVER(TMC26X) +#if ENABLED(HAVE_TMCDRIVER) + #include #include - #define _TMC26X_DEFINE(ST) TMC26XStepper stepper##ST(200, ST##_CS_PIN, ST##_STEP_PIN, ST##_DIR_PIN, ST##_MAX_CURRENT, ST##_SENSE_RESISTOR) + #define _TMC_DEFINE(ST) TMC26XStepper stepper##ST(200, ST##_ENABLE_PIN, ST##_STEP_PIN, ST##_DIR_PIN, ST##_MAX_CURRENT, ST##_SENSE_RESISTOR) - #if AXIS_DRIVER_TYPE(X, TMC26X) - _TMC26X_DEFINE(X); + #if ENABLED(X_IS_TMC) + _TMC_DEFINE(X); #endif - #if AXIS_DRIVER_TYPE(X2, TMC26X) - _TMC26X_DEFINE(X2); + #if ENABLED(X2_IS_TMC) + _TMC_DEFINE(X2); #endif - #if AXIS_DRIVER_TYPE(Y, TMC26X) - _TMC26X_DEFINE(Y); + #if ENABLED(Y_IS_TMC) + _TMC_DEFINE(Y); #endif - #if AXIS_DRIVER_TYPE(Y2, TMC26X) - _TMC26X_DEFINE(Y2); + #if ENABLED(Y2_IS_TMC) + _TMC_DEFINE(Y2); #endif - #if AXIS_DRIVER_TYPE(Z, TMC26X) - _TMC26X_DEFINE(Z); + #if ENABLED(Z_IS_TMC) + _TMC_DEFINE(Z); #endif - #if AXIS_DRIVER_TYPE(Z2, TMC26X) - _TMC26X_DEFINE(Z2); + #if ENABLED(Z2_IS_TMC) + _TMC_DEFINE(Z2); #endif - #if AXIS_DRIVER_TYPE(E0, TMC26X) - _TMC26X_DEFINE(E0); + #if ENABLED(E0_IS_TMC) + _TMC_DEFINE(E0); #endif - #if AXIS_DRIVER_TYPE(E1, TMC26X) - _TMC26X_DEFINE(E1); + #if ENABLED(E1_IS_TMC) + _TMC_DEFINE(E1); #endif - #if AXIS_DRIVER_TYPE(E2, TMC26X) - _TMC26X_DEFINE(E2); + #if ENABLED(E2_IS_TMC) + _TMC_DEFINE(E2); #endif - #if AXIS_DRIVER_TYPE(E3, TMC26X) - _TMC26X_DEFINE(E3); + #if ENABLED(E3_IS_TMC) + _TMC_DEFINE(E3); #endif - #if AXIS_DRIVER_TYPE(E4, TMC26X) - _TMC26X_DEFINE(E4); + #if ENABLED(E4_IS_TMC) + _TMC_DEFINE(E4); #endif - #define _TMC26X_INIT(A) do{ \ + #define _TMC_INIT(A) do{ \ stepper##A.setMicrosteps(A##_MICROSTEPS); \ stepper##A.start(); \ }while(0) - void tmc26x_init_to_defaults() { - #if AXIS_DRIVER_TYPE(X, TMC26X) - _TMC26X_INIT(X); + void tmc_init() { + #if ENABLED(X_IS_TMC) + _TMC_INIT(X); #endif - #if AXIS_DRIVER_TYPE(X2, TMC26X) - _TMC26X_INIT(X2); + #if ENABLED(X2_IS_TMC) + _TMC_INIT(X2); #endif - #if AXIS_DRIVER_TYPE(Y, TMC26X) - _TMC26X_INIT(Y); + #if ENABLED(Y_IS_TMC) + _TMC_INIT(Y); #endif - #if AXIS_DRIVER_TYPE(Y2, TMC26X) - _TMC26X_INIT(Y2); + #if ENABLED(Y2_IS_TMC) + _TMC_INIT(Y2); #endif - #if AXIS_DRIVER_TYPE(Z, TMC26X) - _TMC26X_INIT(Z); + #if ENABLED(Z_IS_TMC) + _TMC_INIT(Z); #endif - #if AXIS_DRIVER_TYPE(Z2, TMC26X) - _TMC26X_INIT(Z2); + #if ENABLED(Z2_IS_TMC) + _TMC_INIT(Z2); #endif - #if AXIS_DRIVER_TYPE(E0, TMC26X) - _TMC26X_INIT(E0); + #if ENABLED(E0_IS_TMC) + _TMC_INIT(E0); #endif - #if AXIS_DRIVER_TYPE(E1, TMC26X) - _TMC26X_INIT(E1); + #if ENABLED(E1_IS_TMC) + _TMC_INIT(E1); #endif - #if AXIS_DRIVER_TYPE(E2, TMC26X) - _TMC26X_INIT(E2); + #if ENABLED(E2_IS_TMC) + _TMC_INIT(E2); #endif - #if AXIS_DRIVER_TYPE(E3, TMC26X) - _TMC26X_INIT(E3); + #if ENABLED(E3_IS_TMC) + _TMC_INIT(E3); #endif - #if AXIS_DRIVER_TYPE(E4, TMC26X) - _TMC26X_INIT(E4); + #if ENABLED(E4_IS_TMC) + _TMC_INIT(E4); #endif } -#endif // TMC26X + +#endif // HAVE_TMCDRIVER // // TMC2130 Driver objects and inits // -#if HAS_DRIVER(TMC2130) +#if ENABLED(HAVE_TMC2130) #include #include #include "planner.h" #include "enum.h" - #if TMC2130STEPPER_VERSION < 0x020201 - #error "Update TMC2130Stepper library to 2.2.1 or newer." - #endif - - #if ENABLED(TMC_USE_SW_SPI) - #define _TMC2130_DEFINE(ST) TMC2130Stepper stepper##ST(ST##_ENABLE_PIN, ST##_DIR_PIN, ST##_STEP_PIN, ST##_CS_PIN, TMC_SW_MOSI, TMC_SW_MISO, TMC_SW_SCK) - #else - #define _TMC2130_DEFINE(ST) TMC2130Stepper stepper##ST(ST##_ENABLE_PIN, ST##_DIR_PIN, ST##_STEP_PIN, ST##_CS_PIN) - #endif + #define _TMC2130_DEFINE(ST) TMC2130Stepper stepper##ST(ST##_ENABLE_PIN, ST##_DIR_PIN, ST##_STEP_PIN, ST##_CS_PIN) // Stepper objects of TMC2130 steppers used - #if AXIS_DRIVER_TYPE(X, TMC2130) + #if ENABLED(X_IS_TMC2130) _TMC2130_DEFINE(X); #endif - #if AXIS_DRIVER_TYPE(X2, TMC2130) + #if ENABLED(X2_IS_TMC2130) _TMC2130_DEFINE(X2); #endif - #if AXIS_DRIVER_TYPE(Y, TMC2130) + #if ENABLED(Y_IS_TMC2130) _TMC2130_DEFINE(Y); #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2130) + #if ENABLED(Y2_IS_TMC2130) _TMC2130_DEFINE(Y2); #endif - #if AXIS_DRIVER_TYPE(Z, TMC2130) + #if ENABLED(Z_IS_TMC2130) _TMC2130_DEFINE(Z); #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2130) + #if ENABLED(Z2_IS_TMC2130) _TMC2130_DEFINE(Z2); #endif - #if AXIS_DRIVER_TYPE(E0, TMC2130) + #if ENABLED(E0_IS_TMC2130) _TMC2130_DEFINE(E0); #endif - #if AXIS_DRIVER_TYPE(E1, TMC2130) + #if ENABLED(E1_IS_TMC2130) _TMC2130_DEFINE(E1); #endif - #if AXIS_DRIVER_TYPE(E2, TMC2130) + #if ENABLED(E2_IS_TMC2130) _TMC2130_DEFINE(E2); #endif - #if AXIS_DRIVER_TYPE(E3, TMC2130) + #if ENABLED(E3_IS_TMC2130) _TMC2130_DEFINE(E3); #endif - #if AXIS_DRIVER_TYPE(E4, TMC2130) + #if ENABLED(E4_IS_TMC2130) _TMC2130_DEFINE(E4); #endif // Use internal reference voltage for current calculations. This is the default. // Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609) // https://www.trinamic.com/products/integrated-circuits/details/tmc2130/ - void tmc2130_init(TMC2130Stepper &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const float spmm) { - #if DISABLED(STEALTHCHOP) || DISABLED(HYBRID_THRESHOLD) - UNUSED(thrs); - UNUSED(spmm); - #endif + void tmc2130_init(TMC2130Stepper &st, const uint16_t microsteps, const uint32_t thrs, const float spmm) { st.begin(); - st.setCurrent(mA, R_SENSE, HOLD_MULTIPLIER); + st.setCurrent(st.getCurrent(), R_SENSE, HOLD_MULTIPLIER); st.microsteps(microsteps); st.blank_time(24); st.off_time(5); // Only enables the driver if used with stealthChop st.interpolate(INTERPOLATE); st.power_down_delay(128); // ~2s until driver lowers to hold current - st.hysteresis_start(3); - st.hysteresis_end(2); + st.hysterisis_start(3); + st.hysterisis_end(2); + st.diag1_active_high(1); // For sensorless homing #if ENABLED(STEALTHCHOP) st.stealth_freq(1); // f_pwm = 2/683 f_clk st.stealth_autoscale(1); @@ -202,169 +191,143 @@ st.stealthChop(1); #if ENABLED(HYBRID_THRESHOLD) st.stealth_max_speed(12650000UL*microsteps/(256*thrs*spmm)); + #else + UNUSED(thrs); + UNUSED(spmm); #endif + #elif ENABLED(SENSORLESS_HOMING) + st.coolstep_min_speed(1024UL * 1024UL - 1UL); #endif st.GSTAT(); // Clear GSTAT } - #define _TMC2130_INIT(ST, SPMM) tmc2130_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM) + #define _TMC2130_INIT(ST, SPMM) tmc2130_init(stepper##ST, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM) - void tmc2130_init_to_defaults() { - #if AXIS_DRIVER_TYPE(X, TMC2130) + void tmc2130_init() { + #if ENABLED(X_IS_TMC2130) _TMC2130_INIT( X, planner.axis_steps_per_mm[X_AXIS]); #endif - #if AXIS_DRIVER_TYPE(X2, TMC2130) + #if ENABLED(X2_IS_TMC2130) _TMC2130_INIT(X2, planner.axis_steps_per_mm[X_AXIS]); #endif - #if AXIS_DRIVER_TYPE(Y, TMC2130) + #if ENABLED(Y_IS_TMC2130) _TMC2130_INIT( Y, planner.axis_steps_per_mm[Y_AXIS]); #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2130) + #if ENABLED(Y2_IS_TMC2130) _TMC2130_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]); #endif - #if AXIS_DRIVER_TYPE(Z, TMC2130) + #if ENABLED(Z_IS_TMC2130) _TMC2130_INIT( Z, planner.axis_steps_per_mm[Z_AXIS]); #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2130) + #if ENABLED(Z2_IS_TMC2130) _TMC2130_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]); #endif - #if AXIS_DRIVER_TYPE(E0, TMC2130) + #if ENABLED(E0_IS_TMC2130) _TMC2130_INIT(E0, planner.axis_steps_per_mm[E_AXIS]); #endif - #if AXIS_DRIVER_TYPE(E1, TMC2130) + #if ENABLED(E1_IS_TMC2130) { constexpr int extruder = 1; _TMC2130_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); } #endif - #if AXIS_DRIVER_TYPE(E2, TMC2130) + #if ENABLED(E2_IS_TMC2130) { constexpr int extruder = 2; _TMC2130_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); } #endif - #if AXIS_DRIVER_TYPE(E3, TMC2130) + #if ENABLED(E3_IS_TMC2130) { constexpr int extruder = 3; _TMC2130_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); } #endif - #if AXIS_DRIVER_TYPE(E4, TMC2130) + #if ENABLED(E4_IS_TMC2130) { constexpr int extruder = 4; _TMC2130_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); } #endif - #if ENABLED(SENSORLESS_HOMING) - #define TMC_INIT_SGT(P,Q) stepper##Q.sgt(P##_HOMING_SENSITIVITY); - #if X_SENSORLESS - #if AXIS_DRIVER_TYPE(X, TMC2130) - stepperX.sgt(X_HOMING_SENSITIVITY); - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2130) - stepperX2.sgt(X_HOMING_SENSITIVITY); - #endif - #endif - #if Y_SENSORLESS - #if AXIS_DRIVER_TYPE(Y, TMC2130) - stepperY.sgt(Y_HOMING_SENSITIVITY); - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2130) - stepperY2.sgt(Y_HOMING_SENSITIVITY); - #endif - #endif - #if Z_SENSORLESS - #if AXIS_DRIVER_TYPE(Z, TMC2130) - stepperZ.sgt(Z_HOMING_SENSITIVITY); - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2130) - stepperZ2.sgt(Z_HOMING_SENSITIVITY); - #endif - #endif - #endif } -#endif // TMC2130 +#endif // HAVE_TMC2130 // // TMC2208 Driver objects and inits // -#if HAS_DRIVER(TMC2208) +#if ENABLED(HAVE_TMC2208) - #undef HardwareSerial_h // undo Marlin trickery #include #include #include #include "planner.h" - #if TMC2208STEPPER_VERSION < 0x000101 - #error "Update TMC2208Stepper library to 0.1.1 or newer." - #endif - #define _TMC2208_DEFINE_HARDWARE(ST) TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL) - #define _TMC2208_DEFINE_SOFTWARE(ST) TMC2208Stepper stepper##ST(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN, ST##_SERIAL_RX_PIN > -1) + #define _TMC2208_DEFINE_SOFTWARE(ST) SoftwareSerial stepper##ST##_serial = SoftwareSerial(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN); \ + TMC2208Stepper stepper##ST(&stepper##ST##_serial, ST##_SERIAL_RX_PIN > -1) // Stepper objects of TMC2208 steppers used - #if AXIS_DRIVER_TYPE(X, TMC2208) - #ifdef X_HARDWARE_SERIAL + #if ENABLED(X_IS_TMC2208) + #if defined(X_HARDWARE_SERIAL) _TMC2208_DEFINE_HARDWARE(X); #else _TMC2208_DEFINE_SOFTWARE(X); #endif #endif - #if AXIS_DRIVER_TYPE(X2, TMC2208) - #ifdef X2_HARDWARE_SERIAL + #if ENABLED(X2_IS_TMC2208) + #if defined(X2_HARDWARE_SERIAL) _TMC2208_DEFINE_HARDWARE(X2); #else _TMC2208_DEFINE_SOFTWARE(X2); #endif #endif - #if AXIS_DRIVER_TYPE(Y, TMC2208) - #ifdef Y_HARDWARE_SERIAL + #if ENABLED(Y_IS_TMC2208) + #if defined(Y_HARDWARE_SERIAL) _TMC2208_DEFINE_HARDWARE(Y); #else _TMC2208_DEFINE_SOFTWARE(Y); #endif #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2208) - #ifdef Y2_HARDWARE_SERIAL + #if ENABLED(Y2_IS_TMC2208) + #if defined(Y2_HARDWARE_SERIAL) _TMC2208_DEFINE_HARDWARE(Y2); #else _TMC2208_DEFINE_SOFTWARE(Y2); #endif #endif - #if AXIS_DRIVER_TYPE(Z, TMC2208) - #ifdef Z_HARDWARE_SERIAL + #if ENABLED(Z_IS_TMC2208) + #if defined(Z_HARDWARE_SERIAL) _TMC2208_DEFINE_HARDWARE(Z); #else _TMC2208_DEFINE_SOFTWARE(Z); #endif #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2208) - #ifdef Z2_HARDWARE_SERIAL + #if ENABLED(Z2_IS_TMC2208) + #if defined(Z2_HARDWARE_SERIAL) _TMC2208_DEFINE_HARDWARE(Z2); #else _TMC2208_DEFINE_SOFTWARE(Z2); #endif #endif - #if AXIS_DRIVER_TYPE(E0, TMC2208) - #ifdef E0_HARDWARE_SERIAL + #if ENABLED(E0_IS_TMC2208) + #if defined(E0_HARDWARE_SERIAL) _TMC2208_DEFINE_HARDWARE(E0); #else _TMC2208_DEFINE_SOFTWARE(E0); #endif #endif - #if AXIS_DRIVER_TYPE(E1, TMC2208) - #ifdef E1_HARDWARE_SERIAL + #if ENABLED(E1_IS_TMC2208) + #if defined(E1_HARDWARE_SERIAL) _TMC2208_DEFINE_HARDWARE(E1); #else _TMC2208_DEFINE_SOFTWARE(E1); #endif #endif - #if AXIS_DRIVER_TYPE(E2, TMC2208) - #ifdef E2_HARDWARE_SERIAL + #if ENABLED(E2_IS_TMC2208) + #if defined(E2_HARDWARE_SERIAL) _TMC2208_DEFINE_HARDWARE(E2); #else _TMC2208_DEFINE_SOFTWARE(E2); #endif #endif - #if AXIS_DRIVER_TYPE(E3, TMC2208) - #ifdef E3_HARDWARE_SERIAL + #if ENABLED(E3_IS_TMC2208) + #if defined(E3_HARDWARE_SERIAL) _TMC2208_DEFINE_HARDWARE(E3); #else _TMC2208_DEFINE_SOFTWARE(E3); #endif #endif - #if AXIS_DRIVER_TYPE(E4, TMC2208) - #ifdef E4_HARDWARE_SERIAL + #if ENABLED(E4_IS_TMC2208) + #if defined(E4_HARDWARE_SERIAL) _TMC2208_DEFINE_HARDWARE(E4); #else _TMC2208_DEFINE_SOFTWARE(E4); @@ -372,99 +335,55 @@ #endif void tmc2208_serial_begin() { - #if AXIS_DRIVER_TYPE(X, TMC2208) - #ifdef X_HARDWARE_SERIAL - X_HARDWARE_SERIAL.begin(115200); - #else - stepperX.beginSerial(115200); - #endif + #if ENABLED(X_IS_TMC2208) && defined(X_HARDWARE_SERIAL) + X_HARDWARE_SERIAL.begin(250000); #endif - #if AXIS_DRIVER_TYPE(X2, TMC2208) - #ifdef X2_HARDWARE_SERIAL - X2_HARDWARE_SERIAL.begin(115200); - #else - stepperX2.beginSerial(115200); - #endif + #if ENABLED(X2_IS_TMC2208) && defined(X2_HARDWARE_SERIAL) + X2_HARDWARE_SERIAL.begin(250000); #endif - #if AXIS_DRIVER_TYPE(Y, TMC2208) - #ifdef Y_HARDWARE_SERIAL - Y_HARDWARE_SERIAL.begin(115200); - #else - stepperY.beginSerial(115200); - #endif + #if ENABLED(Y_IS_TMC2208) && defined(Y_HARDWARE_SERIAL) + Y_HARDWARE_SERIAL.begin(250000); #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2208) - #ifdef Y2_HARDWARE_SERIAL - Y2_HARDWARE_SERIAL.begin(115200); - #else - stepperY2.beginSerial(115200); - #endif + #if ENABLED(Y2_IS_TMC2208) && defined(Y2_HARDWARE_SERIAL) + Y2_HARDWARE_SERIAL.begin(250000); #endif - #if AXIS_DRIVER_TYPE(Z, TMC2208) - #ifdef Z_HARDWARE_SERIAL - Z_HARDWARE_SERIAL.begin(115200); - #else - stepperZ.beginSerial(115200); - #endif + #if ENABLED(Z_IS_TMC2208) && defined(Z_HARDWARE_SERIAL) + Z_HARDWARE_SERIAL.begin(250000); #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2208) - #ifdef Z2_HARDWARE_SERIAL - Z2_HARDWARE_SERIAL.begin(115200); - #else - stepperZ2.beginSerial(115200); - #endif + #if ENABLED(Z2_IS_TMC2208) && defined(Z2_HARDWARE_SERIAL) + Z2_HARDWARE_SERIAL.begin(250000); #endif - #if AXIS_DRIVER_TYPE(E0, TMC2208) - #ifdef E0_HARDWARE_SERIAL - E0_HARDWARE_SERIAL.begin(115200); - #else - stepperE0.beginSerial(115200); - #endif + #if ENABLED(E0_IS_TMC2208) && defined(E0_HARDWARE_SERIAL) + E0_HARDWARE_SERIAL.begin(250000); #endif - #if AXIS_DRIVER_TYPE(E1, TMC2208) - #ifdef E1_HARDWARE_SERIAL - E1_HARDWARE_SERIAL.begin(115200); - #else - stepperE1.beginSerial(115200); - #endif + #if ENABLED(E1_IS_TMC2208) && defined(E1_HARDWARE_SERIAL) + E1_HARDWARE_SERIAL.begin(250000); #endif - #if AXIS_DRIVER_TYPE(E2, TMC2208) - #ifdef E2_HARDWARE_SERIAL - E2_HARDWARE_SERIAL.begin(115200); - #else - stepperE2.beginSerial(115200); - #endif + #if ENABLED(E2_IS_TMC2208) && defined(E2_HARDWARE_SERIAL) + E2_HARDWARE_SERIAL.begin(250000); #endif - #if AXIS_DRIVER_TYPE(E3, TMC2208) - #ifdef E3_HARDWARE_SERIAL - E3_HARDWARE_SERIAL.begin(115200); - #else - stepperE3.beginSerial(115200); - #endif + #if ENABLED(E3_IS_TMC2208) && defined(E3_HARDWARE_SERIAL) + E3_HARDWARE_SERIAL.begin(250000); #endif - #if AXIS_DRIVER_TYPE(E4, TMC2208) - #ifdef E4_HARDWARE_SERIAL - E4_HARDWARE_SERIAL.begin(115200); - #else - stepperE4.beginSerial(115200); - #endif + #if ENABLED(E4_IS_TMC2208) && defined(E4_HARDWARE_SERIAL) + E4_HARDWARE_SERIAL.begin(250000); #endif } // Use internal reference voltage for current calculations. This is the default. // Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609) - void tmc2208_init(TMC2208Stepper &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const float spmm) { + void tmc2208_init(TMC2208Stepper &st, const uint16_t microsteps, const uint32_t thrs, const float spmm) { st.pdn_disable(true); // Use UART st.mstep_reg_select(true); // Select microsteps with UART st.I_scale_analog(false); - st.rms_current(mA, HOLD_MULTIPLIER, R_SENSE); + st.rms_current(st.getCurrent(), HOLD_MULTIPLIER, R_SENSE); st.microsteps(microsteps); st.blank_time(24); st.toff(5); st.intpol(INTERPOLATE); st.TPOWERDOWN(128); // ~2s until driver lowers to hold current - st.hysteresis_start(3); - st.hysteresis_end(2); + st.hysterisis_start(3); + st.hysterisis_end(2); #if ENABLED(STEALTHCHOP) st.pwm_lim(12); st.pwm_reg(8); @@ -487,106 +406,49 @@ delay(200); } - #define _TMC2208_INIT(ST, SPMM) tmc2208_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM) + #define _TMC2208_INIT(ST, SPMM) tmc2208_init(stepper##ST, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM) - void tmc2208_init_to_defaults() { - #if AXIS_DRIVER_TYPE(X, TMC2208) + void tmc2208_init() { + #if ENABLED(X_IS_TMC2208) _TMC2208_INIT(X, planner.axis_steps_per_mm[X_AXIS]); #endif - #if AXIS_DRIVER_TYPE(X2, TMC2208) + #if ENABLED(X2_IS_TMC2208) _TMC2208_INIT(X2, planner.axis_steps_per_mm[X_AXIS]); #endif - #if AXIS_DRIVER_TYPE(Y, TMC2208) + #if ENABLED(Y_IS_TMC2208) _TMC2208_INIT(Y, planner.axis_steps_per_mm[Y_AXIS]); #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2208) + #if ENABLED(Y2_IS_TMC2208) _TMC2208_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]); #endif - #if AXIS_DRIVER_TYPE(Z, TMC2208) + #if ENABLED(Z_IS_TMC2208) _TMC2208_INIT(Z, planner.axis_steps_per_mm[Z_AXIS]); #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2208) + #if ENABLED(Z2_IS_TMC2208) _TMC2208_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]); #endif - #if AXIS_DRIVER_TYPE(E0, TMC2208) + #if ENABLED(E0_IS_TMC2208) _TMC2208_INIT(E0, planner.axis_steps_per_mm[E_AXIS]); #endif - #if AXIS_DRIVER_TYPE(E1, TMC2208) + #if ENABLED(E1_IS_TMC2208) { constexpr int extruder = 1; _TMC2208_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); } #endif - #if AXIS_DRIVER_TYPE(E2, TMC2208) + #if ENABLED(E2_IS_TMC2208) { constexpr int extruder = 2; _TMC2208_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); } #endif - #if AXIS_DRIVER_TYPE(E3, TMC2208) + #if ENABLED(E3_IS_TMC2208) { constexpr int extruder = 3; _TMC2208_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); } #endif - #if AXIS_DRIVER_TYPE(E4, TMC2208) + #if ENABLED(E4_IS_TMC2208) { constexpr int extruder = 4; _TMC2208_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); } #endif } -#endif // TMC2208 - -void restore_stepper_drivers() { - #if AXIS_IS_TMC(X) - stepperX.push(); - #endif - #if AXIS_IS_TMC(X2) - stepperX2.push(); - #endif - #if AXIS_IS_TMC(Y) - stepperY.push(); - #endif - #if AXIS_IS_TMC(Y2) - stepperY2.push(); - #endif - #if AXIS_IS_TMC(Z) - stepperZ.push(); - #endif - #if AXIS_IS_TMC(Z2) - stepperZ2.push(); - #endif - #if AXIS_IS_TMC(E0) - stepperE0.push(); - #endif - #if AXIS_IS_TMC(E1) - stepperE1.push(); - #endif - #if AXIS_IS_TMC(E2) - stepperE2.push(); - #endif - #if AXIS_IS_TMC(E3) - stepperE3.push(); - #endif - #if AXIS_IS_TMC(E4) - stepperE4.push(); - #endif -} - -void reset_stepper_drivers() { - #if HAS_DRIVER(TMC26X) - tmc26x_init_to_defaults(); - #endif - #if HAS_DRIVER(TMC2130) - delay(100); - tmc2130_init_to_defaults(); - #endif - #if HAS_DRIVER(TMC2208) - delay(100); - tmc2208_init_to_defaults(); - #endif - #ifdef TMC_ADV - TMC_ADV() - #endif - #if HAS_DRIVER(L6470) - L6470_init_to_defaults(); - #endif - stepper.set_directions(); -} +#endif // HAVE_TMC2208 // // L6470 Driver objects and inits // -#if HAS_DRIVER(L6470) +#if ENABLED(HAVE_L6470DRIVER) #include #include @@ -594,82 +456,83 @@ void reset_stepper_drivers() { #define _L6470_DEFINE(ST) L6470 stepper##ST(ST##_ENABLE_PIN) // L6470 Stepper objects - #if AXIS_DRIVER_TYPE(X, L6470) + #if ENABLED(X_IS_L6470) _L6470_DEFINE(X); #endif - #if AXIS_DRIVER_TYPE(X2, L6470) + #if ENABLED(X2_IS_L6470) _L6470_DEFINE(X2); #endif - #if AXIS_DRIVER_TYPE(Y, L6470) + #if ENABLED(Y_IS_L6470) _L6470_DEFINE(Y); #endif - #if AXIS_DRIVER_TYPE(Y2, L6470) + #if ENABLED(Y2_IS_L6470) _L6470_DEFINE(Y2); #endif - #if AXIS_DRIVER_TYPE(Z, L6470) + #if ENABLED(Z_IS_L6470) _L6470_DEFINE(Z); #endif - #if AXIS_DRIVER_TYPE(Z2, L6470) + #if ENABLED(Z2_IS_L6470) _L6470_DEFINE(Z2); #endif - #if AXIS_DRIVER_TYPE(E0, L6470) + #if ENABLED(E0_IS_L6470) _L6470_DEFINE(E0); #endif - #if AXIS_DRIVER_TYPE(E1, L6470) + #if ENABLED(E1_IS_L6470) _L6470_DEFINE(E1); #endif - #if AXIS_DRIVER_TYPE(E2, L6470) + #if ENABLED(E2_IS_L6470) _L6470_DEFINE(E2); #endif - #if AXIS_DRIVER_TYPE(E3, L6470) + #if ENABLED(E3_IS_L6470) _L6470_DEFINE(E3); #endif - #if AXIS_DRIVER_TYPE(E4, L6470) + #if ENABLED(E4_IS_L6470) _L6470_DEFINE(E4); #endif #define _L6470_INIT(A) do{ \ - stepper##A.init(); \ + stepper##A.init(A##_K_VAL); \ stepper##A.softFree(); \ stepper##A.setMicroSteps(A##_MICROSTEPS); \ stepper##A.setOverCurrent(A##_OVERCURRENT); \ stepper##A.setStallCurrent(A##_STALLCURRENT); \ }while(0) - void L6470_init_to_defaults() { - #if AXIS_DRIVER_TYPE(X, L6470) + void L6470_init() { + #if ENABLED(X_IS_L6470) _L6470_INIT(X); #endif - #if AXIS_DRIVER_TYPE(X2, L6470) + #if ENABLED(X2_IS_L6470) _L6470_INIT(X2); #endif - #if AXIS_DRIVER_TYPE(Y, L6470) + #if ENABLED(Y_IS_L6470) _L6470_INIT(Y); #endif - #if AXIS_DRIVER_TYPE(Y2, L6470) + #if ENABLED(Y2_IS_L6470) _L6470_INIT(Y2); #endif - #if AXIS_DRIVER_TYPE(Z, L6470) + #if ENABLED(Z_IS_L6470) _L6470_INIT(Z); #endif - #if AXIS_DRIVER_TYPE(Z2, L6470) + #if ENABLED(Z2_IS_L6470) _L6470_INIT(Z2); #endif - #if AXIS_DRIVER_TYPE(E0, L6470) + #if ENABLED(E0_IS_L6470) _L6470_INIT(E0); #endif - #if AXIS_DRIVER_TYPE(E1, L6470) + #if ENABLED(E1_IS_L6470) _L6470_INIT(E1); #endif - #if AXIS_DRIVER_TYPE(E2, L6470) + #if ENABLED(E2_IS_L6470) _L6470_INIT(E2); #endif - #if AXIS_DRIVER_TYPE(E3, L6470) + #if ENABLED(E3_IS_L6470) _L6470_INIT(E3); #endif - #if AXIS_DRIVER_TYPE(E4, L6470) + #if ENABLED(E4_IS_L6470) _L6470_INIT(E4); #endif } -#endif // L6470 +#endif // HAVE_L6470DRIVER + diff --git a/Marlin/stepper_indirection.h b/Marlin/stepper_indirection.h index 54a17c5..f24936d 100644 --- a/Marlin/stepper_indirection.h +++ b/Marlin/stepper_indirection.h @@ -21,25 +21,25 @@ */ /** - * stepper_indirection.h - stepper motor driver indirection macros - * to allow some stepper functions to be done via SPI/I2c instead of direct pin manipulation - * Part of Marlin - * - * Copyright (c) 2015 Dominik Wenger - * - * Marlin 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. - * - * Marlin 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 Marlin. If not, see . - */ + stepper_indirection.h - stepper motor driver indirection macros + to allow some stepper functions to be done via SPI/I2c instead of direct pin manipulation + Part of Marlin + + Copyright (c) 2015 Dominik Wenger + + Marlin 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. + + Marlin 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 Marlin. If not, see . +*/ #ifndef STEPPER_INDIRECTION_H #define STEPPER_INDIRECTION_H @@ -47,52 +47,49 @@ #include "MarlinConfig.h" // TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI -#if HAS_DRIVER(TMC26X) +#if ENABLED(HAVE_TMCDRIVER) #include #include - void tmc26x_init_to_defaults(); + void tmc_init(); #endif -#if HAS_DRIVER(TMC2130) +#if ENABLED(HAVE_TMC2130) #include - void tmc2130_init_to_defaults(); + void tmc2130_init(); #endif -#if HAS_DRIVER(TMC2208) +#if ENABLED(HAVE_TMC2208) #include void tmc2208_serial_begin(); - void tmc2208_init_to_defaults(); + void tmc2208_init(); #endif // L6470 has STEP on normal pins, but DIR/ENABLE via SPI -#if HAS_DRIVER(L6470) +#if ENABLED(HAVE_L6470DRIVER) #include #include - void L6470_init_to_defaults(); + void L6470_init(); #endif -void restore_stepper_drivers(); // Called by PSU_ON -void reset_stepper_drivers(); // Called by settings.load / settings.reset - // X Stepper -#if AXIS_DRIVER_TYPE(X, L6470) +#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_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 AXIS_DRIVER_TYPE(X, TMC26X) + #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 - #if AXIS_DRIVER_TYPE(X, TMC2130) + #if ENABLED(HAVE_TMC2130) && ENABLED(X_IS_TMC2130) extern TMC2130Stepper stepperX; - #elif AXIS_DRIVER_TYPE(X, TMC2208) + #elif ENABLED(HAVE_TMC2208) && ENABLED(X_IS_TMC2208) extern TMC2208Stepper stepperX; #endif #define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN) @@ -108,24 +105,24 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define X_STEP_READ READ(X_STEP_PIN) // Y Stepper -#if AXIS_DRIVER_TYPE(Y, L6470) +#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_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 AXIS_DRIVER_TYPE(Y, TMC26X) + #if ENABLED(HAVE_TMCDRIVER) && ENABLED(Y_IS_TMC) extern TMC26XStepper stepperY; #define Y_ENABLE_INIT NOOP #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE) #define Y_ENABLE_READ stepperY.isEnabled() #else - #if AXIS_DRIVER_TYPE(Y, TMC2130) + #if ENABLED(HAVE_TMC2130) && ENABLED(Y_IS_TMC2130) extern TMC2130Stepper stepperY; - #elif AXIS_DRIVER_TYPE(Y, TMC2208) + #elif ENABLED(HAVE_TMC2208) && ENABLED(Y_IS_TMC2208) extern TMC2208Stepper stepperY; #endif #define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN) @@ -141,24 +138,24 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define Y_STEP_READ READ(Y_STEP_PIN) // Z Stepper -#if AXIS_DRIVER_TYPE(Z, L6470) +#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_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 AXIS_DRIVER_TYPE(Z, TMC26X) + #if ENABLED(HAVE_TMCDRIVER) && ENABLED(Z_IS_TMC) extern TMC26XStepper stepperZ; #define Z_ENABLE_INIT NOOP #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE) #define Z_ENABLE_READ stepperZ.isEnabled() #else - #if AXIS_DRIVER_TYPE(Z, TMC2130) + #if ENABLED(HAVE_TMC2130) && ENABLED(Z_IS_TMC2130) extern TMC2130Stepper stepperZ; - #elif AXIS_DRIVER_TYPE(Z, TMC2208) + #elif ENABLED(HAVE_TMC2208) && ENABLED(Z_IS_TMC2208) extern TMC2208Stepper stepperZ; #endif #define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN) @@ -175,24 +172,24 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset // X2 Stepper #if HAS_X2_ENABLE - #if AXIS_DRIVER_TYPE(X2, L6470) + #if ENABLED(HAVE_L6470DRIVER) && ENABLED(X2_IS_L6470) extern L6470 stepperX2; #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_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) #define X2_DIR_INIT NOOP #define X2_DIR_WRITE(STATE) stepperX2.Step_Clock(STATE) #define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR) #else - #if AXIS_DRIVER_TYPE(X2, TMC26X) + #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 - #if AXIS_DRIVER_TYPE(X2, TMC2130) + #if ENABLED(HAVE_TMC2130) && ENABLED(X2_IS_TMC2130) extern TMC2130Stepper stepperX2; - #elif AXIS_DRIVER_TYPE(X2, TMC2208) + #elif ENABLED(HAVE_TMC2208) && ENABLED(X2_IS_TMC2208) extern TMC2208Stepper stepperX2; #endif #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN) @@ -210,24 +207,24 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset // Y2 Stepper #if HAS_Y2_ENABLE - #if AXIS_DRIVER_TYPE(Y2, L6470) + #if ENABLED(HAVE_L6470DRIVER) && ENABLED(Y2_IS_L6470) extern L6470 stepperY2; #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_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) #define Y2_DIR_INIT NOOP #define Y2_DIR_WRITE(STATE) stepperY2.Step_Clock(STATE) #define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR) #else - #if AXIS_DRIVER_TYPE(Y2, TMC26X) + #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 - #if AXIS_DRIVER_TYPE(Y2, TMC2130) + #if ENABLED(HAVE_TMC2130) && ENABLED(Y2_IS_TMC2130) extern TMC2130Stepper stepperY2; - #elif AXIS_DRIVER_TYPE(Y2, TMC2208) + #elif ENABLED(HAVE_TMC2208) && ENABLED(Y2_IS_TMC2208) extern TMC2208Stepper stepperY2; #endif #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN) @@ -245,24 +242,24 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset // Z2 Stepper #if HAS_Z2_ENABLE - #if AXIS_DRIVER_TYPE(Z2, L6470) + #if ENABLED(HAVE_L6470DRIVER) && ENABLED(Z2_IS_L6470) extern L6470 stepperZ2; #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_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) #define Z2_DIR_INIT NOOP #define Z2_DIR_WRITE(STATE) stepperZ2.Step_Clock(STATE) #define Z2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR) #else - #if AXIS_DRIVER_TYPE(Z2, TMC26X) + #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 - #if AXIS_DRIVER_TYPE(Z2, TMC2130) + #if ENABLED(HAVE_TMC2130) && ENABLED(Z2_IS_TMC2130) extern TMC2130Stepper stepperZ2; - #elif AXIS_DRIVER_TYPE(Z2, TMC2208) + #elif ENABLED(HAVE_TMC2208) && ENABLED(Z2_IS_TMC2208) extern TMC2208Stepper stepperZ2; #endif #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN) @@ -279,24 +276,24 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #endif // E0 Stepper -#if AXIS_DRIVER_TYPE(E0, L6470) +#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_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 AXIS_DRIVER_TYPE(E0, TMC26X) + #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 - #if AXIS_DRIVER_TYPE(E0, TMC2130) + #if ENABLED(HAVE_TMC2130) && ENABLED(E0_IS_TMC2130) extern TMC2130Stepper stepperE0; - #elif AXIS_DRIVER_TYPE(E0, TMC2208) + #elif ENABLED(HAVE_TMC2208) && ENABLED(E0_IS_TMC2208) extern TMC2208Stepper stepperE0; #endif #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN) @@ -312,24 +309,24 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E0_STEP_READ READ(E0_STEP_PIN) // E1 Stepper -#if AXIS_DRIVER_TYPE(E1, L6470) +#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_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 AXIS_DRIVER_TYPE(E1, TMC26X) + #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 - #if AXIS_DRIVER_TYPE(E1, TMC2130) + #if ENABLED(HAVE_TMC2130) && ENABLED(E1_IS_TMC2130) extern TMC2130Stepper stepperE1; - #elif AXIS_DRIVER_TYPE(E1, TMC2208) + #elif ENABLED(HAVE_TMC2208) && ENABLED(E1_IS_TMC2208) extern TMC2208Stepper stepperE1; #endif #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN) @@ -345,24 +342,24 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E1_STEP_READ READ(E1_STEP_PIN) // E2 Stepper -#if AXIS_DRIVER_TYPE(E2, L6470) +#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_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 AXIS_DRIVER_TYPE(E2, TMC26X) + #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 - #if AXIS_DRIVER_TYPE(E2, TMC2130) + #if ENABLED(HAVE_TMC2130) && ENABLED(E2_IS_TMC2130) extern TMC2130Stepper stepperE2; - #elif AXIS_DRIVER_TYPE(E2, TMC2208) + #elif ENABLED(HAVE_TMC2208) && ENABLED(E2_IS_TMC2208) extern TMC2208Stepper stepperE2; #endif #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN) @@ -378,24 +375,24 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E2_STEP_READ READ(E2_STEP_PIN) // E3 Stepper -#if AXIS_DRIVER_TYPE(E3, L6470) +#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_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 AXIS_DRIVER_TYPE(E3, TMC26X) + #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 - #if AXIS_DRIVER_TYPE(E3, TMC2130) + #if ENABLED(HAVE_TMC2130) && ENABLED(E3_IS_TMC2130) extern TMC2130Stepper stepperE3; - #elif AXIS_DRIVER_TYPE(E3, TMC2208) + #elif ENABLED(HAVE_TMC2208) && ENABLED(E3_IS_TMC2208) extern TMC2208Stepper stepperE3; #endif #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN) @@ -411,7 +408,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E3_STEP_READ READ(E3_STEP_PIN) // E4 Stepper -#if AXIS_DRIVER_TYPE(E4, L6470) +#if ENABLED(HAVE_L6470DRIVER) && ENABLED(E4_IS_L6470) extern L6470 stepperE4; #define E4_ENABLE_INIT NOOP #define E4_ENABLE_WRITE(STATE) do{ if (STATE) stepperE4.Step_Clock(stepperE4.getStatus() & STATUS_HIZ); else stepperE4.softFree(); }while(0) @@ -420,15 +417,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E4_DIR_WRITE(STATE) stepperE4.Step_Clock(STATE) #define E4_DIR_READ (stepperE4.getStatus() & STATUS_DIR) #else - #if AXIS_DRIVER_TYPE(E4, TMC26X) + #if ENABLED(HAVE_TMCDRIVER) && ENABLED(E4_IS_TMC) extern TMC26XStepper stepperE4; #define E4_ENABLE_INIT NOOP #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE) #define E4_ENABLE_READ stepperE4.isEnabled() #else - #if AXIS_DRIVER_TYPE(E4, TMC2130) + #if ENABLED(HAVE_TMC2130) && ENABLED(E4_IS_TMC2130) extern TMC2130Stepper stepperE4; - #elif AXIS_DRIVER_TYPE(E4, TMC2208) + #elif ENABLED(HAVE_TMC2208) && ENABLED(E4_IS_TMC2208) extern TMC2208Stepper stepperE4; #endif #define E4_ENABLE_INIT SET_OUTPUT(E4_ENABLE_PIN) @@ -446,54 +443,69 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset /** * Extruder indirection for the single E axis */ -#if ENABLED(SWITCHING_EXTRUDER) // One stepper driver per two extruders, reversed on odd index - #if EXTRUDERS > 4 - #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else { E2_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; case 4: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 4: E2_DIR_WRITE( INVERT_E2_DIR); } }while(0) - #elif EXTRUDERS > 3 - #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) +#if ENABLED(SWITCHING_EXTRUDER) + #if EXTRUDERS == 2 + #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 > 4 + #define E_STEP_WRITE(v) { if (current_block->active_extruder < 2) E0_STEP_WRITE(v); else if (current_block->active_extruder < 4) E1_STEP_WRITE(v); else E2_STEP_WRITE(v); } + #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(INVERT_E1_DIR); break; case 4: 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: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 4: E2_DIR_WRITE(INVERT_E2_DIR); } } #elif EXTRUDERS > 2 - #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) - #else - #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) - #define NORM_E_DIR(E) do{ E0_DIR_WRITE(E ? INVERT_E0_DIR : !INVERT_E0_DIR); }while(0) - #define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? !INVERT_E0_DIR : INVERT_E0_DIR); }while(0) + #define E_STEP_WRITE(v) { if (current_block->active_extruder < 2) E0_STEP_WRITE(v); else if (current_block->active_extruder < 4) E1_STEP_WRITE(v); else E1_STEP_WRITE(v); } + #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(INVERT_E1_DIR); } } + #define REV_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); } } #endif -#elif ENABLED(MK2_MULTIPLEXER) // One multiplexed stepper driver, reversed on odd index - #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) - #define NORM_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR); }while(0) - #define REV_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR); }while(0) -#elif E_STEPPERS > 4 - #define E_STEP_WRITE(E,V) do{ switch (E) { 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); break; case 4: E4_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { 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); break; case 4: E4_DIR_WRITE(!INVERT_E4_DIR); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { 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); break; case 4: E4_DIR_WRITE( INVERT_E4_DIR); } }while(0) -#elif E_STEPPERS > 3 - #define E_STEP_WRITE(E,V) do{ switch (E) { 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); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { 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); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { 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); } }while(0) -#elif E_STEPPERS > 2 - #define E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { 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); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { 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); } }while(0) -#elif E_STEPPERS > 1 +#elif ENABLED(MK2_MULTIPLEXER) // Even-numbered steppers are reversed + #define E_STEP_WRITE(v) E0_STEP_WRITE(v) + #define NORM_E_DIR() E0_DIR_WRITE(TEST(current_block->active_extruder, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR) + #define REV_E_DIR() E0_DIR_WRITE(TEST(current_block->active_extruder, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR) +#elif EXTRUDERS > 4 + #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); break; case 4: E4_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); break; case 4: E4_DIR_WRITE(!INVERT_E4_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); break; case 4: E4_DIR_WRITE(INVERT_E4_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(E,V) do{ if (extruder_duplication_enabled) { E0_STEP_WRITE(V); E1_STEP_WRITE(V); } else if (E == 0) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } else if (E == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) - #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); } else if (E == 0) { E0_DIR_WRITE( INVERT_E0_DIR); } else { E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) + #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(E,V) do{ if (E == 0) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) - #define REV_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE( INVERT_E0_DIR); } else { E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) + #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 > 4 + #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); break; case 4: E4_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); E4_DIR_WRITE(!INVERT_E4_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); E4_DIR_WRITE( INVERT_E4_DIR); } + #elif 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(E,V) E0_STEP_WRITE(V) - #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR) - #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR) + #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 e5bc015..5958000 100644 --- a/Marlin/stopwatch.cpp +++ b/Marlin/stopwatch.cpp @@ -20,23 +20,21 @@ * */ +#include "Marlin.h" #include "stopwatch.h" -#include "Marlin.h" - -Stopwatch::State Stopwatch::state; -millis_t Stopwatch::accumulator; -millis_t Stopwatch::startTimestamp; -millis_t Stopwatch::stopTimestamp; +Stopwatch::Stopwatch() { + this->reset(); +} bool Stopwatch::stop() { #if ENABLED(DEBUG_STOPWATCH) Stopwatch::debug(PSTR("stop")); #endif - if (isRunning() || isPaused()) { - state = STOPPED; - stopTimestamp = millis(); + if (this->isRunning() || this->isPaused()) { + this->state = STOPPED; + this->stopTimestamp = millis(); return true; } else return false; @@ -47,9 +45,9 @@ bool Stopwatch::pause() { Stopwatch::debug(PSTR("pause")); #endif - if (isRunning()) { - state = PAUSED; - stopTimestamp = millis(); + if (this->isRunning()) { + this->state = PAUSED; + this->stopTimestamp = millis(); return true; } else return false; @@ -60,40 +58,39 @@ bool Stopwatch::start() { Stopwatch::debug(PSTR("start")); #endif - if (!isRunning()) { - if (isPaused()) accumulator = duration(); - else reset(); + if (!this->isRunning()) { + if (this->isPaused()) this->accumulator = this->duration(); + else this->reset(); - state = RUNNING; - startTimestamp = millis(); + this->state = RUNNING; + this->startTimestamp = millis(); return true; } else return false; } -void Stopwatch::resume(const millis_t duration) { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("resume")); - #endif - - reset(); - if ((accumulator = duration)) state = RUNNING; -} - void Stopwatch::reset() { #if ENABLED(DEBUG_STOPWATCH) Stopwatch::debug(PSTR("reset")); #endif - state = STOPPED; - startTimestamp = 0; - stopTimestamp = 0; - accumulator = 0; + this->state = STOPPED; + this->startTimestamp = 0; + this->stopTimestamp = 0; + this->accumulator = 0; +} + +bool Stopwatch::isRunning() { + return (this->state == RUNNING) ? true : false; +} + +bool Stopwatch::isPaused() { + return (this->state == PAUSED) ? true : false; } millis_t Stopwatch::duration() { - return ((isRunning() ? millis() : stopTimestamp) - - startTimestamp) / 1000UL + accumulator; + return (((this->isRunning()) ? millis() : this->stopTimestamp) + - this->startTimestamp) / 1000UL + this->accumulator; } #if ENABLED(DEBUG_STOPWATCH) diff --git a/Marlin/stopwatch.h b/Marlin/stopwatch.h index f5e04bb..ae3c998 100644 --- a/Marlin/stopwatch.h +++ b/Marlin/stopwatch.h @@ -23,12 +23,11 @@ #ifndef STOPWATCH_H #define STOPWATCH_H +#include "macros.h" + // Print debug messages with M111 S2 (Uses 156 bytes of PROGMEM) //#define DEBUG_STOPWATCH -#include "macros.h" -#include "types.h" - /** * @brief Stopwatch class * @details This class acts as a timer proving stopwatch functionality including @@ -36,85 +35,79 @@ */ class Stopwatch { private: - enum State : char { + enum State { STOPPED, RUNNING, PAUSED }; - static Stopwatch::State state; - static millis_t accumulator; - static millis_t startTimestamp; - static millis_t stopTimestamp; + Stopwatch::State state; + millis_t accumulator; + millis_t startTimestamp; + millis_t stopTimestamp; public: /** - * @brief Initialize the stopwatch + * @brief Class constructor */ - FORCE_INLINE static void init() { reset(); } + Stopwatch(); /** - * @brief Stop the stopwatch - * @details Stop the running timer. Silently ignore the request if - * no timer is running. - * @return true on success + * @brief Stops the stopwatch + * @details Stops the running timer, it will silently ignore the request if + * no timer is currently running. + * @return true is method was successful */ - static bool stop(); + bool stop(); /** * @brief Pause the stopwatch - * @details Pause the running timer, it will silently ignore the request if - * no timer is running. - * @return true on success + * @details Pauses the running timer, it will silently ignore the request if + * no timer is currently running. + * @return true is method was successful */ - static bool pause(); + bool pause(); /** - * @brief Start the stopwatch - * @details Start the timer, it will silently ignore the request if the - * timer is already running. - * @return true on success + * @brief Starts the stopwatch + * @details Starts the timer, it will silently ignore the request if the + * timer is already running. + * @return true is method was successful */ - static bool start(); + bool start(); /** - * @brief Resume the stopwatch - * @details Resume a timer from a given duration + * @brief Resets the stopwatch + * @details Resets all settings to their default values. */ - static void resume(const millis_t duration); + void reset(); /** - * @brief Reset the stopwatch - * @details Reset all settings to their default values. - */ - static void reset(); - - /** - * @brief Check if the timer is running - * @details Return true if the timer is currently running, false otherwise. + * @brief Checks if the timer is running + * @details Returns true if the timer is currently running, false otherwise. * @return true if stopwatch is running */ - FORCE_INLINE static bool isRunning() { return state == RUNNING; } + bool isRunning(); /** - * @brief Check if the timer is paused - * @details Return true if the timer is currently paused, false otherwise. + * @brief Checks if the timer is paused + * @details Returns true if the timer is currently paused, false otherwise. * @return true if stopwatch is paused */ - FORCE_INLINE static bool isPaused() { return state == PAUSED; } + bool isPaused(); /** - * @brief Get the running time - * @details Return the total number of seconds the timer has been running. + * @brief Gets the running time + * @details Returns the total number of seconds the timer has been running. * @return the delta since starting the stopwatch */ - static millis_t duration(); + millis_t duration(); - #ifdef DEBUG_STOPWATCH + #if ENABLED(DEBUG_STOPWATCH) /** - * @brief Print a debug message - * @details Print a simple debug message "Stopwatch::function" + * @brief Prints a debug message + * @details Prints a simple debug message "Stopwatch::function" */ static void debug(const char func[]); diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 665e5b5..750f084 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -30,9 +30,6 @@ #include "ultralcd.h" #include "planner.h" #include "language.h" -#include "printcounter.h" -#include "delay.h" -#include "endstops.h" #if ENABLED(HEATER_0_USES_MAX6675) #include "MarlinSPI.h" @@ -42,94 +39,34 @@ #include "stepper.h" #endif +#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) + #include "endstops.h" +#endif + #if ENABLED(USE_WATCHDOG) #include "watchdog.h" #endif -#if ENABLED(EMERGENCY_PARSER) - #include "emergency_parser.h" -#endif - -#if HOTEND_USES_THERMISTOR - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE }; - static constexpr uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN }; - #else - 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, (void*)HEATER_4_TEMPTABLE); - static constexpr 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, HEATER_4_TEMPTABLE_LEN); - #endif +#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) + 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[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE, (void*)HEATER_4_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, HEATER_4_TEMPTABLE_LEN); #endif Temperature thermalManager; -/** - * Macros to include the heater id in temp errors. The compiler's dead-code - * elimination should (hopefully) optimize out the unused strings. - */ -#if HAS_HEATED_BED - #define TEMP_ERR_PSTR(MSG, E) \ - (E) == -1 ? PSTR(MSG ## _BED) : \ - (HOTENDS > 1 && (E) == 1) ? PSTR(MSG_E2 " " MSG) : \ - (HOTENDS > 2 && (E) == 2) ? PSTR(MSG_E3 " " MSG) : \ - (HOTENDS > 3 && (E) == 3) ? PSTR(MSG_E4 " " MSG) : \ - (HOTENDS > 4 && (E) == 4) ? PSTR(MSG_E5 " " MSG) : \ - PSTR(MSG_E1 " " MSG) -#else - #define TEMP_ERR_PSTR(MSG, E) \ - (HOTENDS > 1 && (E) == 1) ? PSTR(MSG_E2 " " MSG) : \ - (HOTENDS > 2 && (E) == 2) ? PSTR(MSG_E3 " " MSG) : \ - (HOTENDS > 3 && (E) == 3) ? PSTR(MSG_E4 " " MSG) : \ - (HOTENDS > 4 && (E) == 4) ? PSTR(MSG_E5 " " MSG) : \ - PSTR(MSG_E1 " " MSG) -#endif - // public: -float Temperature::current_temperature[HOTENDS] = { 0.0 }; +float Temperature::current_temperature[HOTENDS] = { 0.0 }, + Temperature::current_temperature_bed = 0.0; int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 }, - Temperature::target_temperature[HOTENDS] = { 0 }; + Temperature::target_temperature[HOTENDS] = { 0 }, + Temperature::current_temperature_bed_raw = 0; -#if ENABLED(AUTO_POWER_E_FANS) - int16_t Temperature::autofan_speed[HOTENDS] = { 0 }; -#endif - -#if HAS_HEATED_BED - float Temperature::current_temperature_bed = 0.0; - int16_t Temperature::current_temperature_bed_raw = 0, - Temperature::target_temperature_bed = 0; - uint8_t Temperature::soft_pwm_amount_bed; - #ifdef BED_MINTEMP - int16_t Temperature::bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; - #endif - #ifdef BED_MAXTEMP - int16_t Temperature::bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP; - #endif - #if WATCH_THE_BED - uint16_t Temperature::watch_target_bed_temp = 0; - millis_t Temperature::watch_bed_next_ms = 0; - #endif - #if ENABLED(PIDTEMPBED) - float Temperature::bedKp, Temperature::bedKi, Temperature::bedKd, // Initialized by settings.load() - Temperature::temp_iState_bed = { 0 }, - Temperature::temp_dState_bed = { 0 }, - Temperature::pTerm_bed, - Temperature::iTerm_bed, - Temperature::dTerm_bed, - Temperature::pid_error_bed; - #else - millis_t Temperature::next_bed_check_ms; - #endif - uint16_t Temperature::raw_temp_bed_value = 0; - #if HEATER_IDLE_HANDLER - millis_t Temperature::bed_idle_timeout_ms = 0; - bool Temperature::bed_idle_timeout_exceeded = false; - #endif -#endif // HAS_HEATED_BED - -#if HAS_TEMP_CHAMBER - float Temperature::current_temperature_chamber = 0.0; - int16_t Temperature::current_temperature_chamber_raw = 0; - uint16_t Temperature::raw_temp_chamber_value = 0; +#if HAS_HEATER_BED + int16_t Temperature::target_temperature_bed = 0; #endif // Initialized by settings.load() @@ -147,6 +84,11 @@ int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 }, #endif #endif +// Initialized by settings.load() +#if ENABLED(PIDTEMPBED) + float Temperature::bedKp, Temperature::bedKi, Temperature::bedKd; +#endif + #if ENABLED(BABYSTEPPING) volatile int Temperature::babystepsTodo[XYZ] = { 0 }; #endif @@ -156,11 +98,18 @@ int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 }, millis_t Temperature::watch_heater_next_ms[HOTENDS] = { 0 }; #endif +#if WATCH_THE_BED + uint16_t Temperature::watch_target_bed_temp = 0; + millis_t Temperature::watch_bed_next_ms = 0; +#endif + #if ENABLED(PREVENT_COLD_EXTRUSION) bool Temperature::allow_cold_extrude = false; int16_t Temperature::extrude_min_temp = EXTRUDE_MINTEMP; #endif +// private: + #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) uint16_t Temperature::redundant_temperature_raw = 0; float Temperature::redundant_temperature = 0.0; @@ -186,7 +135,19 @@ volatile bool Temperature::temp_meas_ready = false; bool Temperature::pid_reset[HOTENDS]; #endif -uint16_t Temperature::raw_temp_value[MAX_EXTRUDERS] = { 0 }; +#if ENABLED(PIDTEMPBED) + float Temperature::temp_iState_bed = { 0 }, + Temperature::temp_dState_bed = { 0 }, + Temperature::pTerm_bed, + Temperature::iTerm_bed, + Temperature::dTerm_bed, + Temperature::pid_error_bed; +#else + millis_t Temperature::next_bed_check_ms; +#endif + +uint16_t Temperature::raw_temp_value[MAX_EXTRUDERS] = { 0 }, + Temperature::raw_temp_bed_value = 0; // Init min and max temp with extreme values to prevent false errors during startup int16_t 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, HEATER_4_RAW_LO_TEMP), @@ -202,6 +163,14 @@ int16_t Temperature::minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_LO_TE millis_t Temperature::preheat_end_time[HOTENDS] = { 0 }; #endif +#ifdef BED_MINTEMP + int16_t Temperature::bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; +#endif + +#ifdef BED_MAXTEMP + int16_t Temperature::bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP; +#endif + #if ENABLED(FILAMENT_WIDTH_SENSOR) int8_t Temperature::meas_shift_index; // Index of a delayed sample in buffer #endif @@ -210,7 +179,8 @@ int16_t Temperature::minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_LO_TE millis_t Temperature::next_auto_fan_check_ms = 0; #endif -uint8_t Temperature::soft_pwm_amount[HOTENDS]; +uint8_t Temperature::soft_pwm_amount[HOTENDS], + Temperature::soft_pwm_amount_bed; #if ENABLED(FAN_SOFT_PWM) uint8_t Temperature::soft_pwm_amount_fan[FAN_COUNT], @@ -228,6 +198,10 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; #if HEATER_IDLE_HANDLER millis_t Temperature::heater_idle_timeout_ms[HOTENDS] = { 0 }; bool Temperature::heater_idle_timeout_exceeded[HOTENDS] = { false }; + #if HAS_TEMP_BED + millis_t Temperature::bed_idle_timeout_ms = 0; + bool Temperature::bed_idle_timeout_exceeded = false; + #endif #endif #if ENABLED(ADC_KEYPAD) @@ -235,10 +209,6 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; uint8_t Temperature::ADCKey_count = 0; #endif -#if ENABLED(PID_EXTRUSION_SCALING) - int16_t Temperature::lpq_len; // Initialized in configuration_store -#endif - #if HAS_PID_HEATING /** @@ -247,8 +217,8 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; * Alternately heat and cool the nozzle, observing its behavior to * determine the best PID values to achieve a stable temperature. */ - void Temperature::PID_autotune(const float &target, const int8_t hotend, const int8_t ncycles, const bool set_result/*=false*/) { - float current = 0.0; + void Temperature::PID_autotune(const float temp, const int8_t hotend, const int8_t ncycles, const bool set_result/*=false*/) { + float input = 0.0; int cycles = 0; bool heating = true; @@ -260,29 +230,34 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; workKp = 0, workKi = 0, workKd = 0, max = 0, min = 10000; - #if HAS_PID_FOR_BOTH - #define GHV(B,H) (hotend < 0 ? (B) : (H)) - #define SHV(S,B,H) if (hotend < 0) S##_bed = B; else S [hotend] = H; - #elif ENABLED(PIDTEMPBED) - #define GHV(B,H) B - #define SHV(S,B,H) (S##_bed = B) - #else - #define GHV(B,H) H - #define SHV(S,B,H) (S [hotend] = H) - #endif - #if WATCH_THE_BED || WATCH_HOTENDS - #define HAS_TP_BED (ENABLED(THERMAL_PROTECTION_BED) && ENABLED(PIDTEMPBED)) - #if HAS_TP_BED && ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(PIDTEMP) - #define GTV(B,H) (hotend < 0 ? (B) : (H)) - #elif HAS_TP_BED - #define GTV(B,H) (B) - #else - #define GTV(B,H) (H) - #endif - const uint16_t watch_temp_period = GTV(WATCH_BED_TEMP_PERIOD, WATCH_TEMP_PERIOD); - const uint8_t watch_temp_increase = GTV(WATCH_BED_TEMP_INCREASE, WATCH_TEMP_INCREASE); - const float watch_temp_target = target - float(watch_temp_increase + GTV(TEMP_BED_HYSTERESIS, TEMP_HYSTERESIS) + 1); + const float watch_temp_target = temp - + #if ENABLED(THERMAL_PROTECTION_BED) && ENABLED(PIDTEMPBED) && ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(PIDTEMP) + (hotend < 0 ? (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1) : (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) + #elif ENABLED(THERMAL_PROTECTION_BED) && ENABLED(PIDTEMPBED) + (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1) + #else + (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1) + #endif + ; + const int8_t watch_temp_period = + #if ENABLED(THERMAL_PROTECTION_BED) && ENABLED(PIDTEMPBED) && ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(PIDTEMP) + hotend < 0 ? WATCH_BED_TEMP_PERIOD : WATCH_TEMP_PERIOD + #elif ENABLED(THERMAL_PROTECTION_BED) && ENABLED(PIDTEMPBED) + WATCH_BED_TEMP_PERIOD + #else + WATCH_TEMP_PERIOD + #endif + ; + const int8_t watch_temp_increase = + #if ENABLED(THERMAL_PROTECTION_BED) && ENABLED(PIDTEMPBED) && ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(PIDTEMP) + hotend < 0 ? WATCH_BED_TEMP_INCREASE : WATCH_TEMP_INCREASE + #elif ENABLED(THERMAL_PROTECTION_BED) && ENABLED(PIDTEMPBED) + WATCH_BED_TEMP_INCREASE + #else + WATCH_TEMP_INCREASE + #endif + ; millis_t temp_change_ms = next_temp_ms + watch_temp_period * 1000UL; float next_watch_temp = 0.0; bool heated = false; @@ -304,17 +279,26 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; #endif if (!WITHIN(hotend, _BOT_HOTEND, _TOP_HOTEND)) { - SERIAL_ECHOLNPGM(MSG_PID_BAD_EXTRUDER_NUM); + SERIAL_ECHOLN(MSG_PID_BAD_EXTRUDER_NUM); return; } - SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_START); + SERIAL_ECHOLN(MSG_PID_AUTOTUNE_START); disable_all_heaters(); // switch off all heaters. - SHV(soft_pwm_amount, bias = d = (MAX_BED_POWER) >> 1, bias = d = (PID_MAX) >> 1); + #if HAS_PID_FOR_BOTH + if (hotend < 0) + soft_pwm_amount_bed = bias = d = (MAX_BED_POWER) >> 1; + else + soft_pwm_amount[hotend] = bias = d = (PID_MAX) >> 1; + #elif ENABLED(PIDTEMP) + soft_pwm_amount[hotend] = bias = d = (PID_MAX) >> 1; + #else + soft_pwm_amount_bed = bias = d = (MAX_BED_POWER) >> 1; + #endif - wait_for_heatup = true; // Can be interrupted with M108 + wait_for_heatup = true; // PID Tuning loop while (wait_for_heatup) { @@ -324,10 +308,18 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; if (temp_meas_ready) { // temp sample ready updateTemperaturesFromRawValues(); - // Get the current temperature and constrain it - current = GHV(current_temperature_bed, current_temperature[hotend]); - NOLESS(max, current); - NOMORE(min, current); + input = + #if HAS_PID_FOR_BOTH + hotend < 0 ? current_temperature_bed : current_temperature[hotend] + #elif ENABLED(PIDTEMP) + current_temperature[hotend] + #else + current_temperature_bed + #endif + ; + + NOLESS(max, input); + NOMORE(min, input); #if HAS_AUTO_FAN if (ELAPSED(ms, next_auto_fan_check_ms)) { @@ -336,23 +328,40 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; } #endif - if (heating && current > target) { + if (heating && input > temp) { if (ELAPSED(ms, t2 + 5000UL)) { heating = false; - SHV(soft_pwm_amount, (bias - d) >> 1, (bias - d) >> 1); + #if HAS_PID_FOR_BOTH + if (hotend < 0) + soft_pwm_amount_bed = (bias - d) >> 1; + else + soft_pwm_amount[hotend] = (bias - d) >> 1; + #elif ENABLED(PIDTEMP) + soft_pwm_amount[hotend] = (bias - d) >> 1; + #elif ENABLED(PIDTEMPBED) + soft_pwm_amount_bed = (bias - d) >> 1; + #endif t1 = ms; t_high = t1 - t2; - max = target; + max = temp; } } - if (!heating && current < target) { + if (!heating && input < temp) { if (ELAPSED(ms, t1 + 5000UL)) { heating = true; t2 = ms; t_low = t2 - t1; if (cycles > 0) { - const long max_pow = GHV(MAX_BED_POWER, PID_MAX); + long max_pow = + #if HAS_PID_FOR_BOTH + hotend < 0 ? MAX_BED_POWER : PID_MAX + #elif ENABLED(PIDTEMP) + PID_MAX + #else + MAX_BED_POWER + #endif + ; bias += (d * (t_high - t_low)) / (t_low + t_high); bias = constrain(bias, 20, max_pow - 20); d = (bias > max_pow >> 1) ? max_pow - 1 - bias : bias; @@ -362,13 +371,13 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; SERIAL_PROTOCOLPAIR(MSG_T_MIN, min); SERIAL_PROTOCOLPAIR(MSG_T_MAX, max); if (cycles > 2) { - Ku = (4.0f * d) / (M_PI * (max - min) * 0.5f); - Tu = ((float)(t_low + t_high) * 0.001f); + Ku = (4.0 * d) / (M_PI * (max - min) * 0.5); + Tu = ((float)(t_low + t_high) * 0.001); SERIAL_PROTOCOLPAIR(MSG_KU, Ku); SERIAL_PROTOCOLPAIR(MSG_TU, Tu); - workKp = 0.6f * Ku; + workKp = 0.6 * Ku; workKi = 2 * workKp / Tu; - workKd = workKp * Tu * 0.125f; + workKd = workKp * Tu * 0.125; SERIAL_PROTOCOLLNPGM("\n" MSG_CLASSIC_PID); SERIAL_PROTOCOLPAIR(MSG_KP, workKp); SERIAL_PROTOCOLPAIR(MSG_KI, workKi); @@ -391,88 +400,75 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; */ } } - SHV(soft_pwm_amount, (bias + d) >> 1, (bias + d) >> 1); + #if HAS_PID_FOR_BOTH + if (hotend < 0) + soft_pwm_amount_bed = (bias + d) >> 1; + else + soft_pwm_amount[hotend] = (bias + d) >> 1; + #elif ENABLED(PIDTEMP) + soft_pwm_amount[hotend] = (bias + d) >> 1; + #else + soft_pwm_amount_bed = (bias + d) >> 1; + #endif cycles++; - min = target; + min = temp; } } } - - // Did the temperature overshoot very far? - #ifndef MAX_OVERSHOOT_PID_AUTOTUNE - #define MAX_OVERSHOOT_PID_AUTOTUNE 20 - #endif - if (current > target + MAX_OVERSHOOT_PID_AUTOTUNE) { + #define MAX_OVERSHOOT_PID_AUTOTUNE 20 + if (input > temp + MAX_OVERSHOOT_PID_AUTOTUNE) { SERIAL_PROTOCOLLNPGM(MSG_PID_TEMP_TOO_HIGH); break; } - - // Report heater states every 2 seconds + // Every 2 seconds... if (ELAPSED(ms, next_temp_ms)) { - #if HAS_TEMP_SENSOR + #if HAS_TEMP_HOTEND || HAS_TEMP_BED print_heaterstates(); SERIAL_EOL(); #endif + next_temp_ms = ms + 2000UL; - // Make sure heating is actually working #if WATCH_THE_BED || WATCH_HOTENDS - if ( - #if WATCH_THE_BED && WATCH_HOTENDS - true - #elif WATCH_HOTENDS - hotend >= 0 - #else - hotend < 0 - #endif - ) { - if (!heated) { // If not yet reached target... - if (current > next_watch_temp) { // Over the watch temp? - next_watch_temp = current + watch_temp_increase; // - set the next temp to watch for - temp_change_ms = ms + watch_temp_period * 1000UL; // - move the expiration timer up - if (current > watch_temp_target) heated = true; // - Flag if target temperature reached - } - else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired - _temp_error(hotend, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, hotend)); - } - else if (current < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far? - _temp_error(hotend, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, hotend)); + if (!heated && input > next_watch_temp) { + if (input > watch_temp_target) heated = true; + next_watch_temp = input + watch_temp_increase; + temp_change_ms = ms + watch_temp_period * 1000UL; } + else if (!heated && ELAPSED(ms, temp_change_ms)) + _temp_error(hotend, PSTR(MSG_T_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD)); + else if (heated && input < temp - MAX_OVERSHOOT_PID_AUTOTUNE) + _temp_error(hotend, PSTR(MSG_T_THERMAL_RUNAWAY), PSTR(MSG_THERMAL_RUNAWAY)); #endif } // every 2 seconds - - // Timeout after MAX_CYCLE_TIME_PID_AUTOTUNE minutes since the last undershoot/overshoot cycle - #ifndef MAX_CYCLE_TIME_PID_AUTOTUNE - #define MAX_CYCLE_TIME_PID_AUTOTUNE 20L - #endif - if (((ms - t1) + (ms - t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) { + // Timeout after 20 minutes since the last undershoot/overshoot cycle + if (((ms - t1) + (ms - t2)) > (20L * 60L * 1000L)) { SERIAL_PROTOCOLLNPGM(MSG_PID_TIMEOUT); break; } - if (cycles > ncycles) { SERIAL_PROTOCOLLNPGM(MSG_PID_AUTOTUNE_FINISHED); #if HAS_PID_FOR_BOTH - const char* estring = GHV("bed", ""); - SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kp ", workKp); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Ki ", workKi); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kd ", workKd); SERIAL_EOL(); + const char* estring = hotend < 0 ? "bed" : ""; + SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kp ", workKp); SERIAL_EOL(); + SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Ki ", workKi); SERIAL_EOL(); + SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kd ", workKd); SERIAL_EOL(); #elif ENABLED(PIDTEMP) - SERIAL_PROTOCOLPAIR("#define DEFAULT_Kp ", workKp); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_Ki ", workKi); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_Kd ", workKd); SERIAL_EOL(); + SERIAL_PROTOCOLPAIR("#define DEFAULT_Kp ", workKp); SERIAL_EOL(); + SERIAL_PROTOCOLPAIR("#define DEFAULT_Ki ", workKi); SERIAL_EOL(); + SERIAL_PROTOCOLPAIR("#define DEFAULT_Kd ", workKd); SERIAL_EOL(); #else - SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKp ", workKp); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKi ", workKi); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKd ", workKd); SERIAL_EOL(); + SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKp ", workKp); SERIAL_EOL(); + SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKi ", workKi); SERIAL_EOL(); + SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKd ", workKd); SERIAL_EOL(); #endif #define _SET_BED_PID() do { \ bedKp = workKp; \ bedKi = scalePID_i(workKi); \ bedKd = scalePID_d(workKd); \ - }while(0) + }while(0) #define _SET_EXTRUDER_PID() do { \ PID_PARAM(Kp, hotend) = workKp; \ @@ -508,26 +504,20 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; Temperature::Temperature() { } -int Temperature::getHeaterPower(const int heater) { - return ( - #if HAS_HEATED_BED - heater < 0 ? soft_pwm_amount_bed : - #endif - soft_pwm_amount[heater] - ); +int Temperature::getHeaterPower(int heater) { + return heater < 0 ? soft_pwm_amount_bed : soft_pwm_amount[heater]; } #if HAS_AUTO_FAN void Temperature::checkExtruderAutoFans() { - static const pin_t fanPin[] PROGMEM = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN, E4_AUTO_FAN_PIN, CHAMBER_AUTO_FAN_PIN }; + static const int8_t fanPin[] PROGMEM = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN, E4_AUTO_FAN_PIN }; static const uint8_t fanBit[] PROGMEM = { 0, AUTO_1_IS_0 ? 0 : 1, AUTO_2_IS_0 ? 0 : AUTO_2_IS_1 ? 1 : 2, AUTO_3_IS_0 ? 0 : AUTO_3_IS_1 ? 1 : AUTO_3_IS_2 ? 2 : 3, - AUTO_4_IS_0 ? 0 : AUTO_4_IS_1 ? 1 : AUTO_4_IS_2 ? 2 : AUTO_4_IS_3 ? 3 : 4, - AUTO_CHAMBER_IS_0 ? 0 : AUTO_CHAMBER_IS_1 ? 1 : AUTO_CHAMBER_IS_2 ? 2 : AUTO_CHAMBER_IS_3 ? 3 : AUTO_CHAMBER_IS_4 ? 4 : 5 + AUTO_4_IS_0 ? 0 : AUTO_4_IS_1 ? 1 : AUTO_4_IS_2 ? 2 : AUTO_4_IS_3 ? 3 : 4 }; uint8_t fanState = 0; @@ -535,26 +525,12 @@ int Temperature::getHeaterPower(const int heater) { if (current_temperature[e] > EXTRUDER_AUTO_FAN_TEMPERATURE) SBI(fanState, pgm_read_byte(&fanBit[e])); - #if HAS_TEMP_CHAMBER - if (current_temperature_chamber > EXTRUDER_AUTO_FAN_TEMPERATURE) - SBI(fanState, pgm_read_byte(&fanBit[5])); - #endif - uint8_t fanDone = 0; for (uint8_t f = 0; f < COUNT(fanPin); f++) { - const pin_t pin = - #ifdef ARDUINO - pgm_read_byte(&fanPin[f]) - #else - fanPin[f] - #endif - ; + int8_t pin = pgm_read_byte(&fanPin[f]); const uint8_t bit = pgm_read_byte(&fanBit[f]); if (pin >= 0 && !TEST(fanDone, bit)) { uint8_t newFanSpeed = TEST(fanState, bit) ? EXTRUDER_AUTO_FAN_SPEED : 0; - #if ENABLED(AUTO_POWER_E_FANS) - autofan_speed[f] = newFanSpeed; - #endif // this idiom allows both digital and PWM fan outputs (see M42 handling). digitalWrite(pin, newFanSpeed); analogWrite(pin, newFanSpeed); @@ -569,6 +545,7 @@ int Temperature::getHeaterPower(const int heater) { // Temperature Error Handlers // void Temperature::_temp_error(const int8_t e, const char * const serial_msg, const char * const lcd_msg) { + static bool killed = false; if (IsRunning()) { SERIAL_ERROR_START(); serialprintPGM(serial_msg); @@ -576,7 +553,6 @@ void Temperature::_temp_error(const int8_t e, const char * const serial_msg, con if (e >= 0) SERIAL_ERRORLN((int)e); else SERIAL_ERRORLNPGM(MSG_HEATER_BED); } #if DISABLED(BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE) - static bool killed = false; if (!killed) { Running = false; killed = true; @@ -588,11 +564,24 @@ void Temperature::_temp_error(const int8_t e, const char * const serial_msg, con } void Temperature::max_temp_error(const int8_t e) { - _temp_error(e, PSTR(MSG_T_MAXTEMP), TEMP_ERR_PSTR(MSG_ERR_MAXTEMP, e)); + #if HAS_TEMP_BED + _temp_error(e, PSTR(MSG_T_MAXTEMP), e >= 0 ? PSTR(MSG_ERR_MAXTEMP) : PSTR(MSG_ERR_MAXTEMP_BED)); + #else + _temp_error(HOTEND_INDEX, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP)); + #if HOTENDS == 1 + UNUSED(e); + #endif + #endif } - void Temperature::min_temp_error(const int8_t e) { - _temp_error(e, PSTR(MSG_T_MINTEMP), TEMP_ERR_PSTR(MSG_ERR_MINTEMP, e)); + #if HAS_TEMP_BED + _temp_error(e, PSTR(MSG_T_MINTEMP), e >= 0 ? PSTR(MSG_ERR_MINTEMP) : PSTR(MSG_ERR_MINTEMP_BED)); + #else + _temp_error(HOTEND_INDEX, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP)); + #if HOTENDS == 1 + UNUSED(e); + #endif + #endif } float Temperature::get_pid_output(const int8_t e) { @@ -606,7 +595,7 @@ float Temperature::get_pid_output(const int8_t e) { #if ENABLED(PIDTEMP) #if DISABLED(PID_OPENLOOP) pid_error[HOTEND_INDEX] = target_temperature[HOTEND_INDEX] - current_temperature[HOTEND_INDEX]; - dTerm[HOTEND_INDEX] = PID_K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + float(PID_K1) * dTerm[HOTEND_INDEX]; + dTerm[HOTEND_INDEX] = PID_K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + PID_K1 * dTerm[HOTEND_INDEX]; temp_dState[HOTEND_INDEX] = current_temperature[HOTEND_INDEX]; #if HEATER_IDLE_HANDLER if (heater_idle_timeout_exceeded[HOTEND_INDEX]) { @@ -641,14 +630,14 @@ float Temperature::get_pid_output(const int8_t e) { #if ENABLED(PID_EXTRUSION_SCALING) cTerm[HOTEND_INDEX] = 0; if (_HOTEND_TEST) { - const long e_position = stepper.position(E_AXIS); + long e_position = stepper.position(E_AXIS); if (e_position > last_e_position) { lpq[lpq_ptr] = e_position - last_e_position; last_e_position = e_position; } - else + else { lpq[lpq_ptr] = 0; - + } 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]; @@ -749,21 +738,13 @@ float Temperature::get_pid_output(const int8_t e) { */ void Temperature::manage_heater() { - #if ENABLED(PROBING_HEATERS_OFF) && ENABLED(BED_LIMIT_SWITCHING) - static bool last_pause_state; - #endif - - #if ENABLED(EMERGENCY_PARSER) - if (emergency_parser.killed_by_M112) kill(PSTR(MSG_KILLED)); - #endif - if (!temp_meas_ready) return; updateTemperaturesFromRawValues(); // also resets the watchdog #if ENABLED(HEATER_0_USES_MAX6675) - if (current_temperature[0] > MIN(HEATER_0_MAXTEMP, MAX6675_TMAX - 1.0)) max_temp_error(0); - if (current_temperature[0] < MAX(HEATER_0_MINTEMP, MAX6675_TMIN + .01)) min_temp_error(0); + if (current_temperature[0] > min(HEATER_0_MAXTEMP, MAX6675_TMAX - 1.0)) max_temp_error(0); + if (current_temperature[0] < max(HEATER_0_MINTEMP, MAX6675_TMIN + .01)) min_temp_error(0); #endif #if WATCH_HOTENDS || WATCH_THE_BED || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN || HEATER_IDLE_HANDLER @@ -788,7 +769,7 @@ void Temperature::manage_heater() { // Make sure temperature is increasing if (watch_heater_next_ms[e] && ELAPSED(ms, watch_heater_next_ms[e])) { // Time to check this extruder? if (degHotend(e) < watch_target_temp[e]) // Failed to increase enough? - _temp_error(e, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, e)); + _temp_error(e, PSTR(MSG_T_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD)); else // Start again if the target is still far off start_watching_heater(e); } @@ -796,7 +777,7 @@ void Temperature::manage_heater() { #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) // Make sure measured temperatures are close together - if (ABS(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) + if (FABS(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) _temp_error(0, PSTR(MSG_REDUNDANCY), PSTR(MSG_ERR_REDUNDANT_TEMP)); #endif @@ -822,29 +803,22 @@ void Temperature::manage_heater() { } #endif // FILAMENT_WIDTH_SENSOR - #if HAS_HEATED_BED + #if WATCH_THE_BED + // Make sure temperature is increasing + if (watch_bed_next_ms && ELAPSED(ms, watch_bed_next_ms)) { // Time to check the bed? + if (degBed() < watch_target_bed_temp) // Failed to increase enough? + _temp_error(-1, PSTR(MSG_T_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD)); + else // Start again if the target is still far off + start_watching_bed(); + } + #endif // WATCH_THE_BED - #if WATCH_THE_BED - // Make sure temperature is increasing - if (watch_bed_next_ms && ELAPSED(ms, watch_bed_next_ms)) { // Time to check the bed? - if (degBed() < watch_target_bed_temp) // Failed to increase enough? - _temp_error(-1, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, -1)); - else // Start again if the target is still far off - start_watching_bed(); - } - #endif // WATCH_THE_BED + #if DISABLED(PIDTEMPBED) + if (PENDING(ms, next_bed_check_ms)) return; + next_bed_check_ms = ms + BED_CHECK_INTERVAL; + #endif - #if DISABLED(PIDTEMPBED) - if (PENDING(ms, next_bed_check_ms) - #if ENABLED(PROBING_HEATERS_OFF) && ENABLED(BED_LIMIT_SWITCHING) - && paused == last_pause_state - #endif - ) return; - next_bed_check_ms = ms + BED_CHECK_INTERVAL; - #if ENABLED(PROBING_HEATERS_OFF) && ENABLED(BED_LIMIT_SWITCHING) - last_pause_state = paused; - #endif - #endif + #if HAS_TEMP_BED #if HEATER_IDLE_HANDLER if (!bed_idle_timeout_exceeded && bed_idle_timeout_ms && ELAPSED(ms, bed_idle_timeout_ms)) @@ -856,8 +830,10 @@ void Temperature::manage_heater() { #endif #if HEATER_IDLE_HANDLER - if (bed_idle_timeout_exceeded) { + if (bed_idle_timeout_exceeded) + { soft_pwm_amount_bed = 0; + #if DISABLED(PIDTEMPBED) WRITE_HEATER_BED(LOW); #endif @@ -867,17 +843,23 @@ void Temperature::manage_heater() { { #if ENABLED(PIDTEMPBED) soft_pwm_amount_bed = WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP) ? (int)get_pid_output_bed() >> 1 : 0; - #else + + #elif ENABLED(BED_LIMIT_SWITCHING) // Check if temperature is within the correct band if (WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP)) { - #if ENABLED(BED_LIMIT_SWITCHING) - if (current_temperature_bed >= target_temperature_bed + BED_HYSTERESIS) - soft_pwm_amount_bed = 0; - else if (current_temperature_bed <= target_temperature_bed - (BED_HYSTERESIS)) - soft_pwm_amount_bed = MAX_BED_POWER >> 1; - #else // !PIDTEMPBED && !BED_LIMIT_SWITCHING - soft_pwm_amount_bed = current_temperature_bed < target_temperature_bed ? MAX_BED_POWER >> 1 : 0; - #endif + if (current_temperature_bed >= target_temperature_bed + BED_HYSTERESIS) + soft_pwm_amount_bed = 0; + else if (current_temperature_bed <= target_temperature_bed - (BED_HYSTERESIS)) + soft_pwm_amount_bed = MAX_BED_POWER >> 1; + } + else { + soft_pwm_amount_bed = 0; + WRITE_HEATER_BED(LOW); + } + #else // !PIDTEMPBED && !BED_LIMIT_SWITCHING + // Check if temperature is within the correct range + if (WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP)) { + soft_pwm_amount_bed = current_temperature_bed < target_temperature_bed ? MAX_BED_POWER >> 1 : 0; } else { soft_pwm_amount_bed = 0; @@ -885,32 +867,10 @@ void Temperature::manage_heater() { } #endif } - #endif // HAS_HEATED_BED + #endif // HAS_TEMP_BED } -#define TEMP_AD595(RAW) ((RAW) * 5.0 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET) -#define TEMP_AD8495(RAW) ((RAW) * 6.6 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD8495_GAIN) + TEMP_SENSOR_AD8495_OFFSET) - -/** - * Bisect search for the range of the 'raw' value, then interpolate - * proportionally between the under and over values. - */ -#define SCAN_THERMISTOR_TABLE(TBL,LEN) do{ \ - uint8_t l = 0, r = LEN, m; \ - for (;;) { \ - m = (l + r) >> 1; \ - if (m == l || m == r) return (short)pgm_read_word(&TBL[LEN-1][1]); \ - short v00 = pgm_read_word(&TBL[m-1][0]), \ - v10 = pgm_read_word(&TBL[m-0][0]); \ - if (raw < v00) r = m; \ - else if (raw > v10) l = m; \ - else { \ - const short v01 = (short)pgm_read_word(&TBL[m-1][1]), \ - v11 = (short)pgm_read_word(&TBL[m-0][1]); \ - return v01 + (raw - v00) * float(v11 - v01) / float(v10 - v00); \ - } \ - } \ -}while(0) +#define PGM_RD_W(x) (short)pgm_read_word(&x) // Derived from RepRap FiveD extruder::getTemperature() // For hot end temperature measurement. @@ -928,92 +888,68 @@ float Temperature::analog2temp(const int raw, const uint8_t e) { return 0.0; } - switch (e) { - case 0: - #if ENABLED(HEATER_0_USES_MAX6675) - return raw * 0.25; - #elif ENABLED(HEATER_0_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_0_USES_AD8495) - return TEMP_AD8495(raw); - #else - break; - #endif - case 1: - #if ENABLED(HEATER_1_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_1_USES_AD8495) - return TEMP_AD8495(raw); - #else - break; - #endif - case 2: - #if ENABLED(HEATER_2_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_2_USES_AD8495) - return TEMP_AD8495(raw); - #else - break; - #endif - case 3: - #if ENABLED(HEATER_3_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_3_USES_AD8495) - return TEMP_AD8495(raw); - #else - break; - #endif - case 4: - #if ENABLED(HEATER_4_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_4_USES_AD8495) - return TEMP_AD8495(raw); - #else - break; - #endif - default: break; - } - - #if HOTEND_USES_THERMISTOR - // Thermistor with conversion table? - const short(*tt)[][2] = (short(*)[][2])(heater_ttbl_map[e]); - SCAN_THERMISTOR_TABLE((*tt), heater_ttbllen_map[e]); + #if ENABLED(HEATER_0_USES_MAX6675) + if (e == 0) return 0.25 * raw; #endif - return 0; + if (heater_ttbl_map[e] != NULL) { + float celsius = 0; + uint8_t i; + short(*tt)[][2] = (short(*)[][2])(heater_ttbl_map[e]); + + for (i = 1; i < heater_ttbllen_map[e]; i++) { + if (PGM_RD_W((*tt)[i][0]) > raw) { + celsius = PGM_RD_W((*tt)[i - 1][1]) + + (raw - PGM_RD_W((*tt)[i - 1][0])) * + (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i - 1][1])) / + (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i - 1][0])); + break; + } + } + + // Overflow: Set to last value in the table + if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i - 1][1]); + + return celsius; + } + return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN)) + TEMP_SENSOR_AD595_OFFSET; } -#if HAS_HEATED_BED +#if HAS_TEMP_BED // Derived from RepRap FiveD extruder::getTemperature() // For bed temperature measurement. float Temperature::analog2tempBed(const int raw) { - #if ENABLED(HEATER_BED_USES_THERMISTOR) - SCAN_THERMISTOR_TABLE(BEDTEMPTABLE, BEDTEMPTABLE_LEN); - #elif ENABLED(HEATER_BED_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_BED_USES_AD8495) - return TEMP_AD8495(raw); - #else - return 0; - #endif - } -#endif // HAS_HEATED_BED + #if ENABLED(BED_USES_THERMISTOR) + float celsius = 0; + byte i; + + for (i = 1; i < BEDTEMPTABLE_LEN; i++) { + if (PGM_RD_W(BEDTEMPTABLE[i][0]) > raw) { + celsius = PGM_RD_W(BEDTEMPTABLE[i - 1][1]) + + (raw - PGM_RD_W(BEDTEMPTABLE[i - 1][0])) * + (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i - 1][1])) / + (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i - 1][0])); + break; + } + } + + // Overflow: Set to last value in the table + if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i - 1][1]); + + return celsius; + + #elif defined(BED_USES_AD595) + + return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN)) + TEMP_SENSOR_AD595_OFFSET; -#if HAS_TEMP_CHAMBER - // Derived from RepRap FiveD extruder::getTemperature() - // For chamber temperature measurement. - float Temperature::analog2tempChamber(const int raw) { - #if ENABLED(HEATER_CHAMBER_USES_THERMISTOR) - SCAN_THERMISTOR_TABLE(CHAMBERTEMPTABLE, CHAMBERTEMPTABLE_LEN); - #elif ENABLED(HEATER_CHAMBER_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_CHAMBER_USES_AD8495) - return TEMP_AD8495(raw); #else + + UNUSED(raw); return 0; + #endif } -#endif // HAS_TEMP_CHAMBER +#endif // HAS_TEMP_BED /** * Get the raw values into the actual temperatures. @@ -1025,13 +961,11 @@ void Temperature::updateTemperaturesFromRawValues() { #if ENABLED(HEATER_0_USES_MAX6675) current_temperature_raw[0] = read_max6675(); #endif - HOTEND_LOOP() current_temperature[e] = Temperature::analog2temp(current_temperature_raw[e], e); - #if HAS_HEATED_BED + HOTEND_LOOP() + current_temperature[e] = Temperature::analog2temp(current_temperature_raw[e], e); + #if HAS_TEMP_BED current_temperature_bed = Temperature::analog2tempBed(current_temperature_bed_raw); #endif - #if HAS_TEMP_CHAMBER - current_temperature_chamber = Temperature::analog2tempChamber(current_temperature_chamber_raw); - #endif #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) redundant_temperature = Temperature::analog2temp(redundant_temperature_raw, 1); #endif @@ -1044,7 +978,9 @@ void Temperature::updateTemperaturesFromRawValues() { watchdog_reset(); #endif + CRITICAL_SECTION_START; temp_meas_ready = false; + CRITICAL_SECTION_END; } @@ -1052,7 +988,7 @@ void Temperature::updateTemperaturesFromRawValues() { // Convert raw Filament Width to millimeters float Temperature::analog2widthFil() { - return current_raw_filwidth * 5.0f * (1.0f / 16383.0); + return current_raw_filwidth * 5.0 * (1.0 / 16383.0); } /** @@ -1064,8 +1000,8 @@ void Temperature::updateTemperaturesFromRawValues() { * a return value of 1. */ int8_t Temperature::widthFil_to_size_ratio() { - if (ABS(filament_width_nominal - filament_width_meas) <= FILWIDTH_ERROR_MARGIN) - return int(100.0f * filament_width_nominal / filament_width_meas) - 100; + if (FABS(filament_width_nominal - filament_width_meas) <= FILWIDTH_ERROR_MARGIN) + return int(100.0 * filament_width_nominal / filament_width_meas) - 100; return 0; } @@ -1087,9 +1023,7 @@ void Temperature::updateTemperaturesFromRawValues() { */ void Temperature::init() { - #if MB(RUMBA) && ( \ - ENABLED(HEATER_0_USES_AD595) || ENABLED(HEATER_1_USES_AD595) || ENABLED(HEATER_2_USES_AD595) || ENABLED(HEATER_3_USES_AD595) || ENABLED(HEATER_4_USES_AD595) || ENABLED(HEATER_BED_USES_AD595) || ENABLED(HEATER_CHAMBER_USES_AD595) \ - || ENABLED(HEATER_0_USES_AD8495) || ENABLED(HEATER_1_USES_AD8495) || ENABLED(HEATER_2_USES_AD8495) || ENABLED(HEATER_3_USES_AD8495) || ENABLED(HEATER_4_USES_AD8495) || ENABLED(HEATER_BED_USES_AD8495) || ENABLED(HEATER_CHAMBER_USES_AD8495)) + #if MB(RUMBA) && (TEMP_SENSOR_0 == -1 || TEMP_SENSOR_1 == -1 || TEMP_SENSOR_2 == -1 || TEMP_SENSOR_BED == -1) // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector MCUCR = _BV(JTD); MCUCR = _BV(JTD); @@ -1117,7 +1051,7 @@ void Temperature::init() { #if HAS_HEATER_4 SET_OUTPUT(HEATER_3_PIN); #endif - #if HAS_HEATED_BED + #if HAS_HEATER_BED SET_OUTPUT(HEATER_BED_PIN); #endif @@ -1155,36 +1089,40 @@ void Temperature::init() { #endif // HEATER_0_USES_MAX6675 - HAL_adc_init(); + #ifdef DIDR2 + #define ANALOG_SELECT(pin) do{ if (pin < 8) SBI(DIDR0, pin); else SBI(DIDR2, pin - 8); }while(0) + #else + #define ANALOG_SELECT(pin) do{ SBI(DIDR0, pin); }while(0) + #endif - #if HAS_TEMP_ADC_0 - HAL_ANALOG_SELECT(TEMP_0_PIN); + // Set analog inputs + ADCSRA = _BV(ADEN) | _BV(ADSC) | _BV(ADIF) | 0x07; + DIDR0 = 0; + #ifdef DIDR2 + DIDR2 = 0; #endif - #if HAS_TEMP_ADC_1 - HAL_ANALOG_SELECT(TEMP_1_PIN); + #if HAS_TEMP_0 + ANALOG_SELECT(TEMP_0_PIN); #endif - #if HAS_TEMP_ADC_2 - HAL_ANALOG_SELECT(TEMP_2_PIN); + #if HAS_TEMP_1 + ANALOG_SELECT(TEMP_1_PIN); #endif - #if HAS_TEMP_ADC_3 - HAL_ANALOG_SELECT(TEMP_3_PIN); + #if HAS_TEMP_2 + ANALOG_SELECT(TEMP_2_PIN); #endif - #if HAS_TEMP_ADC_4 - HAL_ANALOG_SELECT(TEMP_4_PIN); + #if HAS_TEMP_3 + ANALOG_SELECT(TEMP_3_PIN); #endif - #if HAS_HEATED_BED - HAL_ANALOG_SELECT(TEMP_BED_PIN); + #if HAS_TEMP_4 + ANALOG_SELECT(TEMP_4_PIN); #endif - #if HAS_TEMP_CHAMBER - HAL_ANALOG_SELECT(TEMP_CHAMBER_PIN); + #if HAS_TEMP_BED + ANALOG_SELECT(TEMP_BED_PIN); #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) - HAL_ANALOG_SELECT(FILWIDTH_PIN); + ANALOG_SELECT(FILWIDTH_PIN); #endif - HAL_timer_start(TEMP_TIMER_NUM, TEMP_TIMER_FREQUENCY); - ENABLE_TEMPERATURE_INTERRUPT(); - #if HAS_AUTO_FAN_0 #if E0_AUTO_FAN_PIN == FAN1_PIN SET_OUTPUT(E0_AUTO_FAN_PIN); @@ -1235,16 +1173,11 @@ void Temperature::init() { SET_OUTPUT(E4_AUTO_FAN_PIN); #endif #endif - #if HAS_AUTO_CHAMBER_FAN && !AUTO_CHAMBER_IS_0 && !AUTO_CHAMBER_IS_1 && !AUTO_CHAMBER_IS_2 && !AUTO_CHAMBER_IS_3 && ! AUTO_CHAMBER_IS_4 - #if CHAMBER_AUTO_FAN_PIN == FAN1_PIN - SET_OUTPUT(CHAMBER_AUTO_FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(CHAMBER_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #else - SET_OUTPUT(CHAMBER_AUTO_FAN_PIN); - #endif - #endif + + // Use timer0 for temperature measurement + // Interleave temperature interrupt with millies interrupt + OCR0B = 128; + SBI(TIMSK0, OCIE0B); // Wait for temperature measurement to settle delay(250); @@ -1305,7 +1238,7 @@ void Temperature::init() { #endif // HOTENDS > 2 #endif // HOTENDS > 1 - #if HAS_HEATED_BED + #if HAS_TEMP_BED #ifdef BED_MINTEMP while (analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP @@ -1324,52 +1257,13 @@ void Temperature::init() { #endif } #endif // BED_MAXTEMP - #endif // HAS_HEATED_BED + #endif //HAS_TEMP_BED #if ENABLED(PROBING_HEATERS_OFF) paused = false; #endif } -#if ENABLED(FAST_PWM_FAN) - - void Temperature::setPwmFrequency(const pin_t pin, int val) { - val &= 0x07; - switch (digitalPinToTimer(pin)) { - #ifdef TCCR0A - #if !AVR_AT90USB1286_FAMILY - case TIMER0A: - #endif - case TIMER0B: //_SET_CS(0, val); - break; - #endif - #ifdef TCCR1A - case TIMER1A: case TIMER1B: //_SET_CS(1, val); - break; - #endif - #if defined(TCCR2) || defined(TCCR2A) - #ifdef TCCR2 - case TIMER2: - #endif - #ifdef TCCR2A - case TIMER2A: case TIMER2B: - #endif - _SET_CS(2, val); break; - #endif - #ifdef TCCR3A - case TIMER3A: case TIMER3B: case TIMER3C: _SET_CS(3, val); break; - #endif - #ifdef TCCR4A - case TIMER4A: case TIMER4B: case TIMER4C: _SET_CS(4, val); break; - #endif - #ifdef TCCR5A - case TIMER5A: case TIMER5B: case TIMER5C: _SET_CS(5, val); break; - #endif - } - } - -#endif // FAST_PWM_FAN - #if WATCH_HOTENDS /** * Start Heating Sanity Check for hotends that are below @@ -1417,7 +1311,7 @@ void Temperature::init() { millis_t Temperature::thermal_runaway_bed_timer; #endif - void Temperature::thermal_runaway_protection(Temperature::TRState * const state, millis_t * const timer, const float ¤t, const float &target, const int8_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc) { + void Temperature::thermal_runaway_protection(Temperature::TRState * const state, millis_t * const timer, const float current, const float target, const int8_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc) { static float tr_target_temperature[HOTENDS + 1] = { 0.0 }; @@ -1440,22 +1334,22 @@ void Temperature::init() { #if HEATER_IDLE_HANDLER // If the heater idle timeout expires, restart - if ((heater_id >= 0 && heater_idle_timeout_exceeded[heater_id]) - #if HAS_HEATED_BED - || (heater_id < 0 && bed_idle_timeout_exceeded) - #endif - ) { + if (heater_id >= 0 && heater_idle_timeout_exceeded[heater_id]) { *state = TRInactive; tr_target_temperature[heater_index] = 0; } + #if HAS_TEMP_BED + else if (heater_id < 0 && bed_idle_timeout_exceeded) { + *state = TRInactive; + tr_target_temperature[heater_index] = 0; + } + #endif else #endif - { - // If the target temperature changes, restart - if (tr_target_temperature[heater_index] != target) { - tr_target_temperature[heater_index] = target; - *state = target > 0 ? TRFirstHeating : TRInactive; - } + // If the target temperature changes, restart + if (tr_target_temperature[heater_index] != target) { + tr_target_temperature[heater_index] = target; + *state = target > 0 ? TRFirstHeating : TRInactive; } switch (*state) { @@ -1474,7 +1368,7 @@ void Temperature::init() { else if (PENDING(millis(), *timer)) break; *state = TRRunaway; case TRRunaway: - _temp_error(heater_id, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, heater_id)); + _temp_error(heater_id, PSTR(MSG_T_THERMAL_RUNAWAY), PSTR(MSG_THERMAL_RUNAWAY)); } } @@ -1487,10 +1381,7 @@ void Temperature::disable_all_heaters() { #endif HOTEND_LOOP() setTargetHotend(0, e); - - #if HAS_HEATED_BED - setTargetBed(0); - #endif + setTargetBed(0); // Unpause and reset everything #if ENABLED(PROBING_HEATERS_OFF) @@ -1522,10 +1413,10 @@ void Temperature::disable_all_heaters() { #endif // HOTENDS > 1 #endif - #if HAS_HEATED_BED + #if HAS_TEMP_BED target_temperature_bed = 0; soft_pwm_amount_bed = 0; - #if HAS_HEATED_BED + #if HAS_HEATER_BED WRITE_HEATER_BED(LOW); #endif #endif @@ -1538,13 +1429,13 @@ void Temperature::disable_all_heaters() { paused = p; if (p) { HOTEND_LOOP() start_heater_idle_timer(e, 0); // timeout immediately - #if HAS_HEATED_BED + #if HAS_TEMP_BED start_bed_idle_timer(0); // timeout immediately #endif } else { HOTEND_LOOP() reset_heater_idle_timer(e); - #if HAS_HEATED_BED + #if HAS_TEMP_BED reset_bed_idle_timer(); #endif } @@ -1590,7 +1481,9 @@ void Temperature::disable_all_heaters() { WRITE(MAX6675_SS, 0); // enable TT_MAX6675 - DELAY_NS(100); // Ensure 100ns delay + // ensure 100ns delay - a bit extra is fine + asm("nop");//50ns on 20Mhz, 62.5ns on 16Mhz + asm("nop");//50ns on 20Mhz, 62.5ns on 16Mhz // Read a big-endian temperature value max6675_temp = 0; @@ -1633,32 +1526,26 @@ void Temperature::disable_all_heaters() { * Get raw temperatures */ void Temperature::set_current_temp_raw() { - #if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675) + #if HAS_TEMP_0 && DISABLED(HEATER_0_USES_MAX6675) current_temperature_raw[0] = raw_temp_value[0]; #endif - #if HAS_TEMP_ADC_1 + #if HAS_TEMP_1 #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) redundant_temperature_raw = raw_temp_value[1]; #else current_temperature_raw[1] = raw_temp_value[1]; #endif - #if HAS_TEMP_ADC_2 + #if HAS_TEMP_2 current_temperature_raw[2] = raw_temp_value[2]; - #if HAS_TEMP_ADC_3 + #if HAS_TEMP_3 current_temperature_raw[3] = raw_temp_value[3]; - #if HAS_TEMP_ADC_4 + #if HAS_TEMP_4 current_temperature_raw[4] = raw_temp_value[4]; #endif #endif #endif #endif - - #if HAS_HEATED_BED - current_temperature_bed_raw = raw_temp_bed_value; - #endif - #if HAS_TEMP_CHAMBER - current_temperature_chamber_raw = raw_temp_chamber_value; - #endif + current_temperature_bed_raw = raw_temp_bed_value; temp_meas_ready = true; } @@ -1674,158 +1561,77 @@ void Temperature::set_current_temp_raw() { * */ void endstop_monitor() { - static uint16_t old_live_state_local = 0; + static uint16_t old_endstop_bits_local = 0; static uint8_t local_LED_status = 0; - uint16_t live_state_local = 0; + uint16_t current_endstop_bits_local = 0; #if HAS_X_MIN - if (READ(X_MIN_PIN)) SBI(live_state_local, X_MIN); + if (READ(X_MIN_PIN)) SBI(current_endstop_bits_local, X_MIN); #endif #if HAS_X_MAX - if (READ(X_MAX_PIN)) SBI(live_state_local, X_MAX); + if (READ(X_MAX_PIN)) SBI(current_endstop_bits_local, X_MAX); #endif #if HAS_Y_MIN - if (READ(Y_MIN_PIN)) SBI(live_state_local, Y_MIN); + if (READ(Y_MIN_PIN)) SBI(current_endstop_bits_local, Y_MIN); #endif #if HAS_Y_MAX - if (READ(Y_MAX_PIN)) SBI(live_state_local, Y_MAX); + if (READ(Y_MAX_PIN)) SBI(current_endstop_bits_local, Y_MAX); #endif #if HAS_Z_MIN - if (READ(Z_MIN_PIN)) SBI(live_state_local, Z_MIN); + if (READ(Z_MIN_PIN)) SBI(current_endstop_bits_local, Z_MIN); #endif #if HAS_Z_MAX - if (READ(Z_MAX_PIN)) SBI(live_state_local, Z_MAX); + if (READ(Z_MAX_PIN)) SBI(current_endstop_bits_local, Z_MAX); #endif #if HAS_Z_MIN_PROBE_PIN - if (READ(Z_MIN_PROBE_PIN)) SBI(live_state_local, Z_MIN_PROBE); + if (READ(Z_MIN_PROBE_PIN)) SBI(current_endstop_bits_local, Z_MIN_PROBE); #endif #if HAS_Z2_MIN - if (READ(Z2_MIN_PIN)) SBI(live_state_local, Z2_MIN); + if (READ(Z2_MIN_PIN)) SBI(current_endstop_bits_local, Z2_MIN); #endif #if HAS_Z2_MAX - if (READ(Z2_MAX_PIN)) SBI(live_state_local, Z2_MAX); + if (READ(Z2_MAX_PIN)) SBI(current_endstop_bits_local, Z2_MAX); #endif - uint16_t endstop_change = live_state_local ^ old_live_state_local; + uint16_t endstop_change = current_endstop_bits_local ^ old_endstop_bits_local; if (endstop_change) { #if HAS_X_MIN - if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR(" X_MIN:", !!TEST(live_state_local, X_MIN)); + if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR(" X_MIN:", !!TEST(current_endstop_bits_local, X_MIN)); #endif #if HAS_X_MAX - if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR(" X_MAX:", !!TEST(live_state_local, X_MAX)); + if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR(" X_MAX:", !!TEST(current_endstop_bits_local, X_MAX)); #endif #if HAS_Y_MIN - if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR(" Y_MIN:", !!TEST(live_state_local, Y_MIN)); + if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR(" Y_MIN:", !!TEST(current_endstop_bits_local, Y_MIN)); #endif #if HAS_Y_MAX - if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR(" Y_MAX:", !!TEST(live_state_local, Y_MAX)); + if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR(" Y_MAX:", !!TEST(current_endstop_bits_local, Y_MAX)); #endif #if HAS_Z_MIN - if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR(" Z_MIN:", !!TEST(live_state_local, Z_MIN)); + if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR(" Z_MIN:", !!TEST(current_endstop_bits_local, Z_MIN)); #endif #if HAS_Z_MAX - if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR(" Z_MAX:", !!TEST(live_state_local, Z_MAX)); + if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR(" Z_MAX:", !!TEST(current_endstop_bits_local, Z_MAX)); #endif #if HAS_Z_MIN_PROBE_PIN - if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR(" PROBE:", !!TEST(live_state_local, Z_MIN_PROBE)); + if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR(" PROBE:", !!TEST(current_endstop_bits_local, Z_MIN_PROBE)); #endif #if HAS_Z2_MIN - if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR(" Z2_MIN:", !!TEST(live_state_local, Z2_MIN)); + if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR(" Z2_MIN:", !!TEST(current_endstop_bits_local, Z2_MIN)); #endif #if HAS_Z2_MAX - if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR(" Z2_MAX:", !!TEST(live_state_local, Z2_MAX)); + if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR(" Z2_MAX:", !!TEST(current_endstop_bits_local, Z2_MAX)); #endif SERIAL_PROTOCOLPGM("\n\n"); analogWrite(LED_PIN, local_LED_status); local_LED_status ^= 255; - old_live_state_local = live_state_local; + old_endstop_bits_local = current_endstop_bits_local; } } #endif // PINS_DEBUGGING -#if ENABLED(FILAMENT_WIDTH_SENSOR) - uint32_t raw_filwidth_value; // = 0 -#endif - -void Temperature::readings_ready() { - // Update the raw values if they've been read. Else we could be updating them during reading. - if (!temp_meas_ready) set_current_temp_raw(); - - // Filament Sensor - can be read any time since IIR filtering is used - #if ENABLED(FILAMENT_WIDTH_SENSOR) - current_raw_filwidth = raw_filwidth_value >> 10; // Divide to get to 0-16384 range since we used 1/128 IIR filter approach - #endif - - ZERO(raw_temp_value); - - #if HAS_HEATED_BED - raw_temp_bed_value = 0; - #endif - - #if HAS_TEMP_CHAMBER - raw_temp_chamber_value = 0; - #endif - - #define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) > (HEATER_##N##_RAW_HI_TEMP) ? -1 : 1) - - int constexpr temp_dir[] = { - #if ENABLED(HEATER_0_USES_MAX6675) - 0 - #else - TEMPDIR(0) - #endif - #if HOTENDS > 1 - , TEMPDIR(1) - #if HOTENDS > 2 - , TEMPDIR(2) - #if HOTENDS > 3 - , TEMPDIR(3) - #if HOTENDS > 4 - , TEMPDIR(4) - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - }; - - for (uint8_t e = 0; e < COUNT(temp_dir); e++) { - const int16_t tdir = temp_dir[e], rawtemp = current_temperature_raw[e] * tdir; - const bool heater_on = (target_temperature[e] > 0) - #if ENABLED(PIDTEMP) - || (soft_pwm_amount[e] > 0) - #endif - ; - if (rawtemp > maxttemp_raw[e] * tdir) max_temp_error(e); - if (rawtemp < minttemp_raw[e] * tdir && !is_preheating(e) && heater_on) { - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - if (++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) - #endif - min_temp_error(e); - } - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - else - consecutive_low_temperature_error[e] = 0; - #endif - } - - #if HAS_HEATED_BED - #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP - #define GEBED <= - #else - #define GEBED >= - #endif - const bool bed_on = (target_temperature_bed > 0) - #if ENABLED(PIDTEMPBED) - || (soft_pwm_amount_bed > 0) - #endif - ; - if (current_temperature_bed_raw GEBED bed_maxttemp_raw) max_temp_error(-1); - if (bed_minttemp_raw GEBED current_temperature_bed_raw && bed_on) min_temp_error(-1); - #endif -} - /** - * Timer 0 is shared with millis so don't change the prescaler. + * Timer 0 is shared with millies so don't change the prescaler. * * This ISR uses the compare method so it runs at the base * frequency (16 MHz / 64 / 256 = 976.5625 Hz), but at the TCNT0 set @@ -1837,17 +1643,20 @@ void Temperature::readings_ready() { * - Step the babysteps value for each axis towards 0 * - For PINS_DEBUGGING, monitor and report endstop pins * - For ENDSTOP_INTERRUPTS_FEATURE check endstops if flagged - * - Call planner.tick to count down its "ignore" time */ -HAL_TEMP_TIMER_ISR { - HAL_timer_isr_prologue(TEMP_TIMER_NUM); +ISR(TIMER0_COMPB_vect) { Temperature::isr(); } - Temperature::isr(); - - HAL_timer_isr_epilogue(TEMP_TIMER_NUM); -} +volatile bool Temperature::in_temp_isr = false; void Temperature::isr() { + // The stepper ISR can interrupt this ISR. When it does it re-enables this ISR + // at the end of its run, potentially causing re-entry. This flag prevents it. + if (in_temp_isr) return; + in_temp_isr = true; + + // Allow UART and stepper ISRs + CBI(TIMSK0, OCIE0B); //Disable Temperature ISR + sei(); static int8_t temp_count = -1; static ADCSensorState adc_sensor_state = StartupDelay; @@ -1883,10 +1692,14 @@ void Temperature::isr() { #endif // HOTENDS > 3 #endif // HOTENDS > 2 #endif // HOTENDS > 1 - #if HAS_HEATED_BED + #if HAS_HEATER_BED ISR_STATICS(BED); #endif + #if ENABLED(FILAMENT_WIDTH_SENSOR) + static unsigned long raw_filwidth_value = 0; + #endif + #if DISABLED(SLOW_PWM_HEATERS) constexpr uint8_t pwm_mask = #if ENABLED(SOFT_PWM_DITHER) @@ -1920,7 +1733,7 @@ void Temperature::isr() { #endif // HOTENDS > 2 #endif // HOTENDS > 1 - #if HAS_HEATED_BED + #if HAS_HEATER_BED soft_pwm_count_BED = (soft_pwm_count_BED & pwm_mask) + soft_pwm_amount_bed; WRITE_HEATER_BED(soft_pwm_count_BED > pwm_mask ? HIGH : LOW); #endif @@ -1955,7 +1768,7 @@ void Temperature::isr() { #endif // HOTENDS > 2 #endif // HOTENDS > 1 - #if HAS_HEATED_BED + #if HAS_HEATER_BED if (soft_pwm_count_BED <= pwm_count_tmp) WRITE_HEATER_BED(LOW); #endif @@ -2036,7 +1849,7 @@ void Temperature::isr() { #endif // HOTENDS > 3 #endif // HOTENDS > 2 #endif // HOTENDS > 1 - #if HAS_HEATED_BED + #if HAS_HEATER_BED _SLOW_PWM_ROUTINE(BED, soft_pwm_amount_bed); // BED #endif @@ -2055,7 +1868,7 @@ void Temperature::isr() { #endif // HOTENDS > 3 #endif // HOTENDS > 2 #endif // HOTENDS > 1 - #if HAS_HEATED_BED + #if HAS_HEATER_BED PWM_OFF_ROUTINE(BED); // BED #endif @@ -2115,7 +1928,7 @@ void Temperature::isr() { #endif // HOTENDS > 3 #endif // HOTENDS > 2 #endif // HOTENDS > 1 - #if HAS_HEATED_BED + #if HAS_HEATER_BED if (state_timer_heater_BED > 0) state_timer_heater_BED--; #endif } // ((pwm_count >> SOFT_PWM_SCALE) & 0x3F) == 0 @@ -2137,12 +1950,13 @@ void Temperature::isr() { * * This gives each ADC 0.9765ms to charge up. */ - #define ACCUMULATE_ADC(var) do{ \ - if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; \ - else var += HAL_READ_ADC(); \ - }while(0) - ADCSensorState next_sensor_state = adc_sensor_state < SensorsReady ? (ADCSensorState)(int(adc_sensor_state) + 1) : StartSampling; + #define SET_ADMUX_ADCSRA(pin) ADMUX = _BV(REFS0) | (pin & 0x07); SBI(ADCSRA, ADSC) + #ifdef MUX5 + #define START_ADC(pin) if (pin > 7) ADCSRB = _BV(MUX5); else ADCSRB = 0; SET_ADMUX_ADCSRA(pin) + #else + #define START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin) + #endif switch (adc_sensor_state) { @@ -2152,110 +1966,88 @@ void Temperature::isr() { constexpr int8_t extra_loops = MIN_ADC_ISR_LOOPS - (int8_t)SensorsReady; static uint8_t delay_count = 0; if (extra_loops > 0) { - if (delay_count == 0) delay_count = extra_loops; // Init this delay - if (--delay_count) // While delaying... - next_sensor_state = SensorsReady; // retain this state (else, next state will be 0) + if (delay_count == 0) delay_count = extra_loops; // Init this delay + if (--delay_count) // While delaying... + adc_sensor_state = (ADCSensorState)(int(SensorsReady) - 1); // retain this state (else, next state will be 0) break; } - else { - adc_sensor_state = StartSampling; // Fall-through to start sampling - next_sensor_state = (ADCSensorState)(int(StartSampling) + 1); - } + else + adc_sensor_state = (ADCSensorState)0; // Fall-through to start first sensor now } - case StartSampling: // Start of sampling loops. Do updates/checks. - if (++temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256) = 164ms. - temp_count = 0; - readings_ready(); - } - break; - - #if HAS_TEMP_ADC_0 + #if HAS_TEMP_0 case PrepareTemp_0: - HAL_START_ADC(TEMP_0_PIN); + START_ADC(TEMP_0_PIN); break; case MeasureTemp_0: - ACCUMULATE_ADC(raw_temp_value[0]); + raw_temp_value[0] += ADC; break; #endif - #if HAS_HEATED_BED + #if HAS_TEMP_BED case PrepareTemp_BED: - HAL_START_ADC(TEMP_BED_PIN); + START_ADC(TEMP_BED_PIN); break; case MeasureTemp_BED: - ACCUMULATE_ADC(raw_temp_bed_value); + raw_temp_bed_value += ADC; break; #endif - #if HAS_TEMP_CHAMBER - case PrepareTemp_CHAMBER: - HAL_START_ADC(TEMP_CHAMBER_PIN); - break; - case MeasureTemp_CHAMBER: - ACCUMULATE_ADC(raw_temp_chamber_value); - break; - #endif - - #if HAS_TEMP_ADC_1 + #if HAS_TEMP_1 case PrepareTemp_1: - HAL_START_ADC(TEMP_1_PIN); + START_ADC(TEMP_1_PIN); break; case MeasureTemp_1: - ACCUMULATE_ADC(raw_temp_value[1]); + raw_temp_value[1] += ADC; break; #endif - #if HAS_TEMP_ADC_2 + #if HAS_TEMP_2 case PrepareTemp_2: - HAL_START_ADC(TEMP_2_PIN); + START_ADC(TEMP_2_PIN); break; case MeasureTemp_2: - ACCUMULATE_ADC(raw_temp_value[2]); + raw_temp_value[2] += ADC; break; #endif - #if HAS_TEMP_ADC_3 + #if HAS_TEMP_3 case PrepareTemp_3: - HAL_START_ADC(TEMP_3_PIN); + START_ADC(TEMP_3_PIN); break; case MeasureTemp_3: - ACCUMULATE_ADC(raw_temp_value[3]); + raw_temp_value[3] += ADC; break; #endif - #if HAS_TEMP_ADC_4 + #if HAS_TEMP_4 case PrepareTemp_4: - HAL_START_ADC(TEMP_4_PIN); + START_ADC(TEMP_4_PIN); break; case MeasureTemp_4: - ACCUMULATE_ADC(raw_temp_value[4]); + raw_temp_value[4] += ADC; break; #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) case Prepare_FILWIDTH: - HAL_START_ADC(FILWIDTH_PIN); + START_ADC(FILWIDTH_PIN); break; case Measure_FILWIDTH: - if (!HAL_ADC_READY()) - next_sensor_state = adc_sensor_state; // redo this state - else if (HAL_READ_ADC() > 102) { // Make sure ADC is reading > 0.5 volts, otherwise don't read. - raw_filwidth_value -= raw_filwidth_value >> 7; // Subtract 1/128th of the raw_filwidth_value - raw_filwidth_value += uint32_t(HAL_READ_ADC()) << 7; // Add new ADC reading, scaled by 128 + if (ADC > 102) { // Make sure ADC is reading > 0.5 volts, otherwise don't read. + raw_filwidth_value -= (raw_filwidth_value >> 7); // Subtract 1/128th of the raw_filwidth_value + raw_filwidth_value += ((unsigned long)ADC << 7); // Add new ADC reading, scaled by 128 } break; #endif #if ENABLED(ADC_KEYPAD) case Prepare_ADC_KEY: - HAL_START_ADC(ADC_KEYPAD_PIN); + START_ADC(ADC_KEYPAD_PIN); break; case Measure_ADC_KEY: - if (!HAL_ADC_READY()) - next_sensor_state = adc_sensor_state; // redo this state - else if (ADCKey_count < 16) { - raw_ADCKey_value = HAL_READ_ADC(); + if (ADCKey_count < 16) { + raw_ADCKey_value = ADC; if (raw_ADCKey_value > 900) { //ADC Key release ADCKey_count = 0; @@ -2273,12 +2065,87 @@ void Temperature::isr() { } // switch(adc_sensor_state) - // Go to the next state - adc_sensor_state = next_sensor_state; + if (!adc_sensor_state && ++temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256) = 164ms. - // - // Additional ~1KHz Tasks - // + temp_count = 0; + + // Update the raw values if they've been read. Else we could be updating them during reading. + if (!temp_meas_ready) set_current_temp_raw(); + + // Filament Sensor - can be read any time since IIR filtering is used + #if ENABLED(FILAMENT_WIDTH_SENSOR) + current_raw_filwidth = raw_filwidth_value >> 10; // Divide to get to 0-16384 range since we used 1/128 IIR filter approach + #endif + + ZERO(raw_temp_value); + raw_temp_bed_value = 0; + + #define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) > (HEATER_##N##_RAW_HI_TEMP) ? -1 : 1) + + int constexpr temp_dir[] = { + #if ENABLED(HEATER_0_USES_MAX6675) + 0 + #else + TEMPDIR(0) + #endif + #if HOTENDS > 1 + , TEMPDIR(1) + #if HOTENDS > 2 + , TEMPDIR(2) + #if HOTENDS > 3 + , TEMPDIR(3) + #if HOTENDS > 4 + , TEMPDIR(4) + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 + }; + + for (uint8_t e = 0; e < COUNT(temp_dir); e++) { + const int16_t tdir = temp_dir[e], rawtemp = current_temperature_raw[e] * tdir; + const bool heater_on = 0 < + #if ENABLED(PIDTEMP) + soft_pwm_amount[e] + #else + target_temperature[e] + #endif + ; + if (rawtemp > maxttemp_raw[e] * tdir && heater_on) max_temp_error(e); + if (rawtemp < minttemp_raw[e] * tdir && !is_preheating(e) && heater_on) { + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + if (++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) + #endif + min_temp_error(e); + } + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + else + consecutive_low_temperature_error[e] = 0; + #endif + } + + #if HAS_TEMP_BED + #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP + #define GEBED <= + #else + #define GEBED >= + #endif + const bool bed_on = 0 < + #if ENABLED(PIDTEMPBED) + soft_pwm_amount_bed + #else + target_temperature_bed + #endif + ; + if (current_temperature_bed_raw GEBED bed_maxttemp_raw && bed_on) max_temp_error(-1); + if (bed_minttemp_raw GEBED current_temperature_bed_raw && bed_on) min_temp_error(-1); + #endif + + } // temp_count >= OVERSAMPLENR + + // Go to the next state, up to SensorsReady + adc_sensor_state = (ADCSensorState)(int(adc_sensor_state) + 1); + if (adc_sensor_state > SensorsReady) adc_sensor_state = (ADCSensorState)0; #if ENABLED(BABYSTEPPING) LOOP_XYZ(axis) { @@ -2291,30 +2158,47 @@ void Temperature::isr() { } #endif // BABYSTEPPING - // Poll endstops state, if required - endstops.poll(); + #if ENABLED(PINS_DEBUGGING) + extern bool endstop_monitor_flag; + // run the endstop monitor at 15Hz + static uint8_t endstop_monitor_count = 16; // offset this check from the others + if (endstop_monitor_flag) { + endstop_monitor_count += _BV(1); // 15 Hz + endstop_monitor_count &= 0x7F; + if (!endstop_monitor_count) endstop_monitor(); // report changes in endstop status + } + #endif - // Periodically call the planner timer - planner.tick(); + #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) + + extern volatile uint8_t e_hit; + + if (e_hit && ENDSTOPS_ENABLED) { + endstops.update(); // call endstop update routine + e_hit--; + } + #endif + + cli(); + in_temp_isr = false; + SBI(TIMSK0, OCIE0B); //re-enable Temperature ISR } -#if HAS_TEMP_SENSOR +#if HAS_TEMP_HOTEND || HAS_TEMP_BED void print_heater_state(const float &c, const float &t, #if ENABLED(SHOW_TEMP_ADC_VALUES) const float r, #endif - const int8_t e=-3 + const int8_t e=-2 ) { - #if !(HAS_HEATED_BED && HAS_TEMP_HOTEND && HAS_TEMP_CHAMBER) && HOTENDS <= 1 + #if !(HAS_TEMP_BED && HAS_TEMP_HOTEND) && HOTENDS <= 1 UNUSED(e); #endif SERIAL_PROTOCOLCHAR(' '); SERIAL_PROTOCOLCHAR( - #if HAS_TEMP_CHAMBER && HAS_HEATED_BED && HAS_TEMP_HOTEND - e == -2 ? 'C' : e == -1 ? 'B' : 'T' - #elif HAS_HEATED_BED && HAS_TEMP_HOTEND + #if HAS_TEMP_BED && HAS_TEMP_HOTEND e == -1 ? 'B' : 'T' #elif HAS_TEMP_HOTEND 'T' @@ -2332,7 +2216,6 @@ void Temperature::isr() { SERIAL_PROTOCOLPAIR(" (", r / OVERSAMPLENR); SERIAL_PROTOCOLCHAR(')'); #endif - delay(2); } extern uint8_t target_extruder; @@ -2345,7 +2228,7 @@ void Temperature::isr() { #endif ); #endif - #if HAS_HEATED_BED + #if HAS_TEMP_BED print_heater_state(degBed(), degTargetBed() #if ENABLED(SHOW_TEMP_ADC_VALUES) , rawBedTemp() @@ -2353,14 +2236,6 @@ void Temperature::isr() { , -1 // BED ); #endif - #if HAS_TEMP_CHAMBER - print_heater_state(degChamber(), 0 - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawChamberTemp() - #endif - , -2 // CHAMBER - ); - #endif #if HOTENDS > 1 HOTEND_LOOP() print_heater_state(degHotend(e), degTargetHotend(e) #if ENABLED(SHOW_TEMP_ADC_VALUES) @@ -2371,7 +2246,7 @@ void Temperature::isr() { #endif SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOL(getHeaterPower(target_extruder)); - #if HAS_HEATED_BED + #if HAS_TEMP_BED SERIAL_PROTOCOLPGM(" B@:"); SERIAL_PROTOCOL(getHeaterPower(-1)); #endif @@ -2399,4 +2274,4 @@ void Temperature::isr() { #endif // AUTO_REPORT_TEMPERATURES -#endif // HAS_TEMP_SENSOR +#endif // HAS_TEMP_HOTEND || HAS_TEMP_BED diff --git a/Marlin/temperature.h b/Marlin/temperature.h index cc6df0b..95db0f6 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -31,10 +31,6 @@ #include "MarlinConfig.h" -#if ENABLED(AUTO_POWER_CONTROL) - #include "power.h" -#endif - #if ENABLED(PID_EXTRUSION_SCALING) #include "stepper.h" #endif @@ -43,51 +39,44 @@ #define SOFT_PWM_SCALE 0 #endif -#define ENABLE_TEMPERATURE_INTERRUPT() SBI(TIMSK0, OCIE0B) -#define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0B) -#define TEMPERATURE_ISR_ENABLED() TEST(TIMSK0, OCIE0B) - #define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++) #if HOTENDS == 1 #define HOTEND_INDEX 0 + #define EXTRUDER_IDX 0 #else #define HOTEND_INDEX e + #define EXTRUDER_IDX active_extruder #endif /** * States for ADC reading in the ISR */ -enum ADCSensorState : char { - StartSampling, - #if HAS_TEMP_ADC_0 +enum ADCSensorState { + #if HAS_TEMP_0 PrepareTemp_0, MeasureTemp_0, #endif - #if HAS_TEMP_ADC_1 + #if HAS_TEMP_1 PrepareTemp_1, MeasureTemp_1, #endif - #if HAS_TEMP_ADC_2 + #if HAS_TEMP_2 PrepareTemp_2, MeasureTemp_2, #endif - #if HAS_TEMP_ADC_3 + #if HAS_TEMP_3 PrepareTemp_3, MeasureTemp_3, #endif - #if HAS_TEMP_ADC_4 + #if HAS_TEMP_4 PrepareTemp_4, MeasureTemp_4, #endif - #if HAS_HEATED_BED + #if HAS_TEMP_BED PrepareTemp_BED, MeasureTemp_BED, #endif - #if HAS_TEMP_CHAMBER - PrepareTemp_CHAMBER, - MeasureTemp_CHAMBER, - #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) Prepare_FILWIDTH, Measure_FILWIDTH, @@ -105,32 +94,42 @@ enum ADCSensorState : char { // get all oversampled sensor readings #define MIN_ADC_ISR_LOOPS 10 -#define ACTUAL_ADC_SAMPLES MAX(int(MIN_ADC_ISR_LOOPS), int(SensorsReady)) +#define ACTUAL_ADC_SAMPLES max(int(MIN_ADC_ISR_LOOPS), int(SensorsReady)) #if HAS_PID_HEATING - #define PID_K2 (1.0f-PID_K1) - #define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (F_CPU / 64.0f / 256.0f)) + #define PID_K2 (1.0-PID_K1) + #define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (F_CPU / 64.0 / 256.0)) // Apply the scale factors to the PID values - #define scalePID_i(i) ( (i) * float(PID_dT) ) - #define unscalePID_i(i) ( (i) / float(PID_dT) ) - #define scalePID_d(d) ( (d) / float(PID_dT) ) - #define unscalePID_d(d) ( (d) * float(PID_dT) ) + #define scalePID_i(i) ( (i) * PID_dT ) + #define unscalePID_i(i) ( (i) / PID_dT ) + #define scalePID_d(d) ( (d) / PID_dT ) + #define unscalePID_d(d) ( (d) * PID_dT ) +#endif + +#if !HAS_HEATER_BED + constexpr int16_t target_temperature_bed = 0; #endif class Temperature { public: - static float current_temperature[HOTENDS]; + static float current_temperature[HOTENDS], + current_temperature_bed; static int16_t current_temperature_raw[HOTENDS], - target_temperature[HOTENDS]; - static uint8_t soft_pwm_amount[HOTENDS]; + target_temperature[HOTENDS], + current_temperature_bed_raw; - #if ENABLED(AUTO_POWER_E_FANS) - static int16_t autofan_speed[HOTENDS]; + #if HAS_HEATER_BED + static int16_t target_temperature_bed; #endif + static volatile bool in_temp_isr; + + static uint8_t soft_pwm_amount[HOTENDS], + soft_pwm_amount_bed; + #if ENABLED(FAN_SOFT_PWM) static uint8_t soft_pwm_amount_fan[FAN_COUNT], soft_pwm_count_fan[FAN_COUNT]; @@ -158,58 +157,46 @@ class Temperature { #endif - #if HAS_HEATED_BED - static float current_temperature_bed; - static int16_t current_temperature_bed_raw, target_temperature_bed; - static uint8_t soft_pwm_amount_bed; - #if ENABLED(PIDTEMPBED) - static float bedKp, bedKi, bedKd; - #endif + #if ENABLED(PIDTEMPBED) + static float bedKp, bedKi, bedKd; #endif #if ENABLED(BABYSTEPPING) static volatile int babystepsTodo[3]; #endif - #if ENABLED(PREVENT_COLD_EXTRUSION) - static bool allow_cold_extrude; - static int16_t extrude_min_temp; - FORCE_INLINE static bool tooCold(const int16_t temp) { return allow_cold_extrude ? false : temp < extrude_min_temp; } - FORCE_INLINE static bool tooColdToExtrude(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return tooCold(degHotend(HOTEND_INDEX)); - } - FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return tooCold(degTargetHotend(HOTEND_INDEX)); - } - #else - FORCE_INLINE static bool tooColdToExtrude(const uint8_t e) { UNUSED(e); return false; } - FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t e) { UNUSED(e); return false; } - #endif - - FORCE_INLINE static bool hotEnoughToExtrude(const uint8_t e) { return !tooColdToExtrude(e); } - FORCE_INLINE static bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); } - - private: - - static volatile bool temp_meas_ready; - static uint16_t raw_temp_value[MAX_EXTRUDERS]; - #if WATCH_HOTENDS static uint16_t watch_target_temp[HOTENDS]; static millis_t watch_heater_next_ms[HOTENDS]; #endif + #if WATCH_THE_BED + static uint16_t watch_target_bed_temp; + static millis_t watch_bed_next_ms; + #endif + + #if ENABLED(PREVENT_COLD_EXTRUSION) + static bool allow_cold_extrude; + static int16_t 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 + + private: + #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) static uint16_t redundant_temperature_raw; static float redundant_temperature; #endif + static volatile bool temp_meas_ready; + #if ENABLED(PIDTEMP) static float temp_iState[HOTENDS], temp_dState[HOTENDS], @@ -228,46 +215,26 @@ class Temperature { static bool pid_reset[HOTENDS]; #endif + #if ENABLED(PIDTEMPBED) + static float temp_iState_bed, + temp_dState_bed, + pTerm_bed, + iTerm_bed, + dTerm_bed, + pid_error_bed; + #else + static millis_t next_bed_check_ms; + #endif + + static uint16_t raw_temp_value[MAX_EXTRUDERS], + raw_temp_bed_value; + // Init min and max temp with extreme values to prevent false errors during startup static int16_t minttemp_raw[HOTENDS], maxttemp_raw[HOTENDS], minttemp[HOTENDS], maxttemp[HOTENDS]; - #if HAS_HEATED_BED - static uint16_t raw_temp_bed_value; - #if WATCH_THE_BED - static uint16_t watch_target_bed_temp; - static millis_t watch_bed_next_ms; - #endif - #if ENABLED(PIDTEMPBED) - static float temp_iState_bed, - temp_dState_bed, - pTerm_bed, - iTerm_bed, - dTerm_bed, - pid_error_bed; - #else - static millis_t next_bed_check_ms; - #endif - #if HEATER_IDLE_HANDLER - static millis_t bed_idle_timeout_ms; - static bool bed_idle_timeout_exceeded; - #endif - #ifdef BED_MINTEMP - static int16_t bed_minttemp_raw; - #endif - #ifdef BED_MAXTEMP - static int16_t bed_maxttemp_raw; - #endif - #endif - - #if HAS_TEMP_CHAMBER - static uint16_t raw_temp_chamber_value; - static float current_temperature_chamber; - static int16_t current_temperature_chamber_raw; - #endif - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED static uint8_t consecutive_low_temperature_error[HOTENDS]; #endif @@ -276,6 +243,14 @@ class Temperature { static millis_t preheat_end_time[HOTENDS]; #endif + #ifdef BED_MINTEMP + static int16_t bed_minttemp_raw; + #endif + + #ifdef BED_MAXTEMP + static int16_t bed_maxttemp_raw; + #endif + #if ENABLED(FILAMENT_WIDTH_SENSOR) static int8_t meas_shift_index; // Index of a delayed sample in buffer #endif @@ -295,6 +270,10 @@ class Temperature { #if HEATER_IDLE_HANDLER static millis_t heater_idle_timeout_ms[HOTENDS]; static bool heater_idle_timeout_exceeded[HOTENDS]; + #if HAS_TEMP_BED + static millis_t bed_idle_timeout_ms; + static bool bed_idle_timeout_exceeded; + #endif #endif public: @@ -303,10 +282,6 @@ class Temperature { static uint8_t ADCKey_count; #endif - #if ENABLED(PID_EXTRUSION_SCALING) - static int16_t lpq_len; - #endif - /** * Instance Methods */ @@ -320,17 +295,13 @@ class Temperature { */ static float analog2temp(const int raw, const uint8_t e); - #if HAS_HEATED_BED + #if HAS_TEMP_BED static float analog2tempBed(const int raw); #endif - #if HAS_TEMP_CHAMBER - static float analog2tempChamber(const int raw); - #endif /** * Called from the Temperature ISR */ - static void readings_ready(); static void isr(); /** @@ -342,19 +313,19 @@ class Temperature { * Preheating hotends */ #ifdef MILLISECONDS_PREHEAT_TIME - static bool is_preheating(const uint8_t e) { + 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(const uint8_t e) { + 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(const uint8_t e) { + static void reset_preheat_time(uint8_t e) { #if HOTENDS == 1 UNUSED(e); #endif @@ -374,33 +345,41 @@ class Temperature { //inline so that there is no performance decrease. //deg=degreeCelsius - FORCE_INLINE static float degHotend(const uint8_t e) { + 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) - FORCE_INLINE static int16_t rawHotendTemp(const uint8_t e) { + static int16_t rawHotendTemp(uint8_t e) { #if HOTENDS == 1 UNUSED(e); #endif return current_temperature_raw[HOTEND_INDEX]; } + static int16_t rawBedTemp() { return current_temperature_bed_raw; } #endif - FORCE_INLINE static int16_t degTargetHotend(const uint8_t e) { + static int16_t degTargetHotend(uint8_t e) { #if HOTENDS == 1 UNUSED(e); #endif return target_temperature[HOTEND_INDEX]; } + static int16_t degTargetBed() { return target_temperature_bed; } + #if WATCH_HOTENDS static void start_watching_heater(const uint8_t e = 0); #endif + #if WATCH_THE_BED + static void start_watching_bed(); + #endif + static void setTargetHotend(const int16_t celsius, const uint8_t e) { #if HOTENDS == 1 UNUSED(e); @@ -411,45 +390,17 @@ class Temperature { else if (target_temperature[HOTEND_INDEX] == 0) start_preheat_time(HOTEND_INDEX); #endif - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif target_temperature[HOTEND_INDEX] = celsius; #if WATCH_HOTENDS start_watching_heater(HOTEND_INDEX); #endif } - FORCE_INLINE static bool isHeatingHotend(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return target_temperature[HOTEND_INDEX] > current_temperature[HOTEND_INDEX]; - } - - FORCE_INLINE static bool isCoolingHotend(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return target_temperature[HOTEND_INDEX] < current_temperature[HOTEND_INDEX]; - } - - #if HAS_HEATED_BED - #if ENABLED(SHOW_TEMP_ADC_VALUES) - FORCE_INLINE static int16_t rawBedTemp() { return current_temperature_bed_raw; } - #endif - FORCE_INLINE static float degBed() { return current_temperature_bed; } - FORCE_INLINE static int16_t degTargetBed() { return target_temperature_bed; } - FORCE_INLINE static bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; } - FORCE_INLINE static bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; } - - static void setTargetBed(const int16_t celsius) { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif + static void setTargetBed(const int16_t celsius) { + #if HAS_HEATER_BED target_temperature_bed = #ifdef BED_MAXTEMP - MIN(celsius, BED_MAXTEMP) + min(celsius, BED_MAXTEMP) #else celsius #endif @@ -457,28 +408,29 @@ class Temperature { #if WATCH_THE_BED start_watching_bed(); #endif - } - - #if WATCH_THE_BED - static void start_watching_bed(); #endif - #endif - - #if HAS_TEMP_CHAMBER - #if ENABLED(SHOW_TEMP_ADC_VALUES) - FORCE_INLINE static int16_t rawChamberTemp() { return current_temperature_chamber_raw; } - #endif - FORCE_INLINE static float degChamber() { return current_temperature_chamber; } - #endif - - FORCE_INLINE static bool wait_for_heating(const uint8_t e) { - return degTargetHotend(e) > TEMP_HYSTERESIS && ABS(degHotend(e) - degTargetHotend(e)) > TEMP_HYSTERESIS; } + 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 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; } + /** * The software PWM power for a heater */ - static int getHeaterPower(const int heater); + static int getHeaterPower(int heater); /** * Switch off all heaters, set all target temperatures to 0 @@ -489,7 +441,7 @@ class Temperature { * Perform auto-tuning for hotend or bed in response to M303 */ #if HAS_PID_HEATING - static void PID_autotune(const float &target, const int8_t hotend, const int8_t ncycles, const bool set_result=false); + static void PID_autotune(const float temp, const int8_t hotend, const int8_t ncycles, const bool set_result=false); /** * Update the temp manager when PID values change @@ -507,7 +459,7 @@ class Temperature { #if ENABLED(BABYSTEPPING) static void babystep_axis(const AxisEnum axis, const int16_t distance) { - if (TEST(axis_known_position, axis)) { + if (axis_known_position[axis]) { #if IS_CORE #if ENABLED(BABYSTEP_XY) switch (axis) { @@ -540,12 +492,11 @@ class Temperature { #if ENABLED(PROBING_HEATERS_OFF) static void pause(const bool p); - FORCE_INLINE static bool is_paused() { return paused; } + static bool is_paused() { return paused; } #endif #if HEATER_IDLE_HANDLER - - static void start_heater_idle_timer(const uint8_t e, const millis_t timeout_ms) { + static void start_heater_idle_timer(uint8_t e, millis_t timeout_ms) { #if HOTENDS == 1 UNUSED(e); #endif @@ -553,7 +504,7 @@ class Temperature { heater_idle_timeout_exceeded[HOTEND_INDEX] = false; } - static void reset_heater_idle_timer(const uint8_t e) { + static void reset_heater_idle_timer(uint8_t e) { #if HOTENDS == 1 UNUSED(e); #endif @@ -564,15 +515,15 @@ class Temperature { #endif } - FORCE_INLINE static bool is_heater_idle(const uint8_t e) { + static bool is_heater_idle(uint8_t e) { #if HOTENDS == 1 UNUSED(e); #endif return heater_idle_timeout_exceeded[HOTEND_INDEX]; } - #if HAS_HEATED_BED - static void start_bed_idle_timer(const millis_t timeout_ms) { + #if HAS_TEMP_BED + static void start_bed_idle_timer(millis_t timeout_ms) { bed_idle_timeout_ms = millis() + timeout_ms; bed_idle_timeout_exceeded = false; } @@ -585,12 +536,13 @@ class Temperature { #endif } - FORCE_INLINE static bool is_bed_idle() { return bed_idle_timeout_exceeded; } + static bool is_bed_idle() { + return bed_idle_timeout_exceeded; + } #endif + #endif - #endif // HEATER_IDLE_HANDLER - - #if HAS_TEMP_SENSOR + #if HAS_TEMP_HOTEND || HAS_TEMP_BED static void print_heaterstates(); #if ENABLED(AUTO_REPORT_TEMPERATURES) static uint8_t auto_report_temp_interval; @@ -606,10 +558,6 @@ class Temperature { private: - #if ENABLED(FAST_PWM_FAN) - static void setPwmFrequency(const pin_t pin, int val); - #endif - static void set_current_temp_raw(); static void updateTemperaturesFromRawValues(); @@ -632,9 +580,9 @@ class Temperature { #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED - enum TRState : char { TRInactive, TRFirstHeating, TRStable, TRRunaway }; + typedef enum TRState { TRInactive, TRFirstHeating, TRStable, TRRunaway } TRstate; - static void thermal_runaway_protection(TRState * const state, millis_t * const timer, const float ¤t, const float &target, const int8_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc); + static void thermal_runaway_protection(TRState * const state, millis_t * const timer, const float current, const float target, const int8_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc); #if ENABLED(THERMAL_PROTECTION_HOTENDS) static TRState thermal_runaway_state_machine[HOTENDS]; diff --git a/Marlin/thermistornames.h b/Marlin/thermistornames.h index c26a1fe..2e672a4 100644 --- a/Marlin/thermistornames.h +++ b/Marlin/thermistornames.h @@ -23,9 +23,7 @@ #undef THERMISTOR_NAME // Thermcouples -#if THERMISTOR_ID == -4 - #define THERMISTOR_NAME "AD8495" -#elif THERMISTOR_ID == -3 +#if THERMISTOR_ID == -3 #define THERMISTOR_NAME "MAX31855" #elif THERMISTOR_ID == -2 #define THERMISTOR_NAME "MAX6675" @@ -46,11 +44,11 @@ #elif THERMISTOR_ID == 6 #define THERMISTOR_NAME "EPCOS (alt)" #elif THERMISTOR_ID == 7 - #define THERMISTOR_NAME "Honeywell 104LAG" + #define THERMISTOR_NAME "HW 104LAG" #elif THERMISTOR_ID == 71 - #define THERMISTOR_NAME "Honeywell 104LAF" + #define THERMISTOR_NAME "HW 104LAF" #elif THERMISTOR_ID == 8 - #define THERMISTOR_NAME "E3104FHT" + #define THERMISTOR_NAME "E3104FXT" #elif THERMISTOR_ID == 9 #define THERMISTOR_NAME "GE AL03006" #elif THERMISTOR_ID == 10 @@ -58,9 +56,9 @@ #elif THERMISTOR_ID == 11 #define THERMISTOR_NAME "1% beta 3950" #elif THERMISTOR_ID == 12 - #define THERMISTOR_NAME "Unknown" + #define THERMISTOR_NAME "E3104FXT (alt)" #elif THERMISTOR_ID == 13 - #define THERMISTOR_NAME "Hisens" + #define THERMISTOR_NAME "Hisens 3950" #elif THERMISTOR_ID == 20 #define THERMISTOR_NAME "PT100 UltiMB" #elif THERMISTOR_ID == 60 diff --git a/Marlin/thermistortable_1.h b/Marlin/thermistortable_1.h index ea88795..c3395a5 100644 --- a/Marlin/thermistortable_1.h +++ b/Marlin/thermistortable_1.h @@ -20,7 +20,7 @@ * */ -// R25 = 100 kOhm, beta25 = 4092 K, 4.7 kOhm pull-up, bed thermistor +// 100k bed thermistor const short temptable_1[][2] PROGMEM = { { OV( 23), 300 }, { OV( 25), 295 }, diff --git a/Marlin/thermistortable_10.h b/Marlin/thermistortable_10.h index b54425f..2a49d6b 100644 --- a/Marlin/thermistortable_10.h +++ b/Marlin/thermistortable_10.h @@ -20,7 +20,7 @@ * */ -// R25 = 100 kOhm, beta25 = 3960 K, 4.7 kOhm pull-up, RS thermistor 198-961 +// 100k RS thermistor 198-961 (4.7k pullup) const short temptable_10[][2] PROGMEM = { { OV( 1), 929 }, { OV( 36), 299 }, diff --git a/Marlin/thermistortable_11.h b/Marlin/thermistortable_11.h index eb80306..cc5715b 100644 --- a/Marlin/thermistortable_11.h +++ b/Marlin/thermistortable_11.h @@ -20,7 +20,7 @@ * */ -// R25 = 100 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, QU-BD silicone bed QWG-104F-3950 thermistor +// QU-BD silicone bed QWG-104F-3950 thermistor const short temptable_11[][2] PROGMEM = { { OV( 1), 938 }, { OV( 31), 314 }, diff --git a/Marlin/thermistortable_12.h b/Marlin/thermistortable_12.h index c05ba40..aff539e 100644 --- a/Marlin/thermistortable_12.h +++ b/Marlin/thermistortable_12.h @@ -20,7 +20,7 @@ * */ -// R25 = 100 kOhm, beta25 = 4700 K, 4.7 kOhm pull-up, (personal calibration for Makibox hot bed) +// 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) const short temptable_12[][2] PROGMEM = { { OV( 35), 180 }, // top rating 180C { OV( 211), 140 }, diff --git a/Marlin/thermistortable_13.h b/Marlin/thermistortable_13.h index b0bfd8a..b4d827e 100644 --- a/Marlin/thermistortable_13.h +++ b/Marlin/thermistortable_13.h @@ -20,7 +20,7 @@ * */ -// R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, Hisens thermistor +// Hisens thermistor B25/50 =3950 +/-1% const short temptable_13[][2] PROGMEM = { { OV( 20.04), 300 }, { OV( 23.19), 290 }, diff --git a/Marlin/thermistortable_2.h b/Marlin/thermistortable_2.h index e747b2f..03c2d39 100644 --- a/Marlin/thermistortable_2.h +++ b/Marlin/thermistortable_2.h @@ -21,7 +21,7 @@ */ // -// R25 = 200 kOhm, beta25 = 4338 K, 4.7 kOhm pull-up, ATC Semitec 204GT-2 +// 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 // diff --git a/Marlin/thermistortable_20.h b/Marlin/thermistortable_20.h index 1cd9480..5a01f78 100644 --- a/Marlin/thermistortable_20.h +++ b/Marlin/thermistortable_20.h @@ -47,10 +47,6 @@ #define HEATER_BED_RAW_HI_TEMP 16383 #define HEATER_BED_RAW_LO_TEMP 0 #endif -#if THERMISTORCHAMBER == 20 - #define HEATER_CHAMBER_RAW_HI_TEMP 16383 - #define HEATER_CHAMBER_RAW_LO_TEMP 0 -#endif const short temptable_20[][2] PROGMEM = { { OV( 0), 0 }, { OV(227), 1 }, diff --git a/Marlin/thermistortable_3.h b/Marlin/thermistortable_3.h index a82a9b6..3a5a014 100644 --- a/Marlin/thermistortable_3.h +++ b/Marlin/thermistortable_3.h @@ -20,7 +20,7 @@ * */ -// R25 = 100 kOhm, beta25 = 4120 K, 4.7 kOhm pull-up, mendel-parts +// mendel-parts const short temptable_3[][2] PROGMEM = { { OV( 1), 864 }, { OV( 21), 300 }, diff --git a/Marlin/thermistortable_4.h b/Marlin/thermistortable_4.h index 6c3ea61..8a611a2 100644 --- a/Marlin/thermistortable_4.h +++ b/Marlin/thermistortable_4.h @@ -20,7 +20,7 @@ * */ -// R25 = 10 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, Generic 10k thermistor +// 10k thermistor const short temptable_4[][2] PROGMEM = { { OV( 1), 430 }, { OV( 54), 137 }, diff --git a/Marlin/thermistortable_5.h b/Marlin/thermistortable_5.h index 7f654b1..07f68fe 100644 --- a/Marlin/thermistortable_5.h +++ b/Marlin/thermistortable_5.h @@ -20,7 +20,6 @@ * */ -// R25 = 100 kOhm, beta25 = 4267 K, 4.7 kOhm pull-up // 100k ParCan thermistor (104GT-2) // ATC Semitec 104GT-2 (Used in ParCan) // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf diff --git a/Marlin/thermistortable_51.h b/Marlin/thermistortable_51.h index 0746c70..198f564 100644 --- a/Marlin/thermistortable_51.h +++ b/Marlin/thermistortable_51.h @@ -20,7 +20,6 @@ * */ -// R25 = 100 kOhm, beta25 = 4092 K, 1 kOhm pull-up, // 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 diff --git a/Marlin/thermistortable_52.h b/Marlin/thermistortable_52.h index 63b53e1..361ebb4 100644 --- a/Marlin/thermistortable_52.h +++ b/Marlin/thermistortable_52.h @@ -20,7 +20,6 @@ * */ -// R25 = 200 kOhm, beta25 = 4338 K, 1 kOhm pull-up, // 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 diff --git a/Marlin/thermistortable_55.h b/Marlin/thermistortable_55.h index aa6677f..c4f3961 100644 --- a/Marlin/thermistortable_55.h +++ b/Marlin/thermistortable_55.h @@ -20,7 +20,6 @@ * */ -// R25 = 100 kOhm, beta25 = 4267 K, 1 kOhm pull-up, // 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 diff --git a/Marlin/thermistortable_6.h b/Marlin/thermistortable_6.h index bb97267..ab21ae6 100644 --- a/Marlin/thermistortable_6.h +++ b/Marlin/thermistortable_6.h @@ -20,7 +20,7 @@ * */ -// R25 = 100 kOhm, beta25 = 4092 K, 8.2 kOhm pull-up, 100k Epcos (?) thermistor +// 100k Epcos thermistor const short temptable_6[][2] PROGMEM = { { OV( 1), 350 }, { OV( 28), 250 }, // top rating 250C diff --git a/Marlin/thermistortable_60.h b/Marlin/thermistortable_60.h index ab92406..3340ac6 100644 --- a/Marlin/thermistortable_60.h +++ b/Marlin/thermistortable_60.h @@ -20,7 +20,6 @@ * */ -// R25 = 100 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, // Maker's Tool Works Kapton Bed Thermistor // ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=3950 // r0: 100000 diff --git a/Marlin/thermistortable_66.h b/Marlin/thermistortable_66.h index 7fb9a2d..78d5fb8 100644 --- a/Marlin/thermistortable_66.h +++ b/Marlin/thermistortable_66.h @@ -20,7 +20,7 @@ * */ -// R25 = 2.5 MOhm, beta25 = 4500 K, 4.7 kOhm pull-up, DyzeDesign 500 °C Thermistor +// DyzeDesign 500°C Thermistor const short temptable_66[][2] PROGMEM = { { OV( 17.5), 850 }, { OV( 17.9), 500 }, diff --git a/Marlin/thermistortable_7.h b/Marlin/thermistortable_7.h index 025c53c..5302a40 100644 --- a/Marlin/thermistortable_7.h +++ b/Marlin/thermistortable_7.h @@ -20,7 +20,7 @@ * */ -// R25 = 100 kOhm, beta25 = 3974 K, 4.7 kOhm pull-up, Honeywell 135-104LAG-J01 +// 100k Honeywell 135-104LAG-J01 const short temptable_7[][2] PROGMEM = { { OV( 1), 941 }, { OV( 19), 362 }, diff --git a/Marlin/thermistortable_70.h b/Marlin/thermistortable_70.h index 2f9434e..990e45f 100644 --- a/Marlin/thermistortable_70.h +++ b/Marlin/thermistortable_70.h @@ -20,23 +20,64 @@ * */ -// Stock BQ Hephestos 2 100k thermistor. -// Created on 29/12/2017 with an ambient temperature of 20C. -// ANENG AN8009 DMM with a K-type probe used for measurements. - -// R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, bqh2 stock thermistor +// bqh2 stock thermistor const short temptable_70[][2] PROGMEM = { - { OV( 18), 270 }, - { OV( 27), 248 }, - { OV( 34), 234 }, - { OV( 45), 220 }, - { OV( 61), 205 }, - { OV( 86), 188 }, - { OV( 123), 172 }, - { OV( 420), 110 }, - { OV( 590), 90 }, - { OV( 845), 56 }, - { OV( 970), 25 }, + { OV( 22), 300 }, + { OV( 24), 295 }, + { OV( 25), 290 }, + { OV( 27), 285 }, + { OV( 29), 280 }, + { OV( 32), 275 }, + { OV( 34), 270 }, + { OV( 37), 265 }, + { OV( 40), 260 }, + { OV( 43), 255 }, + { OV( 46), 250 }, + { OV( 50), 245 }, + { OV( 54), 240 }, + { OV( 59), 235 }, + { OV( 64), 230 }, + { OV( 70), 225 }, + { OV( 76), 220 }, + { OV( 83), 215 }, + { OV( 90), 210 }, + { OV( 99), 205 }, + { OV( 108), 200 }, + { OV( 118), 195 }, + { OV( 129), 190 }, + { OV( 141), 185 }, + { OV( 154), 180 }, + { OV( 169), 175 }, + { OV( 185), 170 }, + { OV( 203), 165 }, + { OV( 222), 160 }, + { OV( 243), 155 }, + { OV( 266), 150 }, + { OV( 290), 145 }, + { OV( 317), 140 }, + { OV( 346), 135 }, + { OV( 376), 130 }, + { OV( 408), 125 }, + { OV( 442), 120 }, + { OV( 477), 115 }, + { OV( 513), 110 }, + { OV( 551), 105 }, + { OV( 588), 100 }, + { OV( 626), 95 }, + { OV( 663), 90 }, + { OV( 699), 85 }, + { OV( 735), 80 }, + { OV( 768), 75 }, + { OV( 800), 70 }, + { OV( 829), 65 }, + { OV( 856), 60 }, + { OV( 881), 55 }, + { OV( 903), 50 }, + { OV( 922), 45 }, + { OV( 939), 40 }, + { OV( 954), 35 }, + { OV( 966), 30 }, + { OV( 977), 25 }, { OV( 986), 20 }, { OV( 994), 15 }, { OV(1000), 10 }, diff --git a/Marlin/thermistortable_71.h b/Marlin/thermistortable_71.h index f28a4ce..2ba14d0 100644 --- a/Marlin/thermistortable_71.h +++ b/Marlin/thermistortable_71.h @@ -20,7 +20,7 @@ * */ -// R25 = 100 kOhm, beta25 = 3974 K, 4.7 kOhm pull-up, Honeywell 135-104LAF-J01 +// 100k Honeywell 135-104LAF-J01 // R0 = 100000 Ohm // T0 = 25 °C // Beta = 3974 @@ -28,26 +28,78 @@ // R2 = 4700 Ohm const short temptable_71[][2] PROGMEM = { { OV( 35), 300 }, - { OV( 51), 269 }, + { OV( 51), 270 }, + { OV( 54), 265 }, + { OV( 58), 260 }, { OV( 59), 258 }, + { OV( 61), 256 }, + { OV( 63), 254 }, { OV( 64), 252 }, - { OV( 71), 244 }, + { OV( 66), 250 }, + { OV( 67), 249 }, + { OV( 68), 248 }, + { OV( 69), 247 }, + { OV( 70), 246 }, + { OV( 71), 245 }, + { OV( 72), 244 }, + { OV( 73), 243 }, + { OV( 74), 242 }, + { OV( 75), 241 }, + { OV( 76), 240 }, + { OV( 77), 239 }, + { OV( 78), 238 }, + { OV( 79), 237 }, + { OV( 80), 236 }, { OV( 81), 235 }, + { OV( 82), 234 }, + { OV( 84), 233 }, + { OV( 85), 232 }, + { OV( 86), 231 }, { OV( 87), 230 }, + { OV( 89), 229 }, + { OV( 90), 228 }, + { OV( 91), 227 }, { OV( 92), 226 }, + { OV( 94), 225 }, + { OV( 95), 224 }, + { OV( 97), 223 }, + { OV( 98), 222 }, + { OV( 99), 221 }, + { OV( 101), 220 }, { OV( 102), 219 }, + { OV( 104), 218 }, + { OV( 106), 217 }, + { OV( 107), 216 }, + { OV( 109), 215 }, { OV( 110), 214 }, + { OV( 112), 213 }, + { OV( 114), 212 }, { OV( 115), 211 }, + { OV( 117), 210 }, + { OV( 119), 209 }, + { OV( 121), 208 }, + { OV( 123), 207 }, + { OV( 125), 206 }, { OV( 126), 205 }, { OV( 128), 204 }, { OV( 130), 203 }, { OV( 132), 202 }, { OV( 134), 201 }, { OV( 136), 200 }, + { OV( 139), 199 }, + { OV( 141), 198 }, + { OV( 143), 197 }, + { OV( 145), 196 }, { OV( 147), 195 }, + { OV( 150), 194 }, + { OV( 152), 193 }, { OV( 154), 192 }, + { OV( 157), 191 }, { OV( 159), 190 }, + { OV( 162), 189 }, { OV( 164), 188 }, + { OV( 167), 187 }, + { OV( 170), 186 }, { OV( 172), 185 }, { OV( 175), 184 }, { OV( 178), 183 }, @@ -61,7 +113,9 @@ const short temptable_71[][2] PROGMEM = { { OV( 202), 175 }, { OV( 205), 174 }, { OV( 208), 173 }, + { OV( 212), 172 }, { OV( 215), 171 }, + { OV( 219), 170 }, { OV( 237), 165 }, { OV( 256), 160 }, { OV( 300), 150 }, @@ -69,22 +123,46 @@ const short temptable_71[][2] PROGMEM = { { OV( 470), 120 }, { OV( 504), 115 }, { OV( 538), 110 }, + { OV( 552), 108 }, + { OV( 566), 106 }, + { OV( 580), 104 }, + { OV( 594), 102 }, + { OV( 608), 100 }, + { OV( 622), 98 }, + { OV( 636), 96 }, + { OV( 650), 94 }, + { OV( 664), 92 }, + { OV( 678), 90 }, + { OV( 712), 85 }, { OV( 745), 80 }, + { OV( 758), 78 }, { OV( 770), 76 }, + { OV( 783), 74 }, + { OV( 795), 72 }, { OV( 806), 70 }, + { OV( 818), 68 }, { OV( 829), 66 }, + { OV( 840), 64 }, + { OV( 850), 62 }, { OV( 860), 60 }, + { OV( 870), 58 }, { OV( 879), 56 }, { OV( 888), 54 }, + { OV( 897), 52 }, { OV( 905), 50 }, { OV( 924), 45 }, { OV( 940), 40 }, { OV( 955), 35 }, + { OV( 967), 30 }, + { OV( 970), 29 }, { OV( 972), 28 }, { OV( 974), 27 }, { OV( 976), 26 }, { OV( 978), 25 }, { OV( 980), 24 }, + { OV( 982), 23 }, + { OV( 984), 22 }, + { OV( 985), 21 }, { OV( 987), 20 }, { OV( 995), 15 }, { OV(1001), 10 }, diff --git a/Marlin/thermistortable_75.h b/Marlin/thermistortable_75.h index dda7649..758c2a0 100644 --- a/Marlin/thermistortable_75.h +++ b/Marlin/thermistortable_75.h @@ -20,8 +20,7 @@ * */ -// R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, -// Generic Silicon Heat Pad with NTC 100K thermistor +// Generic Silicon Heat Pad with NTC 100K thermistor ( Beta 25/50 3950K) // // Many of the generic silicon heat pads use the MGB18-104F39050L32 Thermistor It is used for various // wattage and voltage heat pads. This table is correct if this part is used. It has been diff --git a/Marlin/thermistortable_8.h b/Marlin/thermistortable_8.h index 3ef78da..2a27f7c 100644 --- a/Marlin/thermistortable_8.h +++ b/Marlin/thermistortable_8.h @@ -20,7 +20,7 @@ * */ -// R25 = 100 kOhm, beta25 = 3950 K, 10 kOhm pull-up, NTCS0603E3104FHT +// 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) const short temptable_8[][2] PROGMEM = { { OV( 1), 704 }, { OV( 54), 216 }, diff --git a/Marlin/thermistortable_9.h b/Marlin/thermistortable_9.h index e9ef924..2d83dd4 100644 --- a/Marlin/thermistortable_9.h +++ b/Marlin/thermistortable_9.h @@ -20,7 +20,7 @@ * */ -// R25 = 100 kOhm, beta25 = 3960 K, 4.7 kOhm pull-up, GE Sensing AL03006-58.2K-97-G1 +// 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) const short temptable_9[][2] PROGMEM = { { OV( 1), 936 }, { OV( 36), 300 }, diff --git a/Marlin/thermistortables.h b/Marlin/thermistortables.h index a65d3eb..6a19c9c 100644 --- a/Marlin/thermistortables.h +++ b/Marlin/thermistortables.h @@ -29,7 +29,7 @@ #define OVERSAMPLENR 16 #define OV(N) int16_t((N)*(OVERSAMPLENR)) -#define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORHEATER_4 == n || THERMISTORBED == n || THERMISTORCHAMBER == n) +#define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORHEATER_4 == n || THERMISTORBED == n) // Pt1000 and Pt100 handling // @@ -56,9 +56,6 @@ #if ANY_THERMISTOR_IS(5) // 100k ParCan thermistor (104GT-2) #include "thermistortable_5.h" #endif -#if ANY_THERMISTOR_IS(501) // 100k Zonestar thermistor - #include "thermistortable_501.h" -#endif #if ANY_THERMISTOR_IS(6) // 100k Epcos thermistor #include "thermistortable_6.h" #endif @@ -83,9 +80,6 @@ #if ANY_THERMISTOR_IS(13) // Hisens thermistor B25/50 =3950 +/-1% #include "thermistortable_13.h" #endif -#if ANY_THERMISTOR_IS(15) // JGAurora A5 thermistor calibration - #include "thermistortable_15.h" -#endif #if ANY_THERMISTOR_IS(20) // PT100 with INA826 amp on Ultimaker v2.0 electronics #include "thermistortable_20.h" #endif @@ -135,7 +129,7 @@ #define _TT_NAME(_N) temptable_ ## _N #define TT_NAME(_N) _TT_NAME(_N) -#if THERMISTORHEATER_0 +#ifdef THERMISTORHEATER_0 #define HEATER_0_TEMPTABLE TT_NAME(THERMISTORHEATER_0) #define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE) #elif defined(HEATER_0_USES_THERMISTOR) @@ -145,7 +139,7 @@ #define HEATER_0_TEMPTABLE_LEN 0 #endif -#if THERMISTORHEATER_1 +#ifdef THERMISTORHEATER_1 #define HEATER_1_TEMPTABLE TT_NAME(THERMISTORHEATER_1) #define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE) #elif defined(HEATER_1_USES_THERMISTOR) @@ -155,7 +149,7 @@ #define HEATER_1_TEMPTABLE_LEN 0 #endif -#if THERMISTORHEATER_2 +#ifdef THERMISTORHEATER_2 #define HEATER_2_TEMPTABLE TT_NAME(THERMISTORHEATER_2) #define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE) #elif defined(HEATER_2_USES_THERMISTOR) @@ -165,7 +159,7 @@ #define HEATER_2_TEMPTABLE_LEN 0 #endif -#if THERMISTORHEATER_3 +#ifdef THERMISTORHEATER_3 #define HEATER_3_TEMPTABLE TT_NAME(THERMISTORHEATER_3) #define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE) #elif defined(HEATER_3_USES_THERMISTOR) @@ -175,7 +169,7 @@ #define HEATER_3_TEMPTABLE_LEN 0 #endif -#if THERMISTORHEATER_4 +#ifdef THERMISTORHEATER_4 #define HEATER_4_TEMPTABLE TT_NAME(THERMISTORHEATER_4) #define HEATER_4_TEMPTABLE_LEN COUNT(HEATER_4_TEMPTABLE) #elif defined(HEATER_4_USES_THERMISTOR) @@ -188,26 +182,12 @@ #ifdef THERMISTORBED #define BEDTEMPTABLE TT_NAME(THERMISTORBED) #define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE) -#elif defined(HEATER_BED_USES_THERMISTOR) - #error "No bed thermistor table specified" #else - #define BEDTEMPTABLE_LEN 0 + #ifdef BED_USES_THERMISTOR + #error "No bed thermistor table specified" + #endif #endif -#ifdef THERMISTORCHAMBER - #define CHAMBERTEMPTABLE TT_NAME(THERMISTORCHAMBER) - #define CHAMBERTEMPTABLE_LEN COUNT(CHAMBERTEMPTABLE) -#elif defined(HEATER_CHAMBER_USES_THERMISTOR) - #error "No chamber thermistor table specified" -#else - #define CHAMBERTEMPTABLE_LEN 0 -#endif - -// The SCAN_THERMISTOR_TABLE macro needs alteration? -static_assert(HEATER_0_TEMPTABLE_LEN < 256 && HEATER_1_TEMPTABLE_LEN < 256 && HEATER_2_TEMPTABLE_LEN < 256 && HEATER_3_TEMPTABLE_LEN < 256 && HEATER_4_TEMPTABLE_LEN < 256 && BEDTEMPTABLE_LEN < 256 && CHAMBERTEMPTABLE_LEN < 256, - "Temperature conversion tables over 255 entries need special consideration." -); - // Set the high and low raw values for the heaters // For thermistors the highest temperature results in the lowest ADC value // For thermocouples the highest temperature results in the highest ADC value @@ -257,7 +237,7 @@ static_assert(HEATER_0_TEMPTABLE_LEN < 256 && HEATER_1_TEMPTABLE_LEN < 256 && HE #endif #endif #ifndef HEATER_BED_RAW_HI_TEMP - #ifdef HEATER_BED_USES_THERMISTOR + #ifdef BED_USES_THERMISTOR #define HEATER_BED_RAW_HI_TEMP 0 #define HEATER_BED_RAW_LO_TEMP 16383 #else @@ -265,14 +245,5 @@ static_assert(HEATER_0_TEMPTABLE_LEN < 256 && HEATER_1_TEMPTABLE_LEN < 256 && HE #define HEATER_BED_RAW_LO_TEMP 0 #endif #endif -#ifndef HEATER_CHAMBER_RAW_HI_TEMP - #ifdef HEATER_CHAMBER_USES_THERMISTOR - #define HEATER_CHAMBER_RAW_HI_TEMP 0 - #define HEATER_CHAMBER_RAW_LO_TEMP 16383 - #else - #define HEATER_CHAMBER_RAW_HI_TEMP 16383 - #define HEATER_CHAMBER_RAW_LO_TEMP 0 - #endif -#endif #endif // THERMISTORTABLES_H_ diff --git a/Marlin/tmc_macros.h b/Marlin/tmc_macros.h new file mode 100644 index 0000000..b98c460 --- /dev/null +++ b/Marlin/tmc_macros.h @@ -0,0 +1,39 @@ +/** + * 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 TMC_MACROS_H +#define TMC_MACROS_H + + // Trinamic Stepper Drivers + #define HAS_TRINAMIC (ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) || ENABLED(IS_TRAMS)) + #define X_IS_TRINAMIC (ENABLED( X_IS_TMC2130) || ENABLED( X_IS_TMC2208) || ENABLED(IS_TRAMS)) + #define X2_IS_TRINAMIC (ENABLED(X2_IS_TMC2130) || ENABLED(X2_IS_TMC2208)) + #define Y_IS_TRINAMIC (ENABLED( Y_IS_TMC2130) || ENABLED( Y_IS_TMC2208) || ENABLED(IS_TRAMS)) + #define Y2_IS_TRINAMIC (ENABLED(Y2_IS_TMC2130) || ENABLED(Y2_IS_TMC2208)) + #define Z_IS_TRINAMIC (ENABLED( Z_IS_TMC2130) || ENABLED( Z_IS_TMC2208) || ENABLED(IS_TRAMS)) + #define Z2_IS_TRINAMIC (ENABLED(Z2_IS_TMC2130) || ENABLED(Z2_IS_TMC2208)) + #define E0_IS_TRINAMIC (ENABLED(E0_IS_TMC2130) || ENABLED(E0_IS_TMC2208) || ENABLED(IS_TRAMS)) + #define E1_IS_TRINAMIC (ENABLED(E1_IS_TMC2130) || ENABLED(E1_IS_TMC2208)) + #define E2_IS_TRINAMIC (ENABLED(E2_IS_TMC2130) || ENABLED(E2_IS_TMC2208)) + #define E3_IS_TRINAMIC (ENABLED(E3_IS_TMC2130) || ENABLED(E3_IS_TMC2208)) + #define E4_IS_TRINAMIC (ENABLED(E4_IS_TMC2130) || ENABLED(E4_IS_TMC2208)) + +#endif diff --git a/Marlin/twibus.cpp b/Marlin/twibus.cpp index 5156c89..4e29ef8 100644 --- a/Marlin/twibus.cpp +++ b/Marlin/twibus.cpp @@ -20,13 +20,12 @@ * */ -#include "MarlinConfig.h" +#include "Marlin.h" #if ENABLED(EXPERIMENTAL_I2CBUS) #include "twibus.h" #include -#include "Marlin.h" TWIBus::TWIBus() { #if I2C_SLAVE_ADDRESS == 0 @@ -55,7 +54,7 @@ void TWIBus::address(const uint8_t adr) { #endif } -void TWIBus::addbyte(const byte c) { +void TWIBus::addbyte(const char c) { if (this->buffer_s >= COUNT(this->buffer)) return; this->buffer[this->buffer_s++] = c; #if ENABLED(DEBUG_TWIBUS) @@ -63,7 +62,7 @@ void TWIBus::addbyte(const byte c) { #endif } -void TWIBus::addbytes(byte src[], uint8_t bytes) { +void TWIBus::addbytes(char src[], uint8_t bytes) { #if ENABLED(DEBUG_TWIBUS) debug(PSTR("addbytes"), bytes); #endif @@ -138,7 +137,7 @@ void TWIBus::relay(const uint8_t bytes) { echodata(bytes, PSTR("i2c-reply"), this->addr); } -uint8_t TWIBus::capture(byte *dst, const uint8_t bytes) { +uint8_t TWIBus::capture(char *dst, const uint8_t bytes) { this->reset(); uint8_t count = 0; while (count < bytes && Wire.available()) diff --git a/Marlin/twibus.h b/Marlin/twibus.h index 8759c40..0376397 100644 --- a/Marlin/twibus.h +++ b/Marlin/twibus.h @@ -33,13 +33,6 @@ typedef void (*twiReceiveFunc_t)(int bytes); typedef void (*twiRequestFunc_t)(); -#if ENABLED(MECHADUINO_I2C_COMMANDS) - typedef union { - float fval; - byte bval[sizeof(float)]; - } i2cFloat; -#endif - #define TWIBUS_BUFFER_SIZE 32 /** @@ -106,7 +99,7 @@ class TWIBus { * * @param c a data byte */ - void addbyte(const byte c); + void addbyte(const char c); /** * @brief Add some bytes to the buffer @@ -116,7 +109,7 @@ class TWIBus { * @param src source data address * @param bytes the number of bytes to add */ - void addbytes(byte src[], uint8_t bytes); + void addbytes(char src[], uint8_t bytes); /** * @brief Add a null-terminated string to the buffer @@ -179,7 +172,7 @@ class TWIBus { * @param bytes the number of bytes to request * @return the number of bytes captured to the buffer */ - uint8_t capture(byte *dst, const uint8_t bytes); + uint8_t capture(char *dst, const uint8_t bytes); /** * @brief Flush the i2c bus. diff --git a/Marlin/types.h b/Marlin/types.h index 8d4a0bd..e4f4ce1 100644 --- a/Marlin/types.h +++ b/Marlin/types.h @@ -23,8 +23,6 @@ #ifndef __TYPES_H__ #define __TYPES_H__ -#include - typedef unsigned long millis_t; typedef struct { diff --git a/Marlin/ubl.cpp b/Marlin/ubl.cpp index 26485c5..11a2a22 100644 --- a/Marlin/ubl.cpp +++ b/Marlin/ubl.cpp @@ -20,39 +20,20 @@ * */ -#include "MarlinConfig.h" +#include "Marlin.h" +#include "math.h" #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "Marlin.h" #include "ubl.h" #include "hex_print_routines.h" #include "temperature.h" #include "planner.h" - #include "math.h" - - unified_bed_leveling ubl; uint8_t ubl_cnt = 0; void unified_bed_leveling::echo_name() { SERIAL_PROTOCOLPGM("Unified Bed Leveling"); } - void unified_bed_leveling::report_current_mesh() { - if (!leveling_is_valid()) return; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(" G29 I999"); - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) { - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" M421 I", x); - SERIAL_ECHOPAIR(" J", y); - SERIAL_ECHOPGM(" Z"); - SERIAL_ECHO_F(z_values[x][y], 2); - SERIAL_EOL(); - } - } - void unified_bed_leveling::report_state() { echo_name(); SERIAL_PROTOCOLPGM(" System v" UBL_VERSION " "); @@ -61,6 +42,15 @@ safe_delay(50); } + static void serial_echo_xy(const int16_t x, const int16_t y) { + SERIAL_CHAR('('); + SERIAL_ECHO(x); + SERIAL_CHAR(','); + SERIAL_ECHO(y); + SERIAL_CHAR(')'); + safe_delay(10); + } + #if ENABLED(UBL_DEVEL_DEBUGGING) static void debug_echo_axis(const AxisEnum axis) { @@ -76,7 +66,7 @@ // ignore the status of the g26_debug_flag if (*title != '!' && !g26_debug_flag) return; - const float de = destination[E_CART] - current_position[E_CART]; + const float de = destination[E_AXIS] - current_position[E_AXIS]; if (de == 0.0) return; // Printing moves only @@ -97,7 +87,7 @@ SERIAL_ECHOPGM(", "); SERIAL_ECHO_F(current_position[Z_AXIS], 6); SERIAL_ECHOPGM(", "); - SERIAL_ECHO_F(current_position[E_CART], 6); + SERIAL_ECHO_F(current_position[E_AXIS], 6); SERIAL_ECHOPGM(" ) destination=( "); debug_echo_axis(X_AXIS); SERIAL_ECHOPGM(", "); @@ -158,118 +148,79 @@ } } - static void serial_echo_xy(const uint8_t sp, const int16_t x, const int16_t y) { - SERIAL_ECHO_SP(sp); - SERIAL_CHAR('('); - if (x < 100) { SERIAL_CHAR(' '); if (x < 10) SERIAL_CHAR(' '); } - SERIAL_ECHO(x); - SERIAL_CHAR(','); - if (y < 100) { SERIAL_CHAR(' '); if (y < 10) SERIAL_CHAR(' '); } - SERIAL_ECHO(y); - SERIAL_CHAR(')'); - safe_delay(5); - } + // display_map() currently produces three different mesh map types + // 0 : suitable for PronterFace and Repetier's serial console + // 1 : .CSV file suitable for importation into various spread sheets + // 2 : disply of the map data on a RepRap Graphical LCD Panel - static void serial_echo_column_labels(const uint8_t sp) { - SERIAL_ECHO_SP(7); - for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - if (i < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(i); - SERIAL_ECHO_SP(sp); - } - safe_delay(10); - } - - /** - * Produce one of these mesh maps: - * 0: Human-readable - * 1: CSV format for spreadsheet import - * 2: TODO: Display on Graphical LCD - * 4: Compact Human-Readable - */ void unified_bed_leveling::display_map(const int map_type) { - #if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - suspend_auto_report = true; - #endif + constexpr uint8_t spaces = 8 * (GRID_MAX_POINTS_X - 2); - constexpr uint8_t eachsp = 1 + 6 + 1, // [-3.567] - twixt = eachsp * (GRID_MAX_POINTS_X) - 9 * 2; // Leading 4sp, Coordinates 9sp each - - const bool human = !(map_type & 0x3), csv = map_type == 1, lcd = map_type == 2, comp = map_type & 0x4; - - SERIAL_ECHOPGM("\nBed Topography Report"); - if (human) { - SERIAL_ECHOPGM(":\n\n"); - serial_echo_xy(4, MESH_MIN_X, MESH_MAX_Y); - serial_echo_xy(twixt, MESH_MAX_X, MESH_MAX_Y); + SERIAL_PROTOCOLPGM("\nBed Topography Report"); + if (map_type == 0) { + SERIAL_PROTOCOLPGM(":\n\n"); + serial_echo_xy(0, GRID_MAX_POINTS_Y - 1); + SERIAL_ECHO_SP(spaces + 3); + serial_echo_xy(GRID_MAX_POINTS_X - 1, GRID_MAX_POINTS_Y - 1); + SERIAL_EOL(); + serial_echo_xy(MESH_MIN_X, MESH_MAX_Y); + SERIAL_ECHO_SP(spaces); + serial_echo_xy(MESH_MAX_X, MESH_MAX_Y); SERIAL_EOL(); - serial_echo_column_labels(eachsp - 2); } else { - SERIAL_ECHOPGM(" for "); - serialprintPGM(csv ? PSTR("CSV:\n") : PSTR("LCD:\n")); + SERIAL_PROTOCOLPGM(" for "); + serialprintPGM(map_type == 1 ? PSTR("CSV:\n\n") : PSTR("LCD:\n\n")); } const float current_xi = get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0), current_yi = get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0); - if (!lcd) SERIAL_EOL(); for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) { - - // Row Label (J index) - if (human) { - if (j < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(j); - SERIAL_ECHOPGM(" |"); - } - - // Row Values (I indexes) for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - - // Opening Brace or Space const bool is_current = i == current_xi && j == current_yi; - if (human) SERIAL_CHAR(is_current ? '[' : ' '); - // Z Value at current I, J + // is the nozzle here? then mark the number + if (map_type == 0) SERIAL_CHAR(is_current ? '[' : ' '); + const float f = z_values[i][j]; - if (lcd) { - // TODO: Display on Graphical LCD + if (isnan(f)) { + serialprintPGM(map_type == 0 ? PSTR(" . ") : PSTR("NAN")); } - else if (isnan(f)) - serialprintPGM(human ? PSTR(" . ") : PSTR("NAN")); - else if (human || csv) { - if (human && f >= 0.0) SERIAL_CHAR(f > 0 ? '+' : ' '); // Space for positive ('-' for negative) - SERIAL_ECHO_F(f, 3); // Positive: 5 digits, Negative: 6 digits + else if (map_type <= 1) { + // if we don't do this, the columns won't line up nicely + if (map_type == 0 && f >= 0.0) SERIAL_CHAR(' '); + SERIAL_PROTOCOL_F(f, 3); } idle(); - if (csv && i < GRID_MAX_POINTS_X - 1) SERIAL_CHAR('\t'); - - // Closing Brace or Space - if (human) SERIAL_CHAR(is_current ? ']' : ' '); + if (map_type == 1 && i < GRID_MAX_POINTS_X - 1) SERIAL_CHAR(','); #if TX_BUFFER_SIZE > 0 - SERIAL_FLUSHTX(); + MYSERIAL.flushTX(); #endif - safe_delay(5); + safe_delay(15); + if (map_type == 0) { + SERIAL_CHAR(is_current ? ']' : ' '); + SERIAL_CHAR(' '); + } + } + SERIAL_EOL(); + if (j && map_type == 0) { // we want the (0,0) up tight against the block of numbers + SERIAL_CHAR(' '); + SERIAL_EOL(); } - if (!lcd) SERIAL_EOL(); - - // A blank line between rows (unless compact) - if (j && human && !comp) SERIAL_ECHOLNPGM(" |"); } - if (human) { - serial_echo_column_labels(eachsp - 2); - SERIAL_EOL(); - serial_echo_xy(4, MESH_MIN_X, MESH_MIN_Y); - serial_echo_xy(twixt, MESH_MAX_X, MESH_MIN_Y); + if (map_type == 0) { + serial_echo_xy(MESH_MIN_X, MESH_MIN_Y); + SERIAL_ECHO_SP(spaces + 4); + serial_echo_xy(MESH_MAX_X, MESH_MIN_Y); SERIAL_EOL(); + serial_echo_xy(0, 0); + SERIAL_ECHO_SP(spaces + 5); + serial_echo_xy(GRID_MAX_POINTS_X - 1, 0); SERIAL_EOL(); } - - #if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - suspend_auto_report = false; - #endif } bool unified_bed_leveling::sanity_check() { diff --git a/Marlin/ubl.h b/Marlin/ubl.h index 03380af..754e387 100644 --- a/Marlin/ubl.h +++ b/Marlin/ubl.h @@ -25,346 +25,330 @@ #include "MarlinConfig.h" -//#define UBL_DEVEL_DEBUGGING +#if ENABLED(AUTO_BED_LEVELING_UBL) -#include "Marlin.h" -#include "planner.h" -#include "math.h" -#include "configuration_store.h" + //#define UBL_DEVEL_DEBUGGING -#define UBL_VERSION "1.01" -#define UBL_OK false -#define UBL_ERR true + #include "Marlin.h" + #include "planner.h" + #include "math.h" + #include "vector_3.h" + #include "configuration_store.h" -#define USE_NOZZLE_AS_REFERENCE 0 -#define USE_PROBE_AS_REFERENCE 1 + #define UBL_VERSION "1.01" + #define UBL_OK false + #define UBL_ERR true -// ubl_motion.cpp + #define USE_NOZZLE_AS_REFERENCE 0 + #define USE_PROBE_AS_REFERENCE 1 -#if ENABLED(UBL_DEVEL_DEBUGGING) - void debug_current_and_destination(const char * const title); -#else - FORCE_INLINE void debug_current_and_destination(const char * const title) { UNUSED(title); } -#endif + // ubl_motion.cpp -// ubl_G29.cpp + #if ENABLED(UBL_DEVEL_DEBUGGING) + void debug_current_and_destination(const char * const title); + #else + FORCE_INLINE void debug_current_and_destination(const char * const title) { UNUSED(title); } + #endif -enum MeshPointType : char { INVALID, REAL, SET_IN_BITMAP }; + // ubl_G29.cpp -// External references + enum MeshPointType { INVALID, REAL, SET_IN_BITMAP }; -char *ftostr43sign(const float&, char); + // External references -extern uint8_t ubl_cnt; + char *ftostr43sign(const float&, char); + void home_all_axes(); -/////////////////////////////////////////////////////////////////////////////////////////////////////// + extern uint8_t ubl_cnt; -#if ENABLED(ULTRA_LCD) - void lcd_quick_feedback(const bool clear_buttons); -#endif + /////////////////////////////////////////////////////////////////////////////////////////////////////// -#define MESH_X_DIST (float(MESH_MAX_X - (MESH_MIN_X)) / float(GRID_MAX_POINTS_X - 1)) -#define MESH_Y_DIST (float(MESH_MAX_Y - (MESH_MIN_Y)) / float(GRID_MAX_POINTS_Y - 1)) + #if ENABLED(ULTRA_LCD) + extern char lcd_status_message[]; + void lcd_quick_feedback(); + #endif -class unified_bed_leveling { - private: + #define MESH_X_DIST (float(MESH_MAX_X - (MESH_MIN_X)) / float(GRID_MAX_POINTS_X - 1)) + #define MESH_Y_DIST (float(MESH_MAX_Y - (MESH_MIN_Y)) / float(GRID_MAX_POINTS_Y - 1)) - static int g29_verbose_level, - g29_phase_value, - g29_repetition_cnt, - g29_storage_slot, - g29_map_type; - static bool g29_c_flag, g29_x_flag, g29_y_flag; - static float g29_x_pos, g29_y_pos, - g29_card_thickness, - g29_constant; + class unified_bed_leveling { + private: - #if HAS_BED_PROBE - static int g29_grid_size; - #endif + static int g29_verbose_level, + g29_phase_value, + g29_repetition_cnt, + g29_storage_slot, + g29_map_type; + static bool g29_c_flag, g29_x_flag, g29_y_flag; + static float g29_x_pos, g29_y_pos, + g29_card_thickness, + g29_constant; - #if ENABLED(NEWPANEL) - static void move_z_with_encoder(const float &multiplier); - static float measure_point_with_encoder(); - static float measure_business_card_thickness(float in_height); - static void manually_probe_remaining_mesh(const float&, const float&, const float&, const float&, const bool) _O0; - static void fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map) _O0; - #endif + #if HAS_BED_PROBE + static int g29_grid_size; + #endif - static bool g29_parameter_parsing() _O0; - static void shift_mesh_height(); - static void probe_entire_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map, const bool stow_probe, bool do_furthest) _O0; - static void tilt_mesh_based_on_3pts(const float &z1, const float &z2, const float &z3); - static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map); - static void g29_what_command(); - static void g29_eeprom_dump(); - static void g29_compare_current_mesh_to_stored_mesh(); - static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir); - static void smart_fill_mesh(); + #if ENABLED(NEWPANEL) + static void move_z_with_encoder(const float &multiplier); + static float measure_point_with_encoder(); + static float measure_business_card_thickness(const float&); + static void manually_probe_remaining_mesh(const float&, const float&, const float&, const float&, const bool); + static void fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map); + #endif - public: + static bool g29_parameter_parsing(); + static void find_mean_mesh_height(); + static void shift_mesh_height(); + static void probe_entire_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map, const bool stow_probe, bool do_furthest); + static void tilt_mesh_based_on_3pts(const float &z1, const float &z2, const float &z3); + static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map); + static void g29_what_command(); + static void g29_eeprom_dump(); + static void g29_compare_current_mesh_to_stored_mesh(); + static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir); + static void smart_fill_mesh(); - static void echo_name(); - static void report_current_mesh(); - static void report_state(); - static void save_ubl_active_state_and_disable(); - static void restore_ubl_active_state_and_leave(); - static void display_map(const int) _O0; - static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const float&, const float&, const bool, uint16_t[16]) _O0; - static mesh_index_pair find_furthest_invalid_mesh_point() _O0; - static void reset(); - static void invalidate(); - static void set_all_mesh_points_to_value(const float value); - static void adjust_mesh_to_mean(const bool cflag, const float value); - static bool sanity_check(); + public: - static void G29() _O0; // O0 for no optimization - static void smart_fill_wlsf(const float &) _O2; // O2 gives smaller code than Os on A2560 + static void echo_name(); + static void report_state(); + static void save_ubl_active_state_and_disable(); + static void restore_ubl_active_state_and_leave(); + static void display_map(const int); + static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const float&, const float&, const bool, uint16_t[16]); + static mesh_index_pair find_furthest_invalid_mesh_point(); + static void reset(); + static void invalidate(); + static void set_all_mesh_points_to_value(const float); + static bool sanity_check(); - static int8_t storage_slot; + static void G29() _O0; // O0 for no optimization + static void smart_fill_wlsf(const float &) _O2; // O2 gives smaller code than Os on A2560 + static int8_t storage_slot; - static float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; + static float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - // 15 is the maximum nubmer of grid points supported + 1 safety margin for now, - // until determinism prevails - static constexpr float _mesh_index_to_xpos[16] PROGMEM = { - MESH_MIN_X + 0 * (MESH_X_DIST), MESH_MIN_X + 1 * (MESH_X_DIST), - MESH_MIN_X + 2 * (MESH_X_DIST), MESH_MIN_X + 3 * (MESH_X_DIST), - MESH_MIN_X + 4 * (MESH_X_DIST), MESH_MIN_X + 5 * (MESH_X_DIST), - MESH_MIN_X + 6 * (MESH_X_DIST), MESH_MIN_X + 7 * (MESH_X_DIST), - MESH_MIN_X + 8 * (MESH_X_DIST), MESH_MIN_X + 9 * (MESH_X_DIST), - MESH_MIN_X + 10 * (MESH_X_DIST), MESH_MIN_X + 11 * (MESH_X_DIST), - MESH_MIN_X + 12 * (MESH_X_DIST), MESH_MIN_X + 13 * (MESH_X_DIST), - MESH_MIN_X + 14 * (MESH_X_DIST), MESH_MIN_X + 15 * (MESH_X_DIST) - }; + // 15 is the maximum nubmer of grid points supported + 1 safety margin for now, + // until determinism prevails + constexpr static float _mesh_index_to_xpos[16] PROGMEM = { + MESH_MIN_X + 0 * (MESH_X_DIST), MESH_MIN_X + 1 * (MESH_X_DIST), + MESH_MIN_X + 2 * (MESH_X_DIST), MESH_MIN_X + 3 * (MESH_X_DIST), + MESH_MIN_X + 4 * (MESH_X_DIST), MESH_MIN_X + 5 * (MESH_X_DIST), + MESH_MIN_X + 6 * (MESH_X_DIST), MESH_MIN_X + 7 * (MESH_X_DIST), + MESH_MIN_X + 8 * (MESH_X_DIST), MESH_MIN_X + 9 * (MESH_X_DIST), + MESH_MIN_X + 10 * (MESH_X_DIST), MESH_MIN_X + 11 * (MESH_X_DIST), + MESH_MIN_X + 12 * (MESH_X_DIST), MESH_MIN_X + 13 * (MESH_X_DIST), + MESH_MIN_X + 14 * (MESH_X_DIST), MESH_MIN_X + 15 * (MESH_X_DIST) + }; - static constexpr float _mesh_index_to_ypos[16] PROGMEM = { - MESH_MIN_Y + 0 * (MESH_Y_DIST), MESH_MIN_Y + 1 * (MESH_Y_DIST), - MESH_MIN_Y + 2 * (MESH_Y_DIST), MESH_MIN_Y + 3 * (MESH_Y_DIST), - MESH_MIN_Y + 4 * (MESH_Y_DIST), MESH_MIN_Y + 5 * (MESH_Y_DIST), - MESH_MIN_Y + 6 * (MESH_Y_DIST), MESH_MIN_Y + 7 * (MESH_Y_DIST), - MESH_MIN_Y + 8 * (MESH_Y_DIST), MESH_MIN_Y + 9 * (MESH_Y_DIST), - MESH_MIN_Y + 10 * (MESH_Y_DIST), MESH_MIN_Y + 11 * (MESH_Y_DIST), - MESH_MIN_Y + 12 * (MESH_Y_DIST), MESH_MIN_Y + 13 * (MESH_Y_DIST), - MESH_MIN_Y + 14 * (MESH_Y_DIST), MESH_MIN_Y + 15 * (MESH_Y_DIST) - }; + constexpr static float _mesh_index_to_ypos[16] PROGMEM = { + MESH_MIN_Y + 0 * (MESH_Y_DIST), MESH_MIN_Y + 1 * (MESH_Y_DIST), + MESH_MIN_Y + 2 * (MESH_Y_DIST), MESH_MIN_Y + 3 * (MESH_Y_DIST), + MESH_MIN_Y + 4 * (MESH_Y_DIST), MESH_MIN_Y + 5 * (MESH_Y_DIST), + MESH_MIN_Y + 6 * (MESH_Y_DIST), MESH_MIN_Y + 7 * (MESH_Y_DIST), + MESH_MIN_Y + 8 * (MESH_Y_DIST), MESH_MIN_Y + 9 * (MESH_Y_DIST), + MESH_MIN_Y + 10 * (MESH_Y_DIST), MESH_MIN_Y + 11 * (MESH_Y_DIST), + MESH_MIN_Y + 12 * (MESH_Y_DIST), MESH_MIN_Y + 13 * (MESH_Y_DIST), + MESH_MIN_Y + 14 * (MESH_Y_DIST), MESH_MIN_Y + 15 * (MESH_Y_DIST) + }; - #if ENABLED(ULTIPANEL) - static bool lcd_map_control; - #endif + #if ENABLED(ULTIPANEL) + static bool lcd_map_control; + #endif - static volatile int encoder_diff; // Volatile because it's changed at interrupt time. + static volatile int encoder_diff; // Volatile because it's changed at interrupt time. - unified_bed_leveling(); + unified_bed_leveling(); - FORCE_INLINE static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; } + FORCE_INLINE static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; } - static int8_t get_cell_index_x(const float &x) { - const int8_t cx = (x - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)); - return constrain(cx, 0, (GRID_MAX_POINTS_X) - 1); // -1 is appropriate if we want all movement to the X_MAX - } // position. But with this defined this way, it is possible - // to extrapolate off of this point even further out. Probably - // that is OK because something else should be keeping that from - // happening and should not be worried about at this level. - static int8_t get_cell_index_y(const float &y) { - const int8_t cy = (y - (MESH_MIN_Y)) * (1.0f / (MESH_Y_DIST)); - return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 1); // -1 is appropriate if we want all movement to the Y_MAX - } // position. But with this defined this way, it is possible - // to extrapolate off of this point even further out. Probably - // that is OK because something else should be keeping that from - // happening and should not be worried about at this level. + static int8_t get_cell_index_x(const float &x) { + const int8_t cx = (x - (MESH_MIN_X)) * (1.0 / (MESH_X_DIST)); + return constrain(cx, 0, (GRID_MAX_POINTS_X) - 1); // -1 is appropriate if we want all movement to the X_MAX + } // position. But with this defined this way, it is possible + // to extrapolate off of this point even further out. Probably + // that is OK because something else should be keeping that from + // happening and should not be worried about at this level. + static int8_t get_cell_index_y(const float &y) { + const int8_t cy = (y - (MESH_MIN_Y)) * (1.0 / (MESH_Y_DIST)); + return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 1); // -1 is appropriate if we want all movement to the Y_MAX + } // position. But with this defined this way, it is possible + // to extrapolate off of this point even further out. Probably + // that is OK because something else should be keeping that from + // happening and should not be worried about at this level. - static int8_t find_closest_x_index(const float &x) { - const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5f) * (1.0f / (MESH_X_DIST)); - return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; - } - - static int8_t find_closest_y_index(const float &y) { - const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5f) * (1.0f / (MESH_Y_DIST)); - return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; - } - - /** - * z2 --| - * z0 | | - * | | + (z2-z1) - * z1 | | | - * ---+-------------+--------+-- --| - * a1 a0 a2 - * |<---delta_a---------->| - * - * calc_z0 is the basis for all the Mesh Based correction. It is used to - * find the expected Z Height at a position between two known Z-Height locations. - * - * It is fairly expensive with its 4 floating point additions and 2 floating point - * multiplications. - */ - FORCE_INLINE static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { - return z1 + (z2 - z1) * (a0 - a1) / (a2 - a1); - } - - /** - * z_correction_for_x_on_horizontal_mesh_line is an optimization for - * the case where the printer is making a vertical line that only crosses horizontal mesh lines. - */ - inline static float z_correction_for_x_on_horizontal_mesh_line(const float &rx0, const int x1_i, const int yi) { - if (!WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(yi, 0, GRID_MAX_POINTS_Y - 1)) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - serialprintPGM( !WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) ? PSTR("x1_i") : PSTR("yi") ); - SERIAL_ECHOPAIR(" out of bounds in z_correction_for_x_on_horizontal_mesh_line(rx0=", rx0); - SERIAL_ECHOPAIR(",x1_i=", x1_i); - SERIAL_ECHOPAIR(",yi=", yi); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - // The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN. - return ( - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - UBL_Z_RAISE_WHEN_OFF_MESH - #else - NAN - #endif - ); + static int8_t find_closest_x_index(const float &x) { + const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) * (1.0 / (MESH_X_DIST)); + return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; } - const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0 / (MESH_X_DIST)), - z1 = z_values[x1_i][yi]; - - return z1 + xratio * (z_values[MIN(x1_i, GRID_MAX_POINTS_X - 2) + 1][yi] - z1); // Don't allow x1_i+1 to be past the end of the array - // If it is, it is clamped to the last element of the - // z_values[][] array and no correction is applied. - } - - // - // See comments above for z_correction_for_x_on_horizontal_mesh_line - // - inline static float z_correction_for_y_on_vertical_mesh_line(const float &ry0, const int xi, const int y1_i) { - if (!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(y1_i, 0, GRID_MAX_POINTS_Y - 1)) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - serialprintPGM( !WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) ? PSTR("xi") : PSTR("y1_i") ); - SERIAL_ECHOPAIR(" out of bounds in z_correction_for_y_on_vertical_mesh_line(ry0=", ry0); - SERIAL_ECHOPAIR(", xi=", xi); - SERIAL_ECHOPAIR(", y1_i=", y1_i); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - // The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN. - return ( - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - UBL_Z_RAISE_WHEN_OFF_MESH - #else - NAN - #endif - ); + static int8_t find_closest_y_index(const float &y) { + const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * (1.0 / (MESH_Y_DIST)); + return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; } - const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0 / (MESH_Y_DIST)), - z1 = z_values[xi][y1_i]; - - return z1 + yratio * (z_values[xi][MIN(y1_i, GRID_MAX_POINTS_Y - 2) + 1] - z1); // Don't allow y1_i+1 to be past the end of the array - // If it is, it is clamped to the last element of the - // z_values[][] array and no correction is applied. - } - - /** - * This is the generic Z-Correction. It works anywhere within a Mesh Cell. It first - * does a linear interpolation along both of the bounding X-Mesh-Lines to find the - * Z-Height at both ends. Then it does a linear interpolation of these heights based - * on the Y position within the cell. - */ - static float get_z_correction(const float &rx0, const float &ry0) { - const int8_t cx = get_cell_index_x(rx0), - cy = get_cell_index_y(ry0); // return values are clamped - /** - * Check if the requested location is off the mesh. If so, and - * UBL_Z_RAISE_WHEN_OFF_MESH is specified, that value is returned. + * z2 --| + * z0 | | + * | | + (z2-z1) + * z1 | | | + * ---+-------------+--------+-- --| + * a1 a0 a2 + * |<---delta_a---------->| + * + * calc_z0 is the basis for all the Mesh Based correction. It is used to + * find the expected Z Height at a position between two known Z-Height locations. + * + * It is fairly expensive with its 4 floating point additions and 2 floating point + * multiplications. */ - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - if (!WITHIN(rx0, MESH_MIN_X, MESH_MAX_X) || !WITHIN(ry0, MESH_MIN_Y, MESH_MAX_Y)) - return UBL_Z_RAISE_WHEN_OFF_MESH; - #endif + FORCE_INLINE static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { + return z1 + (z2 - z1) * (a0 - a1) / (a2 - a1); + } - const float z1 = calc_z0(rx0, - mesh_index_to_xpos(cx), z_values[cx][cy], - mesh_index_to_xpos(cx + 1), z_values[MIN(cx, GRID_MAX_POINTS_X - 2) + 1][cy]); - - const float z2 = calc_z0(rx0, - mesh_index_to_xpos(cx), z_values[cx][MIN(cy, GRID_MAX_POINTS_Y - 2) + 1], - mesh_index_to_xpos(cx + 1), z_values[MIN(cx, GRID_MAX_POINTS_X - 2) + 1][MIN(cy, GRID_MAX_POINTS_Y - 2) + 1]); - - float z0 = calc_z0(ry0, - mesh_index_to_ypos(cy), z1, - mesh_index_to_ypos(cy + 1), z2); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(MESH_ADJUST)) { - SERIAL_ECHOPAIR(" raw get_z_correction(", rx0); - SERIAL_CHAR(','); - SERIAL_ECHO(ry0); - SERIAL_ECHOPGM(") = "); - SERIAL_ECHO_F(z0, 6); + /** + * z_correction_for_x_on_horizontal_mesh_line is an optimization for + * the case where the printer is making a vertical line that only crosses horizontal mesh lines. + */ + inline static float z_correction_for_x_on_horizontal_mesh_line(const float &rx0, const int x1_i, const int yi) { + if (!WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(yi, 0, GRID_MAX_POINTS_Y - 1)) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + serialprintPGM( !WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) ? PSTR("x1_i") : PSTR("yi") ); + SERIAL_ECHOPAIR(" out of bounds in z_correction_for_x_on_horizontal_mesh_line(rx0=", rx0); + SERIAL_ECHOPAIR(",x1_i=", x1_i); + SERIAL_ECHOPAIR(",yi=", yi); + SERIAL_CHAR(')'); + SERIAL_EOL(); + } + #endif + return NAN; } - #endif - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(MESH_ADJUST)) { - SERIAL_ECHOPGM(" >>>---> "); - SERIAL_ECHO_F(z0, 6); - SERIAL_EOL(); + const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0 / (MESH_X_DIST)), + z1 = z_values[x1_i][yi]; + + return z1 + xratio * (z_values[min(x1_i, GRID_MAX_POINTS_X - 2) + 1][yi] - z1); // Don't allow x1_i+1 to be past the end of the array + // If it is, it is clamped to the last element of the + // z_values[][] array and no correction is applied. + } + + // + // See comments above for z_correction_for_x_on_horizontal_mesh_line + // + inline static float z_correction_for_y_on_vertical_mesh_line(const float &ry0, const int xi, const int y1_i) { + if (!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(y1_i, 0, GRID_MAX_POINTS_Y - 1)) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + serialprintPGM( !WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) ? PSTR("xi") : PSTR("y1_i") ); + SERIAL_ECHOPAIR(" out of bounds in z_correction_for_y_on_vertical_mesh_line(ry0=", ry0); + SERIAL_ECHOPAIR(", xi=", xi); + SERIAL_ECHOPAIR(", y1_i=", y1_i); + SERIAL_CHAR(')'); + SERIAL_EOL(); + } + #endif + return NAN; } - #endif - if (isnan(z0)) { // if part of the Mesh is undefined, it will show up as NAN - z0 = 0.0; // in ubl.z_values[][] and propagate through the - // calculations. If our correction is NAN, we throw it out - // because part of the Mesh is undefined and we don't have the - // information we need to complete the height correction. + const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0 / (MESH_Y_DIST)), + z1 = z_values[xi][y1_i]; + + return z1 + yratio * (z_values[xi][min(y1_i, GRID_MAX_POINTS_Y - 2) + 1] - z1); // Don't allow y1_i+1 to be past the end of the array + // If it is, it is clamped to the last element of the + // z_values[][] array and no correction is applied. + } + + /** + * This is the generic Z-Correction. It works anywhere within a Mesh Cell. It first + * does a linear interpolation along both of the bounding X-Mesh-Lines to find the + * Z-Height at both ends. Then it does a linear interpolation of these heights based + * on the Y position within the cell. + */ + static float get_z_correction(const float &rx0, const float &ry0) { + const int8_t cx = get_cell_index_x(rx0), + cy = get_cell_index_y(ry0); // return values are clamped + + const float z1 = calc_z0(rx0, + mesh_index_to_xpos(cx), z_values[cx][cy], + mesh_index_to_xpos(cx + 1), z_values[min(cx, GRID_MAX_POINTS_X - 2) + 1][cy]); + + const float z2 = calc_z0(rx0, + mesh_index_to_xpos(cx), z_values[cx][min(cy, GRID_MAX_POINTS_Y - 2) + 1], + mesh_index_to_xpos(cx + 1), z_values[min(cx, GRID_MAX_POINTS_X - 2) + 1][min(cy, GRID_MAX_POINTS_Y - 2) + 1]); + + float z0 = calc_z0(ry0, + mesh_index_to_ypos(cy), z1, + mesh_index_to_ypos(cy + 1), z2); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(MESH_ADJUST)) { - SERIAL_ECHOPAIR("??? Yikes! NAN in get_z_correction(", rx0); + SERIAL_ECHOPAIR(" raw get_z_correction(", rx0); SERIAL_CHAR(','); SERIAL_ECHO(ry0); - SERIAL_CHAR(')'); + SERIAL_ECHOPGM(") = "); + SERIAL_ECHO_F(z0, 6); + } + #endif + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(MESH_ADJUST)) { + SERIAL_ECHOPGM(" >>>---> "); + SERIAL_ECHO_F(z0, 6); SERIAL_EOL(); } #endif + + if (isnan(z0)) { // if part of the Mesh is undefined, it will show up as NAN + z0 = 0.0; // in ubl.z_values[][] and propagate through the + // calculations. If our correction is NAN, we throw it out + // because part of the Mesh is undefined and we don't have the + // information we need to complete the height correction. + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(MESH_ADJUST)) { + SERIAL_ECHOPAIR("??? Yikes! NAN in get_z_correction(", rx0); + SERIAL_CHAR(','); + SERIAL_ECHO(ry0); + SERIAL_CHAR(')'); + SERIAL_EOL(); + } + #endif + } + return z0; } - return z0; - } - FORCE_INLINE static float mesh_index_to_xpos(const uint8_t i) { - return i < GRID_MAX_POINTS_X ? pgm_read_float(&_mesh_index_to_xpos[i]) : MESH_MIN_X + i * (MESH_X_DIST); - } + FORCE_INLINE static float mesh_index_to_xpos(const uint8_t i) { + return i < GRID_MAX_POINTS_X ? pgm_read_float(&_mesh_index_to_xpos[i]) : MESH_MIN_X + i * (MESH_X_DIST); + } - FORCE_INLINE static float mesh_index_to_ypos(const uint8_t i) { - return i < GRID_MAX_POINTS_Y ? pgm_read_float(&_mesh_index_to_ypos[i]) : MESH_MIN_Y + i * (MESH_Y_DIST); - } + FORCE_INLINE static float mesh_index_to_ypos(const uint8_t i) { + return i < GRID_MAX_POINTS_Y ? pgm_read_float(&_mesh_index_to_ypos[i]) : MESH_MIN_Y + i * (MESH_Y_DIST); + } - #if UBL_SEGMENTED - static bool prepare_segmented_line_to(const float (&rtarget)[XYZE], const float &feedrate); - #else - static void line_to_destination_cartesian(const float &fr, const uint8_t e); - #endif + #if UBL_SEGMENTED + static bool prepare_segmented_line_to(const float (&rtarget)[XYZE], const float &feedrate); + #else + static void line_to_destination_cartesian(const float &fr, const uint8_t e); + #endif - inline static bool mesh_is_valid() { - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (isnan(z_values[x][y])) return false; - return true; - } + #define _CMPZ(a,b) (z_values[a][b] == z_values[a][b+1]) + #define CMPZ(a) (_CMPZ(a, 0) && _CMPZ(a, 1)) + #define ZZER(a) (z_values[a][0] == 0) -}; // class unified_bed_leveling + FORCE_INLINE bool mesh_is_valid() { + return !( + ( CMPZ(0) && CMPZ(1) && CMPZ(2) // adjacent z values all equal? + && ZZER(0) && ZZER(1) && ZZER(2) // all zero at the edge? + ) + || isnan(z_values[0][0]) + ); + } + }; // class unified_bed_leveling -extern unified_bed_leveling ubl; + extern unified_bed_leveling ubl; -FORCE_INLINE void gcode_G29() { ubl.G29(); } + FORCE_INLINE void gcode_G29() { ubl.G29(); } +#endif // AUTO_BED_LEVELING_UBL #endif // UNIFIED_BED_LEVELING_H diff --git a/Marlin/ubl_G29.cpp b/Marlin/ubl_G29.cpp index c401fa6..e741e39 100644 --- a/Marlin/ubl_G29.cpp +++ b/Marlin/ubl_G29.cpp @@ -24,8 +24,6 @@ #if ENABLED(AUTO_BED_LEVELING_UBL) - //#define UBL_DEVEL_DEBUGGING - #include "ubl.h" #include "Marlin.h" #include "hex_print_routines.h" @@ -33,8 +31,7 @@ #include "ultralcd.h" #include "stepper.h" #include "planner.h" - #include "parser.h" - #include "serial.h" + #include "gcode.h" #include "bitmap_flags.h" #include @@ -46,9 +43,22 @@ #if ENABLED(NEWPANEL) void lcd_return_to_status(); - void _lcd_ubl_output_map_lcd(); + void lcd_mesh_edit_setup(const float initial); + float lcd_mesh_edit(); + void lcd_z_offset_edit_setup(float); + extern void _lcd_ubl_output_map_lcd(); + float lcd_z_offset_edit(); #endif + extern float meshedit_done; + extern long babysteps_done; + extern float probe_pt(const float &rx, const float &ry, const bool, const uint8_t, const bool=true); + extern bool set_probe_deployed(bool); + extern void set_bed_leveling_enabled(bool); + + typedef void (*screenFunc_t)(); + extern void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder=0); + #define SIZE_OF_LITTLE_RAISE 1 #define BIG_RAISE_NOT_NEEDED 0 @@ -62,8 +72,8 @@ unified_bed_leveling::g29_y_flag; float unified_bed_leveling::g29_x_pos, unified_bed_leveling::g29_y_pos, - unified_bed_leveling::g29_card_thickness = 0, - unified_bed_leveling::g29_constant = 0; + unified_bed_leveling::g29_card_thickness = 0.0, + unified_bed_leveling::g29_constant = 0.0; #if HAS_BED_PROBE int unified_bed_leveling::g29_grid_size; @@ -87,9 +97,8 @@ * C Continue G29 P1 C continues the generation of a partially-constructed Mesh without invalidating * previous measurements. * - * C G29 P2 C tells the Manual Probe subsystem to not use the current nozzle - * location in its search for the closest unmeasured Mesh Point. Instead, attempt to - * start at one end of the uprobed points and Continue sequentially. + * C Constant G29 P2 C specifies a Constant and tells the Manual Probe subsystem to use the current + * location in its search for the closest unmeasured Mesh Point. * * G29 P3 C specifies the Constant for the fill. Otherwise, uses a "reasonable" value. * @@ -138,8 +147,10 @@ * a subsequent G or T leveling operation for backward compatibility. * * P1 Phase 1 Invalidate entire Mesh and continue with automatic generation of the Mesh data using - * the Z-Probe. Usually the probe can't reach all areas that the nozzle can reach. For delta - * printers only the areas where the probe and nozzle can both reach will be automatically probed. + * the Z-Probe. Usually the probe can't reach all areas that the nozzle can reach. On + * Cartesian printers, points within the X_PROBE_OFFSET_FROM_EXTRUDER and Y_PROBE_OFFSET_FROM_EXTRUDER + * area cannot be automatically probed. For Delta printers the area in which DELTA_PROBEABLE_RADIUS + * and DELTA_PRINTABLE_RADIUS do not overlap will not be automatically probed. * * Unreachable points will be handled in Phase 2 and Phase 3. * @@ -202,8 +213,8 @@ * adhesion. * * P4 moves to the closest Mesh Point (and/or the given X Y), raises the nozzle above the mesh height - * by the given 'H' offset (or default 0), and waits while the controller is used to adjust the nozzle - * height. On click the displayed height is saved in the mesh. + * by the given 'H' offset (or default Z_CLEARANCE_BETWEEN_PROBES), and waits while the controller is + * used to adjust the nozzle height. On click the displayed height is saved in the mesh. * * Start Phase 4 at a specific location with X and Y. Adjust a specific number of Mesh Points with * the 'R' (Repeat) parameter. (If 'R' is left out, the whole matrix is assumed.) This command can be @@ -244,7 +255,9 @@ * for subsequent Load and Store operations. Valid storage slot numbers begin at 0 and * extend to a limit related to the available EEPROM storage. * - * S -1 Store Print the current Mesh as G-code that can be used to restore the mesh anytime. + * S -1 Store Store the current Mesh as a print out that is suitable to be feed back into the system + * at a later date. The GCode output can be saved and later replayed by the host software + * to reconstruct the current mesh on another machine. * * T Topology Display the Mesh Map Topology. * 'T' can be used alone (e.g., G29 T) or in combination with most of the other commands. @@ -267,39 +280,47 @@ * * Release Notes: * You MUST do M502, M500 to initialize the storage. Failure to do this will cause all - * kinds of problems. Enabling EEPROM Storage is required. + * kinds of problems. Enabling EEPROM Storage is highly recommended. With EEPROM Storage + * of the mesh, you are limited to 3-Point and Grid Leveling. (G29 P0 T and G29 P0 G + * respectively.) * - * When you do a G28 and G29 P1 to automatically build your first mesh, you are going to notice that - * UBL probes points increasingly further from the starting location. (The starting location defaults - * to the center of the bed.) In contrast, ABL and MBL follow a zigzag pattern. The spiral pattern is - * especially better for Delta printers, since it populates the center of the mesh first, allowing for - * a quicker test print to verify settings. You don't need to populate the entire mesh to use it. - * After all, you don't want to spend a lot of time generating a mesh only to realize the resolution - * or zprobe_zoffset are incorrect. Mesh-generation gathers points starting closest to the nozzle unless - * an (X,Y) coordinate pair is given. + * When you do a G28 and then a G29 P1 to automatically build your first mesh, you are going to notice + * the Unified Bed Leveling probes points further and further away from the starting location. (The + * starting location defaults to the center of the bed.) The original Grid and Mesh leveling used + * a Zig Zag pattern. The new pattern is better, especially for people with Delta printers. This + * allows you to get the center area of the Mesh populated (and edited) quicker. This allows you to + * perform a small print and check out your settings quicker. You do not need to populate the + * entire mesh to use it. (You don't want to spend a lot of time generating a mesh only to realize + * you don't have the resolution or zprobe_zoffset set correctly. The Mesh generation + * gathers points closest to where the nozzle is located unless you specify an (X,Y) coordinate pair. * - * Unified Bed Leveling uses a lot of EEPROM storage to hold its data, and it takes some effort to get - * the mesh just right. To prevent this valuable data from being destroyed as the EEPROM structure - * evolves, UBL stores all mesh data at the end of EEPROM. + * The Unified Bed Leveling uses a lot of EEPROM storage to hold its data. And it takes some effort + * to get this Mesh data correct for a user's printer. We do not want this data destroyed as + * new versions of Marlin add or subtract to the items stored in EEPROM. So, for the benefit of + * the users, we store the Mesh data at the end of the EEPROM and do not keep it contiguous with the + * other data stored in the EEPROM. (For sure the developers are going to complain about this, but + * this is going to be helpful to the users!) * - * UBL is founded on Edward Patel's Mesh Bed Leveling code. A big 'Thanks!' to him and the creators of - * 3-Point and Grid Based leveling. Combining their contributions we now have the functionality and - * features of all three systems combined. + * The foundation of this Bed Leveling System is built on Epatel's Mesh Bed Leveling code. A big + * 'Thanks!' to him and the creators of 3-Point and Grid Based leveling. Combining their contributions + * we now have the functionality and features of all three systems combined. */ void unified_bed_leveling::G29() { - if (g29_parameter_parsing()) return; // Abort on parameter error + if (!settings.calc_num_meshes()) { + SERIAL_PROTOCOLLNPGM("?Enable EEPROM and init with"); + SERIAL_PROTOCOLLNPGM("M502, M500, M501 in that order.\n"); + return; + } - const int8_t p_val = parser.intval('P', -1); - const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen('J'); + if (g29_parameter_parsing()) return; // abort if parsing the simple parameters causes a problem, // Check for commands that require the printer to be homed - if (may_move) { - #if ENABLED(DUAL_X_CARRIAGE) - if (active_extruder != 0) tool_change(0); - #endif - if (axis_unhomed_error()) home_all_axes(); + if (axis_unhomed_error()) { + const int8_t p_val = parser.intval('P', -1); + if (p_val == 1 || p_val == 2 || p_val == 4 || parser.seen('J')) + home_all_axes(); } // Invalidate Mesh Points. This command is a little bit asymmetrical because @@ -343,23 +364,23 @@ case 0: for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a bowl shape - similar to for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { // a poorly calibrated Delta. - const float p1 = 0.5f * (GRID_MAX_POINTS_X) - x, - p2 = 0.5f * (GRID_MAX_POINTS_Y) - y; - z_values[x][y] += 2.0f * HYPOT(p1, p2); + const float p1 = 0.5 * (GRID_MAX_POINTS_X) - x, + p2 = 0.5 * (GRID_MAX_POINTS_Y) - y; + z_values[x][y] += 2.0 * HYPOT(p1, p2); } } break; case 1: for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a diagonal line several Mesh cells thick that is raised - z_values[x][x] += 9.999f; - z_values[x][x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1] += 9.999f; // We want the altered line several mesh points thick + z_values[x][x] += 9.999; + z_values[x][x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1] += 9.999; // We want the altered line several mesh points thick } break; case 2: // Allow the user to specify the height because 10mm is a little extreme in some cases. for (uint8_t x = (GRID_MAX_POINTS_X) / 3; x < 2 * (GRID_MAX_POINTS_X) / 3; x++) // Create a rectangular raised area in for (uint8_t y = (GRID_MAX_POINTS_Y) / 3; y < 2 * (GRID_MAX_POINTS_Y) / 3; y++) // the center of the bed - z_values[x][y] += parser.seen('C') ? g29_constant : 9.99f; + z_values[x][y] += parser.seen('C') ? g29_constant : 9.99; break; } } @@ -369,17 +390,36 @@ if (parser.seen('J')) { if (g29_grid_size) { // if not 0 it is a normal n x n grid being probed save_ubl_active_state_and_disable(); - tilt_mesh_based_on_probed_grid(false /* false says to do normal grid probing */ ); + tilt_mesh_based_on_probed_grid(parser.seen('T')); restore_ubl_active_state_and_leave(); } else { // grid_size == 0 : A 3-Point leveling has been requested + float z3, z2, z1 = probe_pt(UBL_PROBE_PT_1_X, UBL_PROBE_PT_1_Y, false, g29_verbose_level); + if (!isnan(z1)) { + z2 = probe_pt(UBL_PROBE_PT_2_X, UBL_PROBE_PT_2_Y, false, g29_verbose_level); + if (!isnan(z2)) + z3 = probe_pt(UBL_PROBE_PT_3_X, UBL_PROBE_PT_3_Y, true, g29_verbose_level); + } + + if (isnan(z1) || isnan(z2) || isnan(z3)) { // probe_pt will return NAN if unreachable + SERIAL_ERROR_START(); + SERIAL_ERRORLNPGM("Attempt to probe off the bed."); + goto LEAVE; + } + + // Adjust z1, z2, z3 by the Mesh Height at these points. Just because they're non-zero + // doesn't mean the Mesh is tilted! (Compensate each probe point by what the Mesh says + // its height is.) save_ubl_active_state_and_disable(); - tilt_mesh_based_on_probed_grid(true /* true says to do 3-Point leveling */ ); + z1 -= get_z_correction(UBL_PROBE_PT_1_X, UBL_PROBE_PT_1_Y) /* + zprobe_zoffset */ ; + z2 -= get_z_correction(UBL_PROBE_PT_2_X, UBL_PROBE_PT_2_Y) /* + zprobe_zoffset */ ; + z3 -= get_z_correction(UBL_PROBE_PT_3_X, UBL_PROBE_PT_3_Y) /* + zprobe_zoffset */ ; + + do_blocking_move_to_xy(0.5 * (MESH_MAX_X - (MESH_MIN_X)), 0.5 * (MESH_MAX_Y - (MESH_MIN_Y))); + tilt_mesh_based_on_3pts(z1, z2, z3); restore_ubl_active_state_and_leave(); } - do_blocking_move_to_xy(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y))); - report_current_position(); } #endif // HAS_BED_PROBE @@ -417,8 +457,6 @@ } probe_entire_mesh(g29_x_pos + X_PROBE_OFFSET_FROM_EXTRUDER, g29_y_pos + Y_PROBE_OFFSET_FROM_EXTRUDER, parser.seen('T'), parser.seen('E'), parser.seen('U')); - - report_current_position(); break; #endif // HAS_BED_PROBE @@ -431,7 +469,7 @@ SERIAL_PROTOCOLLNPGM("Manually probing unreachable mesh locations."); do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - if (parser.seen('C') && !g29_x_flag && !g29_y_flag) { + if (!g29_x_flag && !g29_y_flag) { /** * Use a good default location for the path. * The flipped > and < operators in these comparisons is intentional. @@ -448,9 +486,14 @@ #endif } + if (parser.seen('C')) { + g29_x_pos = current_position[X_AXIS]; + g29_y_pos = current_position[Y_AXIS]; + } + if (parser.seen('B')) { - g29_card_thickness = parser.has_value() ? parser.value_float() : measure_business_card_thickness((float) Z_CLEARANCE_BETWEEN_PROBES); - if (ABS(g29_card_thickness) > 1.5f) { + g29_card_thickness = parser.has_value() ? parser.value_float() : measure_business_card_thickness(Z_CLEARANCE_BETWEEN_PROBES); + if (FABS(g29_card_thickness) > 1.5) { SERIAL_PROTOCOLLNPGM("?Error in Business Card measurement."); return; } @@ -466,8 +509,6 @@ SERIAL_PROTOCOLLNPGM("G29 P2 finished."); - report_current_position(); - #else SERIAL_PROTOCOLLNPGM("?P2 is only available when an LCD is present."); @@ -506,7 +547,7 @@ } else { const float cvf = parser.value_float(); - switch ((int)truncf(cvf * 10.0f) - 30) { // 3.1 -> 1 + switch((int)truncf(cvf * 10.0) - 30) { // 3.1 -> 1 #if ENABLED(UBL_G29_P31) case 1: { @@ -516,8 +557,8 @@ // P3.12 100X distance weighting // P3.13 1000X distance weighting, approaches simple average of nearest points - const float weight_power = (cvf - 3.10f) * 100.0f, // 3.12345 -> 2.345 - weight_factor = weight_power ? POW(10.0f, weight_power) : 0; + const float weight_power = (cvf - 3.10) * 100.0, // 3.12345 -> 2.345 + weight_factor = weight_power ? POW(10.0, weight_power) : 0; smart_fill_wlsf(weight_factor); } break; @@ -540,7 +581,7 @@ #endif break; - case 5: adjust_mesh_to_mean(g29_c_flag, g29_constant); break; + case 5: find_mean_mesh_height(); break; case 6: shift_mesh_height(); break; } @@ -593,8 +634,21 @@ if (parser.seen('S')) { // Store (or Save) Current Mesh Data g29_storage_slot = parser.has_value() ? parser.value_int() : storage_slot; - if (g29_storage_slot == -1) // Special case, the user wants to 'Export' the mesh to the - return report_current_mesh(); // host program to be saved on the user's computer + if (g29_storage_slot == -1) { // Special case, we are going to 'Export' the mesh to the + SERIAL_ECHOLNPGM("G29 I 999"); // host in a form it can be reconstructed on a different machine + for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) + for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) + if (!isnan(z_values[x][y])) { + SERIAL_ECHOPAIR("M421 I ", x); + SERIAL_ECHOPAIR(" J ", y); + SERIAL_ECHOPGM(" Z "); + SERIAL_ECHO_F(z_values[x][y], 6); + SERIAL_ECHOPAIR(" ; X ", LOGICAL_X_POSITION(mesh_index_to_xpos(x))); + SERIAL_ECHOPAIR(", Y ", LOGICAL_Y_POSITION(mesh_index_to_ypos(y))); + SERIAL_EOL(); + } + return; + } int16_t a = settings.calc_num_meshes(); @@ -622,16 +676,16 @@ #if ENABLED(NEWPANEL) lcd_reset_alert_level(); - lcd_quick_feedback(true); - lcd_reset_status(); + LCD_MESSAGEPGM(""); + lcd_quick_feedback(); lcd_external_control = false; #endif return; } - void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const float value) { - float sum = 0; + void unified_bed_leveling::find_mean_mesh_height() { + float sum = 0.0; int n = 0; for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) @@ -645,7 +699,7 @@ // // Sum the squares of difference from mean // - float sum_of_diff_squared = 0; + float sum_of_diff_squared = 0.0; for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) if (!isnan(z_values[x][y])) @@ -661,11 +715,11 @@ SERIAL_ECHO_F(sigma, 6); SERIAL_EOL(); - if (cflag) + if (g29_c_flag) for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) if (!isnan(z_values[x][y])) - z_values[x][y] -= mean + value; + z_values[x][y] -= mean + g29_constant; } void unified_bed_leveling::shift_mesh_height() { @@ -681,13 +735,12 @@ bool click_and_hold(const clickFunc_t func=NULL) { if (is_lcd_clicked()) { - lcd_quick_feedback(false); // Do NOT clear button status! If cleared, the code - // code can not look for a 'click and hold' + lcd_quick_feedback(); const millis_t nxt = millis() + 1500UL; while (is_lcd_clicked()) { // Loop while the encoder is pressed. Uses hardware flag! idle(); // idle, of course if (ELAPSED(millis(), nxt)) { // After 1.5 seconds - lcd_quick_feedback(true); + lcd_quick_feedback(); if (func) (*func)(); wait_for_release(); safe_delay(50); // Debounce the Encoder wheel @@ -695,7 +748,6 @@ } } } - safe_delay(15); return false; } @@ -706,7 +758,7 @@ * Probe all invalidated locations of the mesh that can be reached by the probe. * This attempts to fill in locations closest to the nozzle's start location first. */ - void unified_bed_leveling::probe_entire_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) { + void unified_bed_leveling::probe_entire_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map, const bool stow_probe, bool close_or_far) { mesh_index_pair location; #if ENABLED(NEWPANEL) @@ -716,7 +768,7 @@ save_ubl_active_state_and_disable(); // we don't do bed level correction because we want the raw data when we probe DEPLOY_PROBE(); - uint16_t count = GRID_MAX_POINTS; + uint16_t max_iterations = GRID_MAX_POINTS; do { if (do_ubl_mesh_map) display_map(g29_map_type); @@ -724,18 +776,16 @@ #if ENABLED(NEWPANEL) if (is_lcd_clicked()) { SERIAL_PROTOCOLLNPGM("\nMesh only partially populated.\n"); - lcd_quick_feedback(false); + lcd_quick_feedback(); STOW_PROBE(); - while (is_lcd_clicked()) idle(); + wait_for_release(); lcd_external_control = false; restore_ubl_active_state_and_leave(); - lcd_quick_feedback(true); - safe_delay(50); // Debounce the Encoder wheel return; } #endif - if (do_furthest) + if (close_or_far) location = find_furthest_invalid_mesh_point(); else location = find_closest_mesh_point_of_type(INVALID, rx, ry, USE_PROBE_AS_REFERENCE, NULL); @@ -744,18 +794,13 @@ const float rawx = mesh_index_to_xpos(location.x_index), rawy = mesh_index_to_ypos(location.y_index); - const float measured_z = probe_pt(rawx, rawy, stow_probe ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling + const float measured_z = probe_pt(rawx, rawy, stow_probe, g29_verbose_level); // TODO: Needs error handling z_values[location.x_index][location.y_index] = measured_z; } - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (location.x_index >= 0 && --count); + + } while (location.x_index >= 0 && --max_iterations); STOW_PROBE(); - - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - restore_ubl_active_state_and_leave(); do_blocking_move_to_xy( @@ -764,6 +809,109 @@ ); } + void unified_bed_leveling::tilt_mesh_based_on_3pts(const float &z1, const float &z2, const float &z3) { + matrix_3x3 rotation; + vector_3 v1 = vector_3( (UBL_PROBE_PT_1_X - UBL_PROBE_PT_2_X), + (UBL_PROBE_PT_1_Y - UBL_PROBE_PT_2_Y), + (z1 - z2) ), + + v2 = vector_3( (UBL_PROBE_PT_3_X - UBL_PROBE_PT_2_X), + (UBL_PROBE_PT_3_Y - UBL_PROBE_PT_2_Y), + (z3 - z2) ), + + normal = vector_3::cross(v1, v2); + + normal = normal.get_normal(); + + /** + * This vector is normal to the tilted plane. + * However, we don't know its direction. We need it to point up. So if + * Z is negative, we need to invert the sign of all components of the vector + */ + if (normal.z < 0.0) { + normal.x = -normal.x; + normal.y = -normal.y; + normal.z = -normal.z; + } + + rotation = matrix_3x3::create_look_at(vector_3(normal.x, normal.y, 1)); + + if (g29_verbose_level > 2) { + SERIAL_ECHOPGM("bed plane normal = ["); + SERIAL_PROTOCOL_F(normal.x, 7); + SERIAL_PROTOCOLCHAR(','); + SERIAL_PROTOCOL_F(normal.y, 7); + SERIAL_PROTOCOLCHAR(','); + SERIAL_PROTOCOL_F(normal.z, 7); + SERIAL_ECHOLNPGM("]"); + rotation.debug(PSTR("rotation matrix:")); + } + + // + // All of 3 of these points should give us the same d constant + // + + float t = normal.x * (UBL_PROBE_PT_1_X) + normal.y * (UBL_PROBE_PT_1_Y), + d = t + normal.z * z1; + + if (g29_verbose_level>2) { + SERIAL_ECHOPGM("D constant: "); + SERIAL_PROTOCOL_F(d, 7); + SERIAL_ECHOLNPGM(" "); + } + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPGM("d from 1st point: "); + SERIAL_ECHO_F(d, 6); + SERIAL_EOL(); + t = normal.x * (UBL_PROBE_PT_2_X) + normal.y * (UBL_PROBE_PT_2_Y); + d = t + normal.z * z2; + SERIAL_ECHOPGM("d from 2nd point: "); + SERIAL_ECHO_F(d, 6); + SERIAL_EOL(); + t = normal.x * (UBL_PROBE_PT_3_X) + normal.y * (UBL_PROBE_PT_3_Y); + d = t + normal.z * z3; + SERIAL_ECHOPGM("d from 3rd point: "); + SERIAL_ECHO_F(d, 6); + SERIAL_EOL(); + } + #endif + + for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { + for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { + float x_tmp = mesh_index_to_xpos(i), + y_tmp = mesh_index_to_ypos(j), + z_tmp = z_values[i][j]; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPGM("before rotation = ["); + SERIAL_PROTOCOL_F(x_tmp, 7); + SERIAL_PROTOCOLCHAR(','); + SERIAL_PROTOCOL_F(y_tmp, 7); + SERIAL_PROTOCOLCHAR(','); + SERIAL_PROTOCOL_F(z_tmp, 7); + SERIAL_ECHOPGM("] ---> "); + safe_delay(20); + } + #endif + apply_rotation_xyz(rotation, x_tmp, y_tmp, z_tmp); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPGM("after rotation = ["); + SERIAL_PROTOCOL_F(x_tmp, 7); + SERIAL_PROTOCOLCHAR(','); + SERIAL_PROTOCOL_F(y_tmp, 7); + SERIAL_PROTOCOLCHAR(','); + SERIAL_PROTOCOL_F(z_tmp, 7); + SERIAL_ECHOLNPGM("]"); + safe_delay(55); + } + #endif + z_values[i][j] += z_tmp - d; + } + } + } #endif // HAS_BED_PROBE @@ -773,7 +921,6 @@ wait_for_release(); while (!is_lcd_clicked()) { idle(); - reset_stepper_timeout(); // Keep steppers powered if (encoder_diff) { do_blocking_move_to_z(current_position[Z_AXIS] + float(encoder_diff) * multiplier); encoder_diff = 0; @@ -783,20 +930,20 @@ float unified_bed_leveling::measure_point_with_encoder() { KEEPALIVE_STATE(PAUSED_FOR_USER); - move_z_with_encoder(0.01f); + move_z_with_encoder(0.01); KEEPALIVE_STATE(IN_HANDLER); return current_position[Z_AXIS]; } static void echo_and_take_a_measurement() { SERIAL_PROTOCOLLNPGM(" and take a measurement."); } - float unified_bed_leveling::measure_business_card_thickness(float in_height) { + float unified_bed_leveling::measure_business_card_thickness(const float &in_height) { lcd_external_control = true; save_ubl_active_state_and_disable(); // Disable bed level correction for probing - do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), in_height); - //, MIN(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]) * 0.5f); - planner.synchronize(); + do_blocking_move_to(0.5 * (MESH_MAX_X - (MESH_MIN_X)), 0.5 * (MESH_MAX_Y - (MESH_MIN_Y)), in_height); + //, min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]) / 2.0); + stepper.synchronize(); SERIAL_PROTOCOLPGM("Place shim under nozzle"); LCD_MESSAGEPGM(MSG_UBL_BC_INSERT); @@ -805,7 +952,7 @@ const float z1 = measure_point_with_encoder(); do_blocking_move_to_z(current_position[Z_AXIS] + SIZE_OF_LITTLE_RAISE); - planner.synchronize(); + stepper.synchronize(); SERIAL_PROTOCOLPGM("Remove shim"); LCD_MESSAGEPGM(MSG_UBL_BC_REMOVE); @@ -815,7 +962,7 @@ do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES); - const float thickness = ABS(z1 - z2); + const float thickness = abs(z1 - z2); if (g29_verbose_level > 1) { SERIAL_PROTOCOLPGM("Business Card is "); @@ -835,7 +982,6 @@ do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE); lcd_external_control = false; KEEPALIVE_STATE(IN_HANDLER); - lcd_quick_feedback(true); ubl.restore_ubl_active_state_and_leave(); } @@ -844,7 +990,7 @@ lcd_external_control = true; save_ubl_active_state_and_disable(); // we don't do bed level correction because we want the raw data when we probe - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_clearance); + do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); lcd_return_to_status(); @@ -871,8 +1017,8 @@ serialprintPGM(parser.seen('B') ? PSTR(MSG_UBL_BC_INSERT) : PSTR(MSG_UBL_BC_INSERT2)); - const float z_step = 0.01f; // existing behavior: 0.01mm per click, occasionally step - //const float z_step = planner.steps_to_mm[Z_AXIS]; // approx one step each click + const float z_step = 0.01; // existing behavior: 0.01mm per click, occasionally step + //const float z_step = 1.0 / planner.axis_steps_per_mm[Z_AXIS]; // approx one step each click move_z_with_encoder(z_step); @@ -891,10 +1037,9 @@ SERIAL_PROTOCOL_F(z_values[location.x_index][location.y_index], 6); SERIAL_EOL(); } - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. } while (location.x_index >= 0 && location.y_index >= 0); - if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing + if (do_ubl_mesh_map) display_map(g29_map_type); restore_ubl_active_state_and_leave(); KEEPALIVE_STATE(IN_HANDLER); @@ -907,10 +1052,10 @@ #if ENABLED(NEWPANEL) LCD_MESSAGEPGM(MSG_UBL_DOING_G29); - lcd_quick_feedback(true); + lcd_quick_feedback(); #endif - g29_constant = 0; + g29_constant = 0.0; g29_repetition_cnt = 0; g29_x_flag = parser.seenval('X'); @@ -1001,7 +1146,7 @@ #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) if (parser.seenval('F')) { const float fh = parser.value_float(); - if (!WITHIN(fh, 0, 100)) { + if (!WITHIN(fh, 0.0, 100.0)) { SERIAL_PROTOCOLLNPGM("?(F)ade height for Bed Level Correction not plausible.\n"); return UBL_ERR; } @@ -1019,18 +1164,18 @@ static uint8_t ubl_state_at_invocation = 0; - #ifdef UBL_DEVEL_DEBUGGING + #if ENABLED(UBL_DEVEL_DEBUGGING) static uint8_t ubl_state_recursion_chk = 0; #endif void unified_bed_leveling::save_ubl_active_state_and_disable() { - #ifdef UBL_DEVEL_DEBUGGING + #if ENABLED(UBL_DEVEL_DEBUGGING) ubl_state_recursion_chk++; if (ubl_state_recursion_chk != 1) { SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row."); #if ENABLED(NEWPANEL) LCD_MESSAGEPGM(MSG_UBL_SAVE_ERROR); - lcd_quick_feedback(true); + lcd_quick_feedback(); #endif return; } @@ -1040,12 +1185,12 @@ } void unified_bed_leveling::restore_ubl_active_state_and_leave() { - #ifdef UBL_DEVEL_DEBUGGING + #if ENABLED(UBL_DEVEL_DEBUGGING) if (--ubl_state_recursion_chk) { SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times."); #if ENABLED(NEWPANEL) LCD_MESSAGEPGM(MSG_UBL_RESTORE_ERROR); - lcd_quick_feedback(true); + lcd_quick_feedback(); #endif return; } @@ -1072,12 +1217,12 @@ SERIAL_PROTOCOLLNPAIR("UBL object count: ", (int)ubl_cnt); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - SERIAL_PROTOCOLPGM("planner.z_fade_height : "); + SERIAL_PROTOCOL("planner.z_fade_height : "); SERIAL_PROTOCOL_F(planner.z_fade_height, 4); SERIAL_EOL(); #endif - adjust_mesh_to_mean(g29_c_flag, g29_constant); + find_mean_mesh_height(); #if HAS_BED_PROBE SERIAL_PROTOCOLPGM("zprobe_zoffset: "); @@ -1086,20 +1231,17 @@ #endif SERIAL_ECHOLNPAIR("MESH_MIN_X " STRINGIFY(MESH_MIN_X) "=", MESH_MIN_X); - safe_delay(50); SERIAL_ECHOLNPAIR("MESH_MIN_Y " STRINGIFY(MESH_MIN_Y) "=", MESH_MIN_Y); - safe_delay(50); + safe_delay(25); SERIAL_ECHOLNPAIR("MESH_MAX_X " STRINGIFY(MESH_MAX_X) "=", MESH_MAX_X); - safe_delay(50); SERIAL_ECHOLNPAIR("MESH_MAX_Y " STRINGIFY(MESH_MAX_Y) "=", MESH_MAX_Y); - safe_delay(50); + safe_delay(25); SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_X ", GRID_MAX_POINTS_X); - safe_delay(50); SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_Y ", GRID_MAX_POINTS_Y); - safe_delay(50); + safe_delay(25); SERIAL_ECHOLNPAIR("MESH_X_DIST ", MESH_X_DIST); SERIAL_ECHOLNPAIR("MESH_Y_DIST ", MESH_Y_DIST); - safe_delay(50); + safe_delay(25); SERIAL_PROTOCOLPGM("X-Axis Mesh Points at: "); for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { @@ -1124,15 +1266,15 @@ SERIAL_EOL(); safe_delay(50); - #ifdef UBL_DEVEL_DEBUGGING + #if ENABLED(UBL_DEVEL_DEBUGGING) SERIAL_PROTOCOLLNPAIR("ubl_state_at_invocation :", ubl_state_at_invocation); SERIAL_EOL(); SERIAL_PROTOCOLLNPAIR("ubl_state_recursion_chk :", ubl_state_recursion_chk); SERIAL_EOL(); safe_delay(50); - SERIAL_PROTOCOLPAIR("Meshes go from ", hex_address((void*)settings.meshes_start_index())); - SERIAL_PROTOCOLLNPAIR(" to ", hex_address((void*)settings.meshes_end_index())); + SERIAL_PROTOCOLPAIR("Meshes go from ", hex_address((void*)settings.get_start_of_meshes())); + SERIAL_PROTOCOLLNPAIR(" to ", hex_address((void*)settings.get_end_of_meshes())); safe_delay(50); SERIAL_PROTOCOLLNPAIR("sizeof(ubl) : ", (int)sizeof(ubl)); @@ -1141,7 +1283,7 @@ SERIAL_EOL(); safe_delay(25); - SERIAL_PROTOCOLLNPAIR("EEPROM free for UBL: ", hex_address((void*)(settings.meshes_end_index() - settings.meshes_start_index()))); + SERIAL_PROTOCOLLNPAIR("EEPROM free for UBL: ", hex_address((void*)(settings.get_end_of_meshes() - settings.get_start_of_meshes()))); safe_delay(50); SERIAL_PROTOCOLPAIR("EEPROM can hold ", settings.calc_num_meshes()); @@ -1165,13 +1307,13 @@ SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("EEPROM Dump:"); - for (uint16_t i = 0; i <= E2END; i += 16) { + for (uint16_t i = 0; i < E2END + 1; i += 16) { if (!(i & 0x3)) idle(); print_hex_word(i); SERIAL_ECHOPGM(": "); for (uint16_t j = 0; j < 16; j++) { kkkk = i + j; - eeprom_read_block(&cccc, (const void *)kkkk, sizeof(unsigned char)); + eeprom_read_block(&cccc, (const void *) kkkk, sizeof(unsigned char)); print_hex_byte(cccc); SERIAL_ECHO(' '); } @@ -1223,7 +1365,7 @@ mesh_index_pair out_mesh; out_mesh.x_index = out_mesh.y_index = -1; - out_mesh.distance = -99999.99f; + out_mesh.distance = -99999.99; for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { @@ -1238,22 +1380,22 @@ found_a_NAN = true; - int8_t closest_x = -1, closest_y = -1; - float d1, d2 = 99999.9f; + int8_t closest_x=-1, closest_y=-1; + float d1, d2 = 99999.9; for (int8_t k = 0; k < GRID_MAX_POINTS_X; k++) { for (int8_t l = 0; l < GRID_MAX_POINTS_Y; l++) { if (!isnan(z_values[k][l])) { found_a_real = true; - // Add in a random weighting factor that scrambles the probing of the - // last half of the mesh (when every unprobed mesh point is one index - // from a probed location). + // Add in a random weighting factor that scrambles the probing of the + // last half of the mesh (when every unprobed mesh point is one index + // from a probed location). - d1 = HYPOT(i - k, j - l) + (1.0f / ((millis() % 47) + 13)); + d1 = HYPOT(i - k, j - l) + (1.0 / ((millis() % 47) + 13)); if (d1 < d2) { // found a closer distance from invalid mesh point at (i,j) to defined mesh point at (k,l) - d2 = d1; // found a closer location with - closest_x = i; // an assigned mesh point value + d2 = d1; // found a closer location with + closest_x = i; // an assigned mesh point value closest_y = j; } } @@ -1261,7 +1403,7 @@ } // - // At this point d2 should have the closest defined mesh point to invalid mesh point (i,j) + // at this point d2 should have the closest defined mesh point to invalid mesh point (i,j) // if (found_a_real && (closest_x >= 0) && (d2 > out_mesh.distance)) { @@ -1276,7 +1418,7 @@ if (!found_a_real && found_a_NAN) { // if the mesh is totally unpopulated, start the probing out_mesh.x_index = GRID_MAX_POINTS_X / 2; out_mesh.y_index = GRID_MAX_POINTS_Y / 2; - out_mesh.distance = 1; + out_mesh.distance = 1.0; } return out_mesh; } @@ -1284,13 +1426,13 @@ mesh_index_pair unified_bed_leveling::find_closest_mesh_point_of_type(const MeshPointType type, const float &rx, const float &ry, const bool probe_as_reference, uint16_t bits[16]) { mesh_index_pair out_mesh; out_mesh.x_index = out_mesh.y_index = -1; - out_mesh.distance = -99999.9f; + out_mesh.distance = -99999.9; // Get our reference position. Either the nozzle or probe location. const float px = rx - (probe_as_reference == USE_PROBE_AS_REFERENCE ? X_PROBE_OFFSET_FROM_EXTRUDER : 0), py = ry - (probe_as_reference == USE_PROBE_AS_REFERENCE ? Y_PROBE_OFFSET_FROM_EXTRUDER : 0); - float best_so_far = 99999.99f; + float best_so_far = 99999.99; for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { @@ -1317,7 +1459,7 @@ // factor in the distance from the current location for the normal case // so the nozzle isn't running all over the bed. - distance += HYPOT(current_position[X_AXIS] - mx, current_position[Y_AXIS] - my) * 0.1f; + distance += HYPOT(current_position[X_AXIS] - mx, current_position[Y_AXIS] - my) * 0.1; if (distance < best_so_far) { best_so_far = distance; // We found a closer location with out_mesh.x_index = i; // the specified type of mesh value. @@ -1337,7 +1479,6 @@ lcd_return_to_status(); do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); LCD_MESSAGEPGM(MSG_EDITING_STOPPED); - lcd_quick_feedback(true); } void unified_bed_leveling::fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map) { @@ -1345,8 +1486,9 @@ g29_repetition_cnt = 1; // do exactly one mesh location. Otherwise use what the parser decided. #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - const float h_offset = parser.seenval('H') ? parser.value_linear_units() : 0; - if (!WITHIN(h_offset, 0, 10)) { + const bool is_offset = parser.seen('H'); + const float h_offset = is_offset ? parser.value_linear_units() : Z_CLEARANCE_BETWEEN_PROBES; + if (is_offset && !WITHIN(h_offset, 0, 10)) { SERIAL_PROTOCOLLNPGM("Offset out of bounds. (0 to 10mm)\n"); return; } @@ -1362,63 +1504,65 @@ save_ubl_active_state_and_disable(); LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH); - lcd_external_control = true; // Take over control of the LCD encoder - do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset - #endif + do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); uint16_t not_done[16]; memset(not_done, 0xFF, sizeof(not_done)); do { location = find_closest_mesh_point_of_type(SET_IN_BITMAP, rx, ry, USE_NOZZLE_AS_REFERENCE, not_done); - if (location.x_index < 0) break; // Stop when there are no more reachable points + if (location.x_index < 0) break; // stop when we can't find any more reachable points. - bitmap_clear(not_done, location.x_index, location.y_index); // Mark this location as 'adjusted' so a new - // location is used on the next loop + bitmap_clear(not_done, location.x_index, location.y_index); // Mark this location as 'adjusted' so we will find a + // different location the next time through the loop const float rawx = mesh_index_to_xpos(location.x_index), rawy = mesh_index_to_ypos(location.y_index); - if (!position_is_reachable(rawx, rawy)) break; // SHOULD NOT OCCUR because find_closest_mesh_point_of_type will only return reachable + if (!position_is_reachable(rawx, rawy)) // SHOULD NOT OCCUR because find_closest_mesh_point_of_type will only return reachable + break; - do_blocking_move_to(rawx, rawy, Z_CLEARANCE_BETWEEN_PROBES); // Move the nozzle to the edit point with probe clearance - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset before editing - #endif + do_blocking_move_to(rawx, rawy, Z_CLEARANCE_BETWEEN_PROBES); // Move the nozzle to the edit point KEEPALIVE_STATE(PAUSED_FOR_USER); + lcd_external_control = true; - if (do_ubl_mesh_map) display_map(g29_map_type); // Display the current point + if (do_ubl_mesh_map) display_map(g29_map_type); // show the user which point is being adjusted lcd_refresh(); float new_z = z_values[location.x_index][location.y_index]; - if (isnan(new_z)) new_z = 0; // Invalid points begin at 0 - new_z = FLOOR(new_z * 1000) * 0.001f; // Chop off digits after the 1000ths place + if (isnan(new_z)) new_z = 0.0; // Set invalid mesh points to 0.0 so they can be edited + new_z = FLOOR(new_z * 1000.0) * 0.001; // Chop off digits after the 1000ths place lcd_mesh_edit_setup(new_z); - do { + while (!is_lcd_clicked()) { new_z = lcd_mesh_edit(); #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset + new_z); // Move the nozzle as the point is edited + do_blocking_move_to_z(h_offset + new_z); // Move the nozzle as the point is edited #endif idle(); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (!is_lcd_clicked()); + } - if (!lcd_map_control) lcd_return_to_status(); // Just editing a single point? Return to status + if (!lcd_map_control) lcd_return_to_status(); - if (click_and_hold(abort_fine_tune)) goto FINE_TUNE_EXIT; // If the click is held down, abort editing + // The technique used here generates a race condition for the encoder click. + // It could get detected in lcd_mesh_edit (actually _lcd_mesh_fine_tune) or here. + // Let's work on specifying a proper API for the LCD ASAP, OK? + lcd_external_control = true; - z_values[location.x_index][location.y_index] = new_z; // Save the updated Z value + // this sequence to detect an is_lcd_clicked() debounce it and leave if it is + // a Press and Hold is repeated in a lot of places (including G26_Mesh_Validation.cpp). This + // should be redone and compressed. + if (click_and_hold(abort_fine_tune)) + goto FINE_TUNE_EXIT; + + safe_delay(20); // We don't want any switch noise. + + z_values[location.x_index][location.y_index] = new_z; - safe_delay(20); // No switch noise lcd_refresh(); } while (location.x_index >= 0 && --g29_repetition_cnt > 0); @@ -1458,7 +1602,7 @@ if (z_values[x1][y1] < z_values[x2][y2]) // Angled downward? z_values[x][y] = z_values[x1][y1]; // Use nearest (maybe a little too high.) else - z_values[x][y] = 2.0f * z_values[x1][y1] - z_values[x2][y2]; // Angled upward... + z_values[x][y] = 2.0 * z_values[x1][y1] - z_values[x2][y2]; // Angled upward... return true; } return false; @@ -1495,143 +1639,74 @@ #if HAS_BED_PROBE - #include "vector_3.h" + void unified_bed_leveling::tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map) { + constexpr int16_t x_min = max(MIN_PROBE_X, MESH_MIN_X), + x_max = min(MAX_PROBE_X, MESH_MAX_X), + y_min = max(MIN_PROBE_Y, MESH_MIN_Y), + y_max = min(MAX_PROBE_Y, MESH_MAX_Y); - void unified_bed_leveling::tilt_mesh_based_on_probed_grid(const bool do_3_pt_leveling) { - constexpr int16_t x_min = MAX(MIN_PROBE_X, MESH_MIN_X), - x_max = MIN(MAX_PROBE_X, MESH_MAX_X), - y_min = MAX(MIN_PROBE_Y, MESH_MIN_Y), - y_max = MIN(MAX_PROBE_Y, MESH_MAX_Y); - - bool abort_flag = false; - - float measured_z; - - const float dx = float(x_max - x_min) / (g29_grid_size - 1), - dy = float(y_max - y_min) / (g29_grid_size - 1); + const float dx = float(x_max - x_min) / (g29_grid_size - 1.0), + dy = float(y_max - y_min) / (g29_grid_size - 1.0); struct linear_fit_data lsf_results; - - //float z1, z2, z3; // Needed for algorithm validation down below. - incremental_LSF_reset(&lsf_results); - if (do_3_pt_leveling) { - measured_z = probe_pt(PROBE_PT_1_X, PROBE_PT_1_Y, PROBE_PT_RAISE, g29_verbose_level); - if (isnan(measured_z)) - abort_flag = true; - else { - measured_z -= get_z_correction(PROBE_PT_1_X, PROBE_PT_1_Y); - //z1 = measured_z; - if (g29_verbose_level > 3) { - serial_spaces(16); - SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); - } - incremental_LSF(&lsf_results, PROBE_PT_1_X, PROBE_PT_1_Y, measured_z); - } - - if (!abort_flag) { - measured_z = probe_pt(PROBE_PT_2_X, PROBE_PT_2_Y, PROBE_PT_RAISE, g29_verbose_level); - //z2 = measured_z; - if (isnan(measured_z)) - abort_flag = true; - else { - measured_z -= get_z_correction(PROBE_PT_2_X, PROBE_PT_2_Y); - if (g29_verbose_level > 3) { - serial_spaces(16); - SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); + bool zig_zag = false; + for (uint8_t ix = 0; ix < g29_grid_size; ix++) { + const float rx = float(x_min) + ix * dx; + for (int8_t iy = 0; iy < g29_grid_size; iy++) { + const float ry = float(y_min) + dy * (zig_zag ? g29_grid_size - 1 - iy : iy); + float measured_z = probe_pt(rx, ry, parser.seen('E'), g29_verbose_level); // TODO: Needs error handling + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_CHAR('('); + SERIAL_PROTOCOL_F(rx, 7); + SERIAL_CHAR(','); + SERIAL_PROTOCOL_F(ry, 7); + SERIAL_ECHOPGM(") logical: "); + SERIAL_CHAR('('); + SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(rx), 7); + SERIAL_CHAR(','); + SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ry), 7); + SERIAL_ECHOPGM(") measured: "); + SERIAL_PROTOCOL_F(measured_z, 7); + SERIAL_ECHOPGM(" correction: "); + SERIAL_PROTOCOL_F(get_z_correction(rx, ry), 7); } - incremental_LSF(&lsf_results, PROBE_PT_2_X, PROBE_PT_2_Y, measured_z); - } - } + #endif - if (!abort_flag) { - measured_z = probe_pt(PROBE_PT_3_X, PROBE_PT_3_Y, PROBE_PT_STOW, g29_verbose_level); - //z3 = measured_z; - if (isnan(measured_z)) - abort_flag = true; - else { - measured_z -= get_z_correction(PROBE_PT_3_X, PROBE_PT_3_Y); - if (g29_verbose_level > 3) { - serial_spaces(16); - SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); + measured_z -= get_z_correction(rx, ry) /* + zprobe_zoffset */ ; + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPGM(" final >>>---> "); + SERIAL_PROTOCOL_F(measured_z, 7); + SERIAL_EOL(); } - incremental_LSF(&lsf_results, PROBE_PT_3_X, PROBE_PT_3_Y, measured_z); - } + #endif + + incremental_LSF(&lsf_results, rx, ry, measured_z); } - STOW_PROBE(); - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - - if (abort_flag) { - SERIAL_ECHOPGM("?Error probing point. Aborting operation.\n"); - return; - } + zig_zag ^= true; } - else { // !do_3_pt_leveling - bool zig_zag = false; - for (uint8_t ix = 0; ix < g29_grid_size; ix++) { - const float rx = float(x_min) + ix * dx; - for (int8_t iy = 0; iy < g29_grid_size; iy++) { - const float ry = float(y_min) + dy * (zig_zag ? g29_grid_size - 1 - iy : iy); - - if (!abort_flag) { - measured_z = probe_pt(rx, ry, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling - - abort_flag = isnan(measured_z); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_CHAR('('); - SERIAL_PROTOCOL_F(rx, 7); - SERIAL_CHAR(','); - SERIAL_PROTOCOL_F(ry, 7); - SERIAL_ECHOPGM(") logical: "); - SERIAL_CHAR('('); - SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(rx), 7); - SERIAL_CHAR(','); - SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ry), 7); - SERIAL_ECHOPGM(") measured: "); - SERIAL_PROTOCOL_F(measured_z, 7); - SERIAL_ECHOPGM(" correction: "); - SERIAL_PROTOCOL_F(get_z_correction(rx, ry), 7); - } - #endif - - measured_z -= get_z_correction(rx, ry) /* + zprobe_zoffset */ ; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM(" final >>>---> "); - SERIAL_PROTOCOL_F(measured_z, 7); - SERIAL_EOL(); - } - #endif - if (g29_verbose_level > 3) { - serial_spaces(16); - SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); - } - incremental_LSF(&lsf_results, rx, ry, measured_z); - } - } - - zig_zag ^= true; - } - } - STOW_PROBE(); - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - - if (abort_flag || finish_incremental_LSF(&lsf_results)) { + if (finish_incremental_LSF(&lsf_results)) { SERIAL_ECHOPGM("Could not complete LSF!"); return; } - vector_3 normal = vector_3(lsf_results.A, lsf_results.B, 1).get_normal(); + if (g29_verbose_level > 3) { + SERIAL_ECHOPGM("LSF Results A="); + SERIAL_PROTOCOL_F(lsf_results.A, 7); + SERIAL_ECHOPGM(" B="); + SERIAL_PROTOCOL_F(lsf_results.B, 7); + SERIAL_ECHOPGM(" D="); + SERIAL_PROTOCOL_F(lsf_results.D, 7); + SERIAL_EOL(); + } + + vector_3 normal = vector_3(lsf_results.A, lsf_results.B, 1.0000).get_normal(); if (g29_verbose_level > 2) { SERIAL_ECHOPGM("bed plane normal = ["); @@ -1679,13 +1754,13 @@ } #endif - z_values[i][j] = z_tmp - lsf_results.D; + z_values[i][j] += z_tmp - lsf_results.D; } } #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - rotation.debug(PSTR("rotation matrix:\n")); + rotation.debug(PSTR("rotation matrix:")); SERIAL_ECHOPGM("LSF Results A="); SERIAL_PROTOCOL_F(lsf_results.A, 7); SERIAL_ECHOPGM(" B="); @@ -1703,62 +1778,10 @@ SERIAL_PROTOCOL_F(normal.z, 7); SERIAL_ECHOPGM("]\n"); SERIAL_EOL(); - - /** - * The following code can be used to check the validity of the mesh tilting algorithm. - * When a 3-Point Mesh Tilt is done, the same algorithm is used as the grid based tilting. - * The only difference is just 3 points are used in the calculations. That fact guarantees - * each probed point should have an exact match when a get_z_correction() for that location - * is calculated. The Z error between the probed point locations and the get_z_correction() - * numbers for those locations should be 0. - */ - #if 0 - float t, t1, d; - t = normal.x * (PROBE_PT_1_X) + normal.y * (PROBE_PT_1_Y); - d = t + normal.z * z1; - SERIAL_ECHOPGM("D from 1st point: "); - SERIAL_ECHO_F(d, 6); - SERIAL_ECHOPGM(" Z error: "); - SERIAL_ECHO_F(normal.z*z1-get_z_correction(PROBE_PT_1_X, PROBE_PT_1_Y), 6); - SERIAL_EOL(); - - t = normal.x * (PROBE_PT_2_X) + normal.y * (PROBE_PT_2_Y); - d = t + normal.z * z2; - SERIAL_EOL(); - SERIAL_ECHOPGM("D from 2nd point: "); - SERIAL_ECHO_F(d, 6); - SERIAL_ECHOPGM(" Z error: "); - SERIAL_ECHO_F(normal.z*z2-get_z_correction(PROBE_PT_2_X, PROBE_PT_2_Y), 6); - SERIAL_EOL(); - - t = normal.x * (PROBE_PT_3_X) + normal.y * (PROBE_PT_3_Y); - d = t + normal.z * z3; - SERIAL_ECHOPGM("D from 3rd point: "); - SERIAL_ECHO_F(d, 6); - SERIAL_ECHOPGM(" Z error: "); - SERIAL_ECHO_F(normal.z*z3-get_z_correction(PROBE_PT_3_X, PROBE_PT_3_Y), 6); - SERIAL_EOL(); - - t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT); - d = t + normal.z * 0; - SERIAL_ECHOPGM("D from home location with Z=0 : "); - SERIAL_ECHO_F(d, 6); - SERIAL_EOL(); - - t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT); - d = t + get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT); // normal.z * 0; - SERIAL_ECHOPGM("D from home location using mesh value for Z: "); - SERIAL_ECHO_F(d, 6); - - SERIAL_ECHOPAIR(" Z error: (", Z_SAFE_HOMING_X_POINT); - SERIAL_ECHOPAIR(",", Z_SAFE_HOMING_Y_POINT ); - SERIAL_ECHOPGM(") = "); - SERIAL_ECHO_F(get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT), 6); - SERIAL_EOL(); - #endif - } // DEBUGGING(LEVELING) + } #endif + if (do_ubl_mesh_map) display_map(g29_map_type); } #endif // HAS_BED_PROBE @@ -1777,7 +1800,7 @@ SERIAL_ECHOPGM("Extrapolating mesh..."); - const float weight_scaled = weight_factor * MAX(MESH_X_DIST, MESH_Y_DIST); + const float weight_scaled = weight_factor * max(MESH_X_DIST, MESH_Y_DIST); for (uint8_t jx = 0; jx < GRID_MAX_POINTS_X; jx++) for (uint8_t jy = 0; jy < GRID_MAX_POINTS_Y; jy++) @@ -1797,7 +1820,7 @@ if (TEST(bitmap[jx], jy)) { const float ry = mesh_index_to_ypos(jy), rz = z_values[jx][jy], - w = 1 + weight_scaled / HYPOT((rx - px), (ry - py)); + w = 1.0 + weight_scaled / HYPOT((rx - px), (ry - py)); incremental_WLSF(&lsf_results, rx, ry, rz, w); } } diff --git a/Marlin/ubl_motion.cpp b/Marlin/ubl_motion.cpp index 0751c95..5a8cf8c 100644 --- a/Marlin/ubl_motion.cpp +++ b/Marlin/ubl_motion.cpp @@ -46,8 +46,8 @@ */ #if ENABLED(SKEW_CORRECTION) // For skew correction just adjust the destination point and we're done - float start[XYZE] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_CART] }, - end[XYZE] = { destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_CART] }; + float start[XYZE] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS] }, + end[XYZE] = { destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS] }; planner.skew(start[X_AXIS], start[Y_AXIS], start[Z_AXIS]); planner.skew(end[X_AXIS], end[Y_AXIS], end[Z_AXIS]); #else @@ -64,28 +64,26 @@ SERIAL_ECHOPAIR(" ubl.line_to_destination_cartesian(xe=", destination[X_AXIS]); SERIAL_ECHOPAIR(", ye=", destination[Y_AXIS]); SERIAL_ECHOPAIR(", ze=", destination[Z_AXIS]); - SERIAL_ECHOPAIR(", ee=", destination[E_CART]); + SERIAL_ECHOPAIR(", ee=", destination[E_AXIS]); SERIAL_CHAR(')'); SERIAL_EOL(); debug_current_and_destination(PSTR("Start of ubl.line_to_destination_cartesian()")); } - // A move within the same cell needs no splitting - if (cell_start_xi == cell_dest_xi && cell_start_yi == cell_dest_yi) { + if (cell_start_xi == cell_dest_xi && cell_start_yi == cell_dest_yi) { // if the whole move is within the same cell, + /** + * we don't need to break up the move + * + * If we are moving off the print bed, we are going to allow the move at this level. + * But we detect it and isolate it. For now, we just pass along the request. + */ - // For a move off the bed, use a constant Z raise if (!WITHIN(cell_dest_xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(cell_dest_yi, 0, GRID_MAX_POINTS_Y - 1)) { // Note: There is no Z Correction in this case. We are off the grid and don't know what - // a reasonable correction would be. If the user has specified a UBL_Z_RAISE_WHEN_OFF_MESH - // value, that will be used instead of a calculated (Bi-Linear interpolation) correction. + // a reasonable correction would be. - const float z_raise = 0.0 - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - + UBL_Z_RAISE_WHEN_OFF_MESH - #endif - ; - planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + z_raise, end[E_CART], feed_rate, extruder); + planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS], end[E_AXIS], feed_rate, extruder); set_current_from_destination(); if (g26_debug_flag) @@ -96,8 +94,16 @@ FINAL_MOVE: - // The distance is always MESH_X_DIST so multiply by the constant reciprocal. - const float xratio = (end[X_AXIS] - mesh_index_to_xpos(cell_dest_xi)) * (1.0f / (MESH_X_DIST)); + /** + * Optimize some floating point operations here. We could call float get_z_correction(float x0, float y0) to + * generate the correction for us. But we can lighten the load on the CPU by doing a modified version of the function. + * We are going to only calculate the amount we are from the first mesh line towards the second mesh line once. + * We will use this fraction in both of the original two Z Height calculations for the bi-linear interpolation. And, + * instead of doing a generic divide of the distance, we know the distance is MESH_X_DIST so we can use the preprocessor + * to create a 1-over number for us. That will allow us to do a floating point multiply instead of a floating point divide. + */ + + const float xratio = (end[X_AXIS] - mesh_index_to_xpos(cell_dest_xi)) * (1.0 / (MESH_X_DIST)); float z1 = z_values[cell_dest_xi ][cell_dest_yi ] + xratio * (z_values[cell_dest_xi + 1][cell_dest_yi ] - z_values[cell_dest_xi][cell_dest_yi ]), @@ -106,13 +112,22 @@ if (cell_dest_xi >= GRID_MAX_POINTS_X - 1) z1 = z2 = 0.0; - // X cell-fraction done. Interpolate the two Z offsets with the Y fraction for the final Z offset. - const float yratio = (end[Y_AXIS] - mesh_index_to_ypos(cell_dest_yi)) * (1.0f / (MESH_Y_DIST)), - z0 = cell_dest_yi < GRID_MAX_POINTS_Y - 1 ? (z1 + (z2 - z1) * yratio) * planner.fade_scaling_factor_for_z(end[Z_AXIS]) : 0.0; + // we are done with the fractional X distance into the cell. Now with the two Z-Heights we have calculated, we + // are going to apply the Y-Distance into the cell to interpolate the final Z correction. - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + (isnan(z0) ? 0.0 : z0), end[E_CART], feed_rate, extruder); + const float yratio = (end[Y_AXIS] - mesh_index_to_ypos(cell_dest_yi)) * (1.0 / (MESH_Y_DIST)); + float z0 = cell_dest_yi < GRID_MAX_POINTS_Y - 1 ? (z1 + (z2 - z1) * yratio) * planner.fade_scaling_factor_for_z(end[Z_AXIS]) : 0.0; + + /** + * If part of the Mesh is undefined, it will show up as NAN + * in z_values[][] and propagate through the + * calculations. If our correction is NAN, we throw it out + * because part of the Mesh is undefined and we don't have the + * information we need to complete the height correction. + */ + if (isnan(z0)) z0 = 0.0; + + planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + z0, end[E_AXIS], feed_rate, extruder); if (g26_debug_flag) debug_current_and_destination(PSTR("FINAL_MOVE in ubl.line_to_destination_cartesian()")); @@ -122,8 +137,11 @@ } /** - * Past this point the move is known to cross one or more mesh lines. Check for the most common - * case - crossing only one X or Y line - after details are worked out to reduce computation. + * If we get here, we are processing a move that crosses at least one Mesh Line. We will check + * for the simple case of just crossing X or just crossing Y Mesh Lines after we get all the details + * of the move figured out. We can process the easy case of just crossing an X or Y Mesh Line with less + * computation and in fact most lines are of this nature. We will check for that in the following + * blocks of code: */ const float dx = end[X_AXIS] - start[X_AXIS], @@ -139,17 +157,18 @@ dyi = cell_start_yi == cell_dest_yi ? 0 : down_flag ? -1 : 1; /** - * Compute the extruder scaling factor for each partial move, checking for - * zero-length moves that would result in an infinite scaling factor. - * A float divide is required for this, but then it just multiplies. - * Also select a scaling factor based on the larger of the X and Y - * components. The larger of the two is used to preserve precision. + * Compute the scaling factor for the extruder for each partial move. + * We need to watch out for zero length moves because it will cause us to + * have an infinate scaling factor. We are stuck doing a floating point + * divide to get our scaling factor, but after that, we just multiply by this + * number. We also pick our scaling factor based on whether the X or Y + * component is larger. We use the biggest of the two to preserve precision. */ const bool use_x_dist = adx > ady; float on_axis_distance = use_x_dist ? dx : dy, - e_position = end[E_CART] - start[E_CART], + e_position = end[E_AXIS] - start[E_AXIS], z_position = end[Z_AXIS] - start[Z_AXIS]; const float e_normalized_dist = e_position / on_axis_distance, @@ -163,46 +182,52 @@ const bool inf_normalized_flag = (isinf(e_normalized_dist) != 0), inf_m_flag = (isinf(m) != 0); - /** - * Handle vertical lines that stay within one column. - * These need not be perfectly vertical. + * This block handles vertical lines. These are lines that stay within the same + * X Cell column. They do not need to be perfectly vertical. They just can + * not cross into another X Cell column. */ - if (dxi == 0) { // Vertical line? - current_yi += down_flag; // Line going down? Just go to the bottom. + if (dxi == 0) { // Check for a vertical line + current_yi += down_flag; // Line is heading down, we just want to go to the bottom while (current_yi != cell_dest_yi + down_flag) { current_yi += dyi; const float next_mesh_line_y = mesh_index_to_ypos(current_yi); /** - * Skip the calculations for an infinite slope. - * For others the next X is the same so this can continue. - * Calculate X at the next Y mesh line. + * if the slope of the line is infinite, we won't do the calculations + * else, we know the next X is the same so we can recover and continue! + * Calculate X at the next Y mesh line */ const float rx = inf_m_flag ? start[X_AXIS] : (next_mesh_line_y - c) / m; float z0 = z_correction_for_x_on_horizontal_mesh_line(rx, current_xi, current_yi) * planner.fade_scaling_factor_for_z(end[Z_AXIS]); - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. + /** + * If part of the Mesh is undefined, it will show up as NAN + * in z_values[][] and propagate through the + * calculations. If our correction is NAN, we throw it out + * because part of the Mesh is undefined and we don't have the + * information we need to complete the height correction. + */ if (isnan(z0)) z0 = 0.0; const float ry = mesh_index_to_ypos(current_yi); /** - * Without this check, it's possible to generate a zero length move, as in the case where - * the line is heading down, starting exactly on a mesh line boundary. Since this is rare - * it might be fine to remove this check and let planner.buffer_segment() filter it out. + * Without this check, it is possible for the algorithm to generate a zero length move in the case + * where the line is heading down and it is starting right on a Mesh Line boundary. For how often that + * happens, it might be best to remove the check and always 'schedule' the move because + * the planner.buffer_segment() routine will filter it if that happens. */ if (ry != start[Y_AXIS]) { if (!inf_normalized_flag) { on_axis_distance = use_x_dist ? rx - start[X_AXIS] : ry - start[Y_AXIS]; - e_position = start[E_CART] + on_axis_distance * e_normalized_dist; + e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist; z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; } else { - e_position = end[E_CART]; + e_position = end[E_AXIS]; z_position = end[Z_AXIS]; } @@ -213,7 +238,9 @@ if (g26_debug_flag) debug_current_and_destination(PSTR("vertical move done in ubl.line_to_destination_cartesian()")); - // At the final destination? Usually not, but when on a Y Mesh Line it's completed. + // + // Check if we are at the final destination. Usually, we won't be, but if it is on a Y Mesh Line, we are done. + // if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS]) goto FINAL_MOVE; @@ -222,11 +249,16 @@ } /** - * Handle horizontal lines that stay within one row. - * These need not be perfectly horizontal. + * + * This block handles horizontal lines. These are lines that stay within the same + * Y Cell row. They do not need to be perfectly horizontal. They just can + * not cross into another Y Cell row. + * */ - if (dyi == 0) { // Horizontal line? - current_xi += left_flag; // Heading left? Just go to the left edge of the cell for the first move. + + if (dyi == 0) { // Check for a horizontal line + current_xi += left_flag; // Line is heading left, we just want to go to the left + // edge of this cell for the first move. while (current_xi != cell_dest_xi + left_flag) { current_xi += dxi; const float next_mesh_line_x = mesh_index_to_xpos(current_xi), @@ -235,30 +267,35 @@ float z0 = z_correction_for_y_on_vertical_mesh_line(ry, current_xi, current_yi) * planner.fade_scaling_factor_for_z(end[Z_AXIS]); - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. + /** + * If part of the Mesh is undefined, it will show up as NAN + * in z_values[][] and propagate through the + * calculations. If our correction is NAN, we throw it out + * because part of the Mesh is undefined and we don't have the + * information we need to complete the height correction. + */ if (isnan(z0)) z0 = 0.0; const float rx = mesh_index_to_xpos(current_xi); /** - * Without this check, it's possible to generate a zero length move, as in the case where - * the line is heading left, starting exactly on a mesh line boundary. Since this is rare - * it might be fine to remove this check and let planner.buffer_segment() filter it out. + * Without this check, it is possible for the algorithm to generate a zero length move in the case + * where the line is heading left and it is starting right on a Mesh Line boundary. For how often + * that happens, it might be best to remove the check and always 'schedule' the move because + * the planner.buffer_segment() routine will filter it if that happens. */ if (rx != start[X_AXIS]) { if (!inf_normalized_flag) { on_axis_distance = use_x_dist ? rx - start[X_AXIS] : ry - start[Y_AXIS]; - e_position = start[E_CART] + on_axis_distance * e_normalized_dist; // is based on X or Y because this is a horizontal move + e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist; // is based on X or Y because this is a horizontal move z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; } else { - e_position = end[E_CART]; + e_position = end[E_AXIS]; z_position = end[Z_AXIS]; } - if (!planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder)) - break; + planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder); } //else printf("FIRST MOVE PRUNED "); } @@ -274,7 +311,7 @@ /** * - * Handle the generic case of a line crossing both X and Y Mesh lines. + * This block handles the generic case of a line crossing both X and Y Mesh lines. * */ @@ -287,7 +324,7 @@ current_xi += left_flag; current_yi += down_flag; - while (xi_cnt || yi_cnt) { + while (xi_cnt > 0 || yi_cnt > 0) { const float next_mesh_line_x = mesh_index_to_xpos(current_xi + dxi), next_mesh_line_y = mesh_index_to_ypos(current_yi + dyi), @@ -302,21 +339,25 @@ float z0 = z_correction_for_x_on_horizontal_mesh_line(rx, current_xi - left_flag, current_yi + dyi) * planner.fade_scaling_factor_for_z(end[Z_AXIS]); - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. + /** + * If part of the Mesh is undefined, it will show up as NAN + * in z_values[][] and propagate through the + * calculations. If our correction is NAN, we throw it out + * because part of the Mesh is undefined and we don't have the + * information we need to complete the height correction. + */ if (isnan(z0)) z0 = 0.0; if (!inf_normalized_flag) { on_axis_distance = use_x_dist ? rx - start[X_AXIS] : next_mesh_line_y - start[Y_AXIS]; - e_position = start[E_CART] + on_axis_distance * e_normalized_dist; + e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist; z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; } else { - e_position = end[E_CART]; + e_position = end[E_AXIS]; z_position = end[Z_AXIS]; } - if (!planner.buffer_segment(rx, next_mesh_line_y, z_position + z0, e_position, feed_rate, extruder)) - break; + planner.buffer_segment(rx, next_mesh_line_y, z_position + z0, e_position, feed_rate, extruder); current_yi += dyi; yi_cnt--; } @@ -325,27 +366,31 @@ float z0 = z_correction_for_y_on_vertical_mesh_line(ry, current_xi + dxi, current_yi - down_flag) * planner.fade_scaling_factor_for_z(end[Z_AXIS]); - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. + /** + * If part of the Mesh is undefined, it will show up as NAN + * in z_values[][] and propagate through the + * calculations. If our correction is NAN, we throw it out + * because part of the Mesh is undefined and we don't have the + * information we need to complete the height correction. + */ if (isnan(z0)) z0 = 0.0; if (!inf_normalized_flag) { on_axis_distance = use_x_dist ? next_mesh_line_x - start[X_AXIS] : ry - start[Y_AXIS]; - e_position = start[E_CART] + on_axis_distance * e_normalized_dist; + e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist; z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; } else { - e_position = end[E_CART]; + e_position = end[E_AXIS]; z_position = end[Z_AXIS]; } - if (!planner.buffer_segment(next_mesh_line_x, ry, z_position + z0, e_position, feed_rate, extruder)) - break; + planner.buffer_segment(next_mesh_line_x, ry, z_position + z0, e_position, feed_rate, extruder); current_xi += dxi; xi_cnt--; } - if (xi_cnt < 0 || yi_cnt < 0) break; // Too far! Exit the loop and go to FINAL_MOVE + if (xi_cnt < 0 || yi_cnt < 0) break; // we've gone too far, so exit the loop and move on to FINAL_MOVE } if (g26_debug_flag) @@ -369,7 +414,7 @@ inline void _O2 ubl_buffer_segment_raw(const float (&in_raw)[XYZE], const float &fr) { #if ENABLED(SKEW_CORRECTION) - float raw[XYZE] = { in_raw[X_AXIS], in_raw[Y_AXIS], in_raw[Z_AXIS] }; + float raw[XYZE] = { in_raw[X_AXIS], in_raw[Y_AXIS], in_raw[Z_AXIS], in_raw[E_AXIS] }; planner.skew(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); #else const float (&raw)[XYZE] = in_raw; @@ -378,29 +423,24 @@ #if ENABLED(DELTA) // apply delta inverse_kinematics DELTA_IK(raw); - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], in_raw[E_CART], fr, active_extruder); - - #elif ENABLED(HANGPRINTER) // apply hangprinter inverse_kinematics - - HANGPRINTER_IK(raw); - planner.buffer_segment(line_lengths[A_AXIS], line_lengths[B_AXIS], line_lengths[C_AXIS], line_lengths[D_AXIS], in_raw[E_CART], fr, active_extruder); + planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], in_raw[E_AXIS], fr, active_extruder); #elif IS_SCARA // apply scara inverse_kinematics (should be changed to save raw->logical->raw) inverse_kinematics(raw); // this writes delta[ABC] from raw[XYZE] // should move the feedrate scaling to scara inverse_kinematics - const float adiff = ABS(delta[A_AXIS] - scara_oldA), - bdiff = ABS(delta[B_AXIS] - scara_oldB); + const float adiff = FABS(delta[A_AXIS] - scara_oldA), + bdiff = FABS(delta[B_AXIS] - scara_oldB); scara_oldA = delta[A_AXIS]; scara_oldB = delta[B_AXIS]; - float s_feedrate = MAX(adiff, bdiff) * scara_feed_factor; + float s_feedrate = max(adiff, bdiff) * scara_feed_factor; - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], in_raw[E_CART], s_feedrate, active_extruder); + planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], in_raw[E_AXIS], s_feedrate, active_extruder); #else // CARTESIAN - planner.buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], in_raw[E_CART], fr, active_extruder); + planner.buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], in_raw[E_AXIS], fr, active_extruder); #endif } @@ -432,7 +472,7 @@ rtarget[X_AXIS] - current_position[X_AXIS], rtarget[Y_AXIS] - current_position[Y_AXIS], rtarget[Z_AXIS] - current_position[Z_AXIS], - rtarget[E_CART] - current_position[E_CART] + rtarget[E_AXIS] - current_position[E_AXIS] }; const float cartesian_xy_mm = HYPOT(total[X_AXIS], total[Y_AXIS]); // total horizontal xy distance @@ -440,26 +480,26 @@ #if IS_KINEMATIC const float seconds = cartesian_xy_mm / feedrate; // seconds to move xy distance at requested rate uint16_t segments = lroundf(delta_segments_per_second * seconds), // preferred number of segments for distance @ feedrate - seglimit = lroundf(cartesian_xy_mm * (1.0f / (DELTA_SEGMENT_MIN_LENGTH))); // number of segments at minimum segment length + seglimit = lroundf(cartesian_xy_mm * (1.0 / (DELTA_SEGMENT_MIN_LENGTH))); // number of segments at minimum segment length NOMORE(segments, seglimit); // limit to minimum segment length (fewer segments) #else - uint16_t segments = lroundf(cartesian_xy_mm * (1.0f / (DELTA_SEGMENT_MIN_LENGTH))); // cartesian fixed segment length + uint16_t segments = lroundf(cartesian_xy_mm * (1.0 / (DELTA_SEGMENT_MIN_LENGTH))); // cartesian fixed segment length #endif - NOLESS(segments, 1U); // must have at least one segment - const float inv_segments = 1.0f / segments; // divide once, multiply thereafter + NOLESS(segments, 1); // must have at least one segment + const float inv_segments = 1.0 / segments; // divide once, multiply thereafter #if IS_SCARA // scale the feed rate from mm/s to degrees/s scara_feed_factor = cartesian_xy_mm * inv_segments * feedrate; - scara_oldA = planner.get_axis_position_degrees(A_AXIS); - scara_oldB = planner.get_axis_position_degrees(B_AXIS); + scara_oldA = stepper.get_axis_position_degrees(A_AXIS); + scara_oldB = stepper.get_axis_position_degrees(B_AXIS); #endif const float diff[XYZE] = { total[X_AXIS] * inv_segments, total[Y_AXIS] * inv_segments, total[Z_AXIS] * inv_segments, - total[E_CART] * inv_segments + total[E_AXIS] * inv_segments }; // Note that E segment distance could vary slightly as z mesh height @@ -469,7 +509,7 @@ current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], - current_position[E_CART] + current_position[E_AXIS] }; // Only compute leveling per segment if ubl active and target below z_fade_height. @@ -491,7 +531,7 @@ // increment to first segment destination LOOP_XYZE(i) raw[i] += diff[i]; - for (;;) { // for each mesh cell encountered during the move + for(;;) { // for each mesh cell encountered during the move // Compute mesh cell invariants that remain constant for all segments within cell. // Note for cell index, if point is outside the mesh grid (in MESH_INSET perimeter) @@ -500,8 +540,8 @@ // in top of loop and again re-find same adjacent cell and use it, just less efficient // for mesh inset area. - int8_t cell_xi = (raw[X_AXIS] - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)), - cell_yi = (raw[Y_AXIS] - (MESH_MIN_Y)) * (1.0f / (MESH_Y_DIST)); + int8_t cell_xi = (raw[X_AXIS] - (MESH_MIN_X)) * (1.0 / (MESH_X_DIST)), + cell_yi = (raw[Y_AXIS] - (MESH_MIN_Y)) * (1.0 / (MESH_X_DIST)); cell_xi = constrain(cell_xi, 0, (GRID_MAX_POINTS_X) - 1); cell_yi = constrain(cell_yi, 0, (GRID_MAX_POINTS_Y) - 1); @@ -522,15 +562,15 @@ float cx = raw[X_AXIS] - x0, // cell-relative x and y cy = raw[Y_AXIS] - y0; - const float z_xmy0 = (z_x1y0 - z_x0y0) * (1.0f / (MESH_X_DIST)), // z slope per x along y0 (lower left to lower right) - z_xmy1 = (z_x1y1 - z_x0y1) * (1.0f / (MESH_X_DIST)); // z slope per x along y1 (upper left to upper right) + const float z_xmy0 = (z_x1y0 - z_x0y0) * (1.0 / (MESH_X_DIST)), // z slope per x along y0 (lower left to lower right) + z_xmy1 = (z_x1y1 - z_x0y1) * (1.0 / (MESH_X_DIST)); // z slope per x along y1 (upper left to upper right) float z_cxy0 = z_x0y0 + z_xmy0 * cx; // z height along y0 at cx (changes for each cx in cell) const float z_cxy1 = z_x0y1 + z_xmy1 * cx, // z height along y1 at cx z_cxyd = z_cxy1 - z_cxy0; // z height difference along cx from y0 to y1 - float z_cxym = z_cxyd * (1.0f / (MESH_Y_DIST)); // z slope per y along cx from y0 to y1 (changes for each cx in cell) + float z_cxym = z_cxyd * (1.0 / (MESH_Y_DIST)); // z slope per y along cx from y0 to y1 (changes for each cx in cell) // float z_cxcy = z_cxy0 + z_cxym * cy; // interpolated mesh z height along cx at cy (do inside the segment loop) @@ -539,9 +579,9 @@ // each change by a constant for fixed segment lengths. const float z_sxy0 = z_xmy0 * diff[X_AXIS], // per-segment adjustment to z_cxy0 - z_sxym = (z_xmy1 - z_xmy0) * (1.0f / (MESH_Y_DIST)) * diff[X_AXIS]; // per-segment adjustment to z_cxym + z_sxym = (z_xmy1 - z_xmy0) * (1.0 / (MESH_Y_DIST)) * diff[X_AXIS]; // per-segment adjustment to z_cxym - for (;;) { // for all segments within this mesh cell + for(;;) { // for all segments within this mesh cell if (--segments == 0) // if this is last segment, use rtarget for exact COPY(raw, rtarget); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 5f5ceb7..8d78d5a 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -33,15 +33,14 @@ #include "stepper.h" #include "configuration_store.h" #include "utility.h" -#include "parser.h" +#include "gcode.h" #if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER) #include "buzzer.h" #endif -#include "printcounter.h" - #if ENABLED(PRINTCOUNTER) + #include "printcounter.h" #include "duration_t.h" #endif @@ -57,34 +56,35 @@ #include "mesh_bed_leveling.h" #endif -#if ENABLED(FWRETRACT) - #include "fwretract.h" +#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) + bool lcd_external_control; // = false #endif -#if ENABLED(POWER_LOSS_RECOVERY) - #include "power_loss_recovery.h" -#endif - -#if ENABLED(STATUS_MESSAGE_SCROLLING) - #if LONG_FILENAME_LENGTH > CHARSIZE * 2 * (LCD_WIDTH) - #define MAX_MESSAGE_LENGTH LONG_FILENAME_LENGTH - #else - #define MAX_MESSAGE_LENGTH CHARSIZE * 2 * (LCD_WIDTH) - #endif - uint8_t status_scroll_offset = 0; -#else - #define MAX_MESSAGE_LENGTH CHARSIZE * (LCD_WIDTH) -#endif - -char lcd_status_message[MAX_MESSAGE_LENGTH + 1]; -uint8_t lcd_status_update_delay = 1, // First update one loop delayed - lcd_status_message_level; // Higher level blocks lower level +// Initialized by settings.load() +int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2]; #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) millis_t previous_lcd_status_ms = 0; #endif -#if ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES) +#if ENABLED(BABYSTEPPING) + long babysteps_done = 0; + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + static void lcd_babystep_zoffset(); + #else + static void lcd_babystep_z(); + #endif +#endif + +uint8_t lcd_status_update_delay = 1, // First update one loop delayed + lcd_status_message_level; // Higher level blocks lower level +char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1 + +#if ENABLED(STATUS_MESSAGE_SCROLLING) + uint8_t status_scroll_pos = 0; +#endif + +#if ENABLED(SCROLL_LONG_FILENAMES) uint8_t filename_scroll_pos, filename_scroll_max, filename_scroll_hash; #endif @@ -95,22 +95,11 @@ uint8_t lcd_status_update_delay = 1, // First update one loop delayed #if ENABLED(DOGLCD) #include "ultralcd_impl_DOGM.h" #include - bool drawing_screen, first_page; // = false #else #include "ultralcd_impl_HD44780.h" - constexpr bool first_page = true; #endif -// The main status screen -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) -uint16_t max_display_update_time = 0; - #if ENABLED(ULTIPANEL) - #define DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(_type, _name, _strFunc) \ inline void lcd_implementation_drawmenu_setting_edit_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type * const data, ...) { \ UNUSED(pstr2); \ @@ -128,43 +117,47 @@ uint16_t max_display_update_time = 0; DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(int16_t, int3, itostr3); DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(uint8_t, int8, i8tostr3); DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float3, ftostr3); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52, ftostr52); + DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float32, ftostr32); DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float43, ftostr43sign); DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float5, ftostr5rj); DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float51, ftostr51sign); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52sign, ftostr52sign); + DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52, ftostr52sign); DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float62, ftostr62rj); DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(uint32_t, long5, ftostr5rj); #define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) DRAW_BOOL_SETTING(sel, row, pstr, data) #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) DRAW_BOOL_SETTING(sel, row, pstr, data) #define lcd_implementation_drawmenu_setting_edit_accessor_bool(sel, row, pstr, pstr2, pget, pset) DRAW_BOOL_SETTING(sel, row, pstr, data) +#endif // ULTIPANEL + +// The main status screen +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) +uint16_t max_display_update_time = 0; + +#if ENABLED(DOGLCD) + bool drawing_screen = false; +#endif + +#if ENABLED(DAC_STEPPER_CURRENT) + #include "stepper_dac.h" //was dac_mcp4728.h MarlinMain uses stepper dac for the m-codes + uint8_t driverPercent[XYZE]; +#endif + +#if ENABLED(ULTIPANEL) #ifndef TALL_FONT_CORRECTION #define TALL_FONT_CORRECTION 0 #endif - bool no_reentry = false; - constexpr int8_t menu_bottom = LCD_HEIGHT - (TALL_FONT_CORRECTION); + // Function pointer to menu functions. + typedef void (*screenFunc_t)(); + typedef void (*menuAction_t)(); - // Initialized by settings.load() - int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2]; - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - bool lcd_external_control; // = false - #endif - - #if ENABLED(BABYSTEPPING) - long babysteps_done = 0; - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - static void lcd_babystep_zoffset(); - #else - static void lcd_babystep_z(); - #endif - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - #include "stepper_dac.h" //was dac_mcp4728.h MarlinMain uses stepper dac for the m-codes - uint8_t driverPercent[XYZE]; + #if HAS_POWER_SWITCH + extern bool powersupply_on; #endif //////////////////////////////////////////// @@ -177,16 +170,10 @@ uint16_t max_display_update_time = 0; void lcd_move_menu(); void lcd_control_menu(); void lcd_control_temperature_menu(); + void lcd_control_temperature_preheat_material1_settings_menu(); + void lcd_control_temperature_preheat_material2_settings_menu(); void lcd_control_motion_menu(); - - #if DISABLED(SLIM_LCD_MENUS) - void lcd_control_temperature_preheat_material1_settings_menu(); - void lcd_control_temperature_preheat_material2_settings_menu(); - #endif - - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - void lcd_control_filament_menu(); - #endif + void lcd_control_filament_menu(); #if ENABLED(LCD_INFO_MENU) #if ENABLED(PRINTCOUNTER) @@ -203,11 +190,15 @@ uint16_t max_display_update_time = 0; #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - void lcd_change_filament_menu(); - #else - void lcd_temp_menu_e0_filament_change(); - #endif + void lcd_advanced_pause_toocold_menu(); + void lcd_advanced_pause_option_menu(); + void lcd_advanced_pause_init_message(); + void lcd_advanced_pause_unload_message(); + void lcd_advanced_pause_insert_message(); + void lcd_advanced_pause_load_message(); + void lcd_advanced_pause_heat_nozzle(); + void lcd_advanced_pause_extrude_message(); + void lcd_advanced_pause_resume_message(); #endif #if ENABLED(DAC_STEPPER_CURRENT) @@ -225,11 +216,6 @@ uint16_t max_display_update_time = 0; void lcd_delta_calibrate_menu(); #endif - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - static float new_z_fade_height; - void _lcd_set_z_fade_height() { set_z_fade_height(new_z_fade_height); } - #endif - //////////////////////////////////////////// //////////// Menu System Actions /////////// //////////////////////////////////////////// @@ -246,17 +232,17 @@ uint16_t max_display_update_time = 0; void menu_edit_callback_ ## _name(); \ void _menu_action_setting_edit_ ## _name(const char * const pstr, _type* const ptr, const _type minValue, const _type maxValue); \ void menu_action_setting_edit_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue); \ - void menu_action_setting_edit_callback_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback=NULL, const bool live=false); \ + void menu_action_setting_edit_callback_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback, const bool live=false); \ typedef void _name##_void DECLARE_MENU_EDIT_TYPE(int16_t, int3); DECLARE_MENU_EDIT_TYPE(uint8_t, int8); DECLARE_MENU_EDIT_TYPE(float, float3); - DECLARE_MENU_EDIT_TYPE(float, float52); + DECLARE_MENU_EDIT_TYPE(float, float32); DECLARE_MENU_EDIT_TYPE(float, float43); DECLARE_MENU_EDIT_TYPE(float, float5); DECLARE_MENU_EDIT_TYPE(float, float51); - DECLARE_MENU_EDIT_TYPE(float, float52sign); + DECLARE_MENU_EDIT_TYPE(float, float52); DECLARE_MENU_EDIT_TYPE(float, float62); DECLARE_MENU_EDIT_TYPE(uint32_t, long5); @@ -265,8 +251,8 @@ uint16_t max_display_update_time = 0; #if ENABLED(SDSUPPORT) void lcd_sdcard_menu(); - void menu_action_sdfile(CardReader& theCard); - void menu_action_sddirectory(CardReader& theCard); + void menu_action_sdfile(const char* filename, char* longFilename); + void menu_action_sddirectory(const char* filename, char* longFilename); #endif //////////////////////////////////////////// @@ -298,43 +284,38 @@ uint16_t max_display_update_time = 0; */ #define _MENU_ITEM_PART_1(TYPE, ...) \ if (_menuLineNr == _thisItemNr) { \ - if (encoderLine == _thisItemNr && lcd_clicked) { \ - lcd_clicked = false + if (lcd_clicked && encoderLine == _thisItemNr) { - #define _MENU_ITEM_PART_2(TYPE, PLABEL, ...) \ + #define _MENU_ITEM_PART_2(TYPE, LABEL, ...) \ menu_action_ ## TYPE(__VA_ARGS__); \ if (screen_changed) return; \ } \ if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ## __VA_ARGS__); \ + lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## __VA_ARGS__); \ } \ ++_thisItemNr - #define MENU_ITEM_P(TYPE, PLABEL, ...) do { \ + #define MENU_ITEM(TYPE, LABEL, ...) do { \ _skipStatic = false; \ _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \ - _MENU_ITEM_PART_2(TYPE, PLABEL, ## __VA_ARGS__); \ + _MENU_ITEM_PART_2(TYPE, LABEL, ## __VA_ARGS__); \ }while(0) - #define MENU_ITEM(TYPE, LABEL, ...) MENU_ITEM_P(TYPE, PSTR(LABEL), ## __VA_ARGS__) - #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0) // Used to print static text with no visible cursor. // Parameters: label [, bool center [, bool invert [, char *value] ] ] - #define STATIC_ITEM_P(LABEL, ...) \ + #define STATIC_ITEM(LABEL, ...) \ if (_menuLineNr == _thisItemNr) { \ if (_skipStatic && encoderLine <= _thisItemNr) { \ encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ ++encoderLine; \ } \ if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_static(_lcdLineNr, LABEL, ## __VA_ARGS__); \ + lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(LABEL), ## __VA_ARGS__); \ } \ ++_thisItemNr - #define STATIC_ITEM(LABEL, ...) STATIC_ITEM_P(PSTR(LABEL), ## __VA_ARGS__) - #if ENABLED(ENCODER_RATE_MULTIPLIER) bool encoderRateMultiplierEnabled; @@ -345,11 +326,11 @@ uint16_t max_display_update_time = 0; /** * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item */ - #define MENU_MULTIPLIER_ITEM(TYPE, LABEL, ...) do { \ - _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \ + #define MENU_MULTIPLIER_ITEM(type, label, ...) do { \ + _MENU_ITEM_PART_1(type, ## __VA_ARGS__); \ encoderRateMultiplierEnabled = true; \ lastEncoderMovementMillis = 0; \ - _MENU_ITEM_PART_2(TYPE, PSTR(LABEL), ## __VA_ARGS__); \ + _MENU_ITEM_PART_2(type, label, ## __VA_ARGS__); \ }while(0) #else // !ENCODER_RATE_MULTIPLIER @@ -357,19 +338,40 @@ uint16_t max_display_update_time = 0; #endif // !ENCODER_RATE_MULTIPLIER #define MENU_ITEM_DUMMY() do { _thisItemNr++; }while(0) - #define MENU_ITEM_EDIT(TYPE, LABEL, ...) MENU_ITEM(setting_edit_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #define MENU_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_ITEM(setting_edit_callback_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) + #define MENU_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__) + #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__) #if ENABLED(ENCODER_RATE_MULTIPLIER) - #define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) MENU_MULTIPLIER_ITEM(setting_edit_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) + #define MENU_MULTIPLIER_ITEM_EDIT(type, label, ...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__) + #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, ...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__) #else // !ENCODER_RATE_MULTIPLIER - #define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) MENU_ITEM(setting_edit_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_ITEM(setting_edit_callback_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) + #define MENU_MULTIPLIER_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__) + #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__) #endif // !ENCODER_RATE_MULTIPLIER + /** + * 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_SCREEN_OR_MENU(LIMIT) \ + ENCODER_DIRECTION_MENUS(); \ + ENCODER_RATE_MULTIPLY(false); \ + if (encoderPosition > 0x8000) encoderPosition = 0; \ + static int8_t _countedItems = 0; \ + int8_t encoderLine = encoderPosition / (ENCODER_STEPS_PER_MENU_ITEM); \ + if (_countedItems > 0 && encoderLine >= _countedItems - (LIMIT)) { \ + encoderLine = max(0, _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 < menu_bottom; _lcdLineNr++, _menuLineNr++) { \ + for (int8_t _lcdLineNr = 0; _lcdLineNr < LCD_HEIGHT - (TALL_FONT_CORRECTION); _lcdLineNr++, _menuLineNr++) { \ _thisItemNr = 0 /** @@ -380,22 +382,28 @@ uint16_t max_display_update_time = 0; * Scroll as-needed to keep the selected line in view. */ #define START_SCREEN() \ - scroll_screen(menu_bottom, false); \ + START_SCREEN_OR_MENU(LCD_HEIGHT - (TALL_FONT_CORRECTION)); \ + encoderTopLine = encoderLine; \ bool _skipStatic = false; \ SCREEN_OR_MENU_LOOP() #define START_MENU() \ - scroll_screen(1, true); \ + START_SCREEN_OR_MENU(1); \ + screen_changed = false; \ + NOMORE(encoderTopLine, encoderLine); \ + if (encoderLine >= encoderTopLine + LCD_HEIGHT - (TALL_FONT_CORRECTION)) { \ + encoderTopLine = encoderLine - (LCD_HEIGHT - (TALL_FONT_CORRECTION) - 1); \ + } \ bool _skipStatic = true; \ SCREEN_OR_MENU_LOOP() #define END_SCREEN() \ } \ - screen_items = _thisItemNr + _countedItems = _thisItemNr #define END_MENU() \ } \ - screen_items = _thisItemNr; \ + _countedItems = _thisItemNr; \ UNUSED(_skipStatic) //////////////////////////////////////////// @@ -467,7 +475,7 @@ uint16_t max_display_update_time = 0; #if IS_KINEMATIC bool processing_manual_move = false; - float manual_move_offset = 0; + float manual_move_offset = 0.0; #else constexpr bool processing_manual_move = false; #endif @@ -480,23 +488,12 @@ uint16_t max_display_update_time = 0; float raw_Ki, raw_Kd; // place-holders for Ki and Kd edits #endif - inline bool use_click() { - const bool click = lcd_clicked; - lcd_clicked = false; - return click; - } - /** * General function to go directly to a screen */ - void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) { + void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0) { if (currentScreen != screen) { - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - // Shadow for editing the fade height - new_z_fade_height = planner.z_fade_height; - #endif - #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) && ENABLED(BABYSTEPPING) static millis_t doubleclick_expire_ms = 0; // Going to lcd_main_menu from status screen? Remember first click time. @@ -505,7 +502,7 @@ uint16_t max_display_update_time = 0; if (currentScreen == lcd_status_screen) doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL; } - else if (screen == lcd_status_screen && currentScreen == lcd_main_menu && PENDING(millis(), doubleclick_expire_ms) && (planner.movesplanned() || IS_SD_PRINTING())) + else if (screen == lcd_status_screen && currentScreen == lcd_main_menu && PENDING(millis(), doubleclick_expire_ms)) screen = #if ENABLED(BABYSTEP_ZPROBE_OFFSET) lcd_babystep_zoffset @@ -557,13 +554,14 @@ uint16_t max_display_update_time = 0; // done. ** This blocks the command queue! ** // void _lcd_synchronize() { + static bool no_reentry = false; if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, sync_message); if (no_reentry) return; // Make this the current handler till all moves are done no_reentry = true; const screenFunc_t old_screen = currentScreen; lcd_goto_screen(_lcd_synchronize); - planner.synchronize(); // idle() is called until moves complete + stepper.synchronize(); no_reentry = false; lcd_goto_screen(old_screen); } @@ -602,38 +600,6 @@ uint16_t max_display_update_time = 0; lcd_goto_previous_menu(); } - /** - * Scrolling for menus and other line-based screens - * - * 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 - * screen_items is the total number of items in the menu (after one call) - */ - int8_t encoderLine, screen_items; - void scroll_screen(const uint8_t limit, const bool is_menu) { - ENCODER_DIRECTION_MENUS(); - ENCODER_RATE_MULTIPLY(false); - if (encoderPosition > 0x8000) encoderPosition = 0; - if (first_page) { - encoderLine = encoderPosition / (ENCODER_STEPS_PER_MENU_ITEM); - screen_changed = false; - } - if (screen_items > 0 && encoderLine >= screen_items - limit) { - encoderLine = MAX(0, screen_items - limit); - encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); - } - if (is_menu) { - NOMORE(encoderTopLine, encoderLine); - if (encoderLine >= encoderTopLine + menu_bottom) - encoderTopLine = encoderLine - menu_bottom + 1; - } - else - encoderTopLine = encoderLine; - } - #endif // ULTIPANEL /** @@ -650,12 +616,6 @@ void lcd_status_screen() { ENCODER_RATE_MULTIPLY(false); #endif - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD)) - // Progress bar % comes from SD when actively printing - if (IS_SD_PRINTING()) - progress_bar_percent = card.percentDone(); - #endif - #if ENABLED(LCD_PROGRESS_BAR) // @@ -664,6 +624,12 @@ void lcd_status_screen() { // share the same line on the display. // + // Set current percentage from SD when actively printing + #if ENABLED(LCD_SET_PROGRESS_MANUALLY) + if (IS_SD_PRINTING) + progress_bar_percent = card.percentDone(); + #endif + millis_t ms = millis(); // If the message will blink rather than expire... @@ -701,7 +667,7 @@ void lcd_status_screen() { #if ENABLED(ULTIPANEL) - if (use_click()) { + if (lcd_clicked) { #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) previous_lcd_status_ms = millis(); // get status message to show up for a while #endif @@ -744,27 +710,7 @@ void lcd_status_screen() { lcd_implementation_status_screen(); } -/** - * Reset the status message - */ -void lcd_reset_status() { - static const char paused[] PROGMEM = MSG_PRINT_PAUSED; - static const char printing[] PROGMEM = MSG_PRINTING; - static const char welcome[] PROGMEM = WELCOME_MSG; - const char *msg; - if (print_job_timer.isPaused()) - msg = paused; - #if ENABLED(SDSUPPORT) - else if (card.sdprinting) - return lcd_setstatus(card.longest_filename(), true); - #endif - else if (print_job_timer.isRunning()) - msg = printing; - else - msg = welcome; - - lcd_setstatusPGM(msg, -1); -} +void lcd_reset_status() { lcd_setstatusPGM(PSTR(""), -1); } /** * @@ -777,44 +723,36 @@ void kill_screen(const char* lcd_msg) { lcd_kill_screen(); } -/** - * - * Audio feedback for controller clicks - * - */ -void lcd_buzz(const long duration, const uint16_t freq) { - #if ENABLED(LCD_USE_I2C_BUZZER) - lcd.buzz(duration, freq); - #elif PIN_EXISTS(BEEPER) - buzzer.tone(duration, freq); - #else - UNUSED(duration); UNUSED(freq); - #endif -} +#if ENABLED(ULTIPANEL) -void lcd_quick_feedback(const bool clear_buttons) { + /** + * + * Audio feedback for controller clicks + * + */ + void lcd_buzz(const long duration, const uint16_t freq) { + #if ENABLED(LCD_USE_I2C_BUZZER) + lcd.buzz(duration, freq); + #elif PIN_EXISTS(BEEPER) + buzzer.tone(duration, freq); + #else + UNUSED(duration); UNUSED(freq); + #endif + } - #if ENABLED(ULTIPANEL) - lcd_refresh(); - if (clear_buttons) buttons = 0; + void lcd_quick_feedback() { + lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; + buttons = 0; next_button_update_ms = millis() + 500; - #else - UNUSED(clear_buttons); - #endif - // Buzz and wait. The delay is needed for buttons to settle! - lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - - #if ENABLED(ULTIPANEL) + // 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 -} - -#if ENABLED(ULTIPANEL) + } void lcd_completion_feedback(const bool good/*=true*/) { if (good) { @@ -841,7 +779,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #if ENABLED(PARK_HEAD_ON_PAUSE) enqueue_and_echo_commands_P(PSTR("M125")); #endif - lcd_reset_status(); + lcd_setstatusPGM(PSTR(MSG_PRINT_PAUSED), -1); } void lcd_sdcard_resume() { @@ -855,88 +793,21 @@ void lcd_quick_feedback(const bool clear_buttons) { } void lcd_sdcard_stop() { - wait_for_heatup = wait_for_user = false; - card.abort_sd_printing = true; + card.stopSDPrint(); + clear_command_queue(); + quickstop_stepper(); + print_job_timer.stop(); + thermalManager.disable_all_heaters(); + #if FAN_COUNT > 0 + for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; + #endif + wait_for_heatup = false; lcd_setstatusPGM(PSTR(MSG_PRINT_ABORTED), -1); lcd_return_to_status(); } #endif // SDSUPPORT - #if ENABLED(POWER_LOSS_RECOVERY) - - static void lcd_power_loss_recovery_resume() { - char cmd[20]; - - // Return to status now - lcd_return_to_status(); - - // Turn leveling off and home - enqueue_and_echo_commands_P(PSTR("M420 S0\nG28 R0" - #if ENABLED(MARLIN_DEV_MODE) - " S" - #elif !IS_KINEMATIC - " X Y" - #endif - )); - - #if HAS_HEATED_BED - const int16_t bt = job_recovery_info.target_temperature_bed; - if (bt) { - // Restore the bed temperature - sprintf_P(cmd, PSTR("M190 S%i"), bt); - enqueue_and_echo_command(cmd); - } - #endif - - // Restore all hotend temperatures - HOTEND_LOOP() { - const int16_t et = job_recovery_info.target_temperature[e]; - if (et) { - #if HOTENDS > 1 - sprintf_P(cmd, PSTR("T%i"), e); - enqueue_and_echo_command(cmd); - #endif - sprintf_P(cmd, PSTR("M109 S%i"), et); - enqueue_and_echo_command(cmd); - } - } - - #if HOTENDS > 1 - sprintf_P(cmd, PSTR("T%i"), job_recovery_info.active_hotend); - enqueue_and_echo_command(cmd); - #endif - - // Restore print cooling fan speeds - for (uint8_t i = 0; i < FAN_COUNT; i++) { - int16_t f = job_recovery_info.fanSpeeds[i]; - if (f) { - sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f); - enqueue_and_echo_command(cmd); - } - } - - // Start draining the job recovery command queue - job_recovery_phase = JOB_RECOVERY_YES; - } - - static void lcd_power_loss_recovery_cancel() { - card.removeJobRecoveryFile(); - card.autostart_index = 0; - lcd_return_to_status(); - } - - static void lcd_job_recovery_menu() { - defer_return_to_status = true; - START_MENU(); - STATIC_ITEM(MSG_POWER_LOSS_RECOVERY); - MENU_ITEM(function, MSG_RESUME_PRINT, lcd_power_loss_recovery_resume); - MENU_ITEM(function, MSG_STOP_PRINT, lcd_power_loss_recovery_cancel); - END_MENU(); - } - - #endif // POWER_LOSS_RECOVERY - #if ENABLED(MENU_ITEM_CASE_LIGHT) extern uint8_t case_light_brightness; @@ -968,10 +839,10 @@ void lcd_quick_feedback(const bool clear_buttons) { // ^ Main // MENU_BACK(MSG_MAIN); - MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); - MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); - MENU_ITEM(gcode, MSG_BLTOUCH_DEPLOY, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_DEPLOY))); - MENU_ITEM(gcode, MSG_BLTOUCH_STOW, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_STOW))); + MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_ENDSTOP_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); + MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_ENDSTOP_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); + MENU_ITEM(gcode, MSG_BLTOUCH_DEPLOY, PSTR("M280 P" STRINGIFY(Z_ENDSTOP_SERVO_NR) " S" STRINGIFY(BLTOUCH_DEPLOY))); + MENU_ITEM(gcode, MSG_BLTOUCH_STOW, PSTR("M280 P" STRINGIFY(Z_ENDSTOP_SERVO_NR) " S" STRINGIFY(BLTOUCH_STOW))); END_MENU(); } @@ -981,7 +852,7 @@ void lcd_quick_feedback(const bool clear_buttons) { static void progress_bar_test() { static int8_t bar_percent = 0; - if (use_click()) { + if (lcd_clicked) { lcd_goto_previous_menu(); lcd_set_custom_characters(CHARSET_MENU); return; @@ -1107,11 +978,12 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); #endif - if (planner.movesplanned() || IS_SD_PRINTING()) + if (planner.movesplanned() || IS_SD_PRINTING) { MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu); - else + } + else { MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu); - + } MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu); #if ENABLED(SDSUPPORT) @@ -1207,7 +1079,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #if ENABLED(BABYSTEPPING) void _lcd_babystep(const AxisEnum axis, const char* msg) { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } + if (lcd_clicked) { return lcd_goto_previous_menu_no_defer(); } ENCODER_DIRECTION_NORMAL(); if (encoderPosition) { const int16_t babystep_increment = (int32_t)encoderPosition * (BABYSTEP_MULTIPLICATOR); @@ -1230,7 +1102,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #if ENABLED(BABYSTEP_ZPROBE_OFFSET) void lcd_babystep_zoffset() { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } + if (lcd_clicked) { return lcd_goto_previous_menu_no_defer(); } defer_return_to_status = true; ENCODER_DIRECTION_NORMAL(); if (encoderPosition) { @@ -1239,7 +1111,10 @@ void lcd_quick_feedback(const bool clear_buttons) { const float new_zoffset = zprobe_zoffset + planner.steps_to_mm[Z_AXIS] * babystep_increment; if (WITHIN(new_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - thermalManager.babystep_axis(Z_AXIS, babystep_increment); + + if (planner.leveling_active) + thermalManager.babystep_axis(Z_AXIS, babystep_increment); + zprobe_zoffset = new_zoffset; lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; } @@ -1273,13 +1148,13 @@ void lcd_quick_feedback(const bool clear_buttons) { ubl_encoderPosition = (ubl.encoder_diff > 0) ? 1 : -1; ubl.encoder_diff = 0; - mesh_edit_accumulator += float(ubl_encoderPosition) * 0.005f * 0.5f; + mesh_edit_accumulator += float(ubl_encoderPosition) * 0.005 / 2.0; mesh_edit_value = mesh_edit_accumulator; encoderPosition = 0; lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - const int32_t rounded = (int32_t)(mesh_edit_value * 1000); - mesh_edit_value = float(rounded - (rounded % 5L)) / 1000; + const int32_t rounded = (int32_t)(mesh_edit_value * 1000.0); + mesh_edit_value = float(rounded - (rounded % 5L)) / 1000.0; } if (lcdDrawUpdate) { @@ -1301,7 +1176,7 @@ void lcd_quick_feedback(const bool clear_buttons) { return mesh_edit_value; } - void lcd_mesh_edit_setup(const float &initial) { + void lcd_mesh_edit_setup(const float initial) { mesh_edit_value = mesh_edit_accumulator = initial; lcd_goto_screen(_lcd_mesh_edit_NOP); } @@ -1315,7 +1190,7 @@ void lcd_quick_feedback(const bool clear_buttons) { return mesh_edit_value; } - void lcd_z_offset_edit_setup(const float &initial) { + void lcd_z_offset_edit_setup(float initial) { mesh_edit_value = mesh_edit_accumulator = initial; lcd_goto_screen(_lcd_z_offset_edit); } @@ -1353,6 +1228,25 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif } + #if ENABLED(ADVANCED_PAUSE_FEATURE) + + void lcd_enqueue_filament_change() { + + #if ENABLED(PREVENT_COLD_EXTRUSION) + if (!DEBUGGING(DRYRUN) && !thermalManager.allow_cold_extrude && + thermalManager.degTargetHotend(active_extruder) < thermalManager.extrude_min_temp) { + lcd_save_previous_screen(); + lcd_goto_screen(lcd_advanced_pause_toocold_menu); + return; + } + #endif + + lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT); + enqueue_and_echo_commands_P(PSTR("M600 B0")); + } + + #endif // ADVANCED_PAUSE_FEATURE + // First Fan Speed title in "Tune" and "Control>Temperature" menus #if FAN_COUNT > 0 && HAS_FAN0 #if FAN_COUNT > 1 @@ -1396,20 +1290,11 @@ void lcd_quick_feedback(const bool clear_buttons) { // MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999); - // // Manual bed leveling, Bed Z: - // #if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING) MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); #endif - // - // Leveling Fade Height - // - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(SLIM_LCD_MENUS) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - // // Nozzle: // Nozzle [1-4]: @@ -1433,7 +1318,7 @@ void lcd_quick_feedback(const bool clear_buttons) { // // Bed: // - #if HAS_HEATED_BED + #if HAS_TEMP_BED MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); #endif @@ -1503,14 +1388,8 @@ void lcd_quick_feedback(const bool clear_buttons) { // Change filament // #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if E_STEPPERS == 1 && !ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0")); - else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_temp_menu_e0_filament_change); - #else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_change_filament_menu); - #endif + if (!thermalManager.tooColdToExtrude(active_extruder)) + MENU_ITEM(function, MSG_FILAMENTCHANGE, lcd_enqueue_filament_change); #endif END_MENU(); @@ -1570,8 +1449,8 @@ void lcd_quick_feedback(const bool clear_buttons) { * */ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb, const int16_t fan) { - if (temph > 0) thermalManager.setTargetHotend(MIN(heater_maxtemp[endnum], temph), endnum); - #if HAS_HEATED_BED + if (temph > 0) thermalManager.setTargetHotend(min(heater_maxtemp[endnum], temph), endnum); + #if TEMP_SENSOR_BED != 0 if (tempb >= 0) thermalManager.setTargetBed(tempb); #else UNUSED(tempb); @@ -1588,10 +1467,10 @@ void lcd_quick_feedback(const bool clear_buttons) { lcd_return_to_status(); } - #if HAS_TEMP_HOTEND + #if TEMP_SENSOR_0 != 0 void lcd_preheat_m1_e0_only() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } void lcd_preheat_m2_e0_only() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 void lcd_preheat_m1_e0() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } void lcd_preheat_m2_e0() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } #endif @@ -1600,28 +1479,28 @@ void lcd_quick_feedback(const bool clear_buttons) { #if HOTENDS > 1 void lcd_preheat_m1_e1_only() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } void lcd_preheat_m2_e1_only() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 void lcd_preheat_m1_e1() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } void lcd_preheat_m2_e1() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } #endif #if HOTENDS > 2 void lcd_preheat_m1_e2_only() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } void lcd_preheat_m2_e2_only() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 void lcd_preheat_m1_e2() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } void lcd_preheat_m2_e2() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } #endif #if HOTENDS > 3 void lcd_preheat_m1_e3_only() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } void lcd_preheat_m2_e3_only() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 void lcd_preheat_m1_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } void lcd_preheat_m2_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } #endif #if HOTENDS > 4 void lcd_preheat_m1_e4_only() { _lcd_preheat(4, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } void lcd_preheat_m2_e4_only() { _lcd_preheat(4, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 void lcd_preheat_m1_e4() { _lcd_preheat(4, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } void lcd_preheat_m2_e4() { _lcd_preheat(4, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } #endif @@ -1642,7 +1521,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif // HOTENDS > 3 #endif // HOTENDS > 2 #endif // HOTENDS > 1 - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 lcd_preheat_m1_e0(); #else lcd_preheat_m1_e0_only(); @@ -1661,7 +1540,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif // HOTENDS > 3 #endif // HOTENDS > 2 #endif // HOTENDS > 1 - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 lcd_preheat_m2_e0(); #else lcd_preheat_m2_e0_only(); @@ -1670,25 +1549,25 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif // HOTENDS > 1 - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 void lcd_preheat_m1_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } void lcd_preheat_m2_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } #endif - #if HAS_TEMP_HOTEND || HAS_HEATED_BED + #if TEMP_SENSOR_0 != 0 && (TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || TEMP_SENSOR_BED != 0) void lcd_preheat_m1_menu() { START_MENU(); MENU_BACK(MSG_PREPARE); #if HOTENDS == 1 - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0); MENU_ITEM(function, MSG_PREHEAT_1_END, lcd_preheat_m1_e0_only); #else MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only); #endif - #elif HOTENDS > 1 - #if HAS_HEATED_BED + #else + #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0); MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E1, lcd_preheat_m1_e0_only); MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1); @@ -1698,21 +1577,21 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1_only); #endif #if HOTENDS > 2 - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2); MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E3, lcd_preheat_m1_e2_only); #else MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2_only); #endif #if HOTENDS > 3 - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3); MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E4, lcd_preheat_m1_e3_only); #else MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3_only); #endif #if HOTENDS > 4 - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H5, lcd_preheat_m1_e4); MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E5, lcd_preheat_m1_e4_only); #else @@ -1723,7 +1602,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif // HOTENDS > 2 MENU_ITEM(function, MSG_PREHEAT_1_ALL, lcd_preheat_m1_all); #endif // HOTENDS > 1 - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_1_BEDONLY, lcd_preheat_m1_bedonly); #endif END_MENU(); @@ -1733,14 +1612,14 @@ void lcd_quick_feedback(const bool clear_buttons) { START_MENU(); MENU_BACK(MSG_PREPARE); #if HOTENDS == 1 - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0); MENU_ITEM(function, MSG_PREHEAT_2_END, lcd_preheat_m2_e0_only); #else MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only); #endif - #elif HOTENDS > 1 - #if HAS_HEATED_BED + #else + #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0); MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E1, lcd_preheat_m2_e0_only); MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1); @@ -1750,21 +1629,21 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1_only); #endif #if HOTENDS > 2 - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2); MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E3, lcd_preheat_m2_e2_only); #else MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2_only); #endif #if HOTENDS > 3 - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3); MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E4, lcd_preheat_m2_e3_only); #else MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3_only); #endif #if HOTENDS > 4 - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H5, lcd_preheat_m2_e4); MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E5, lcd_preheat_m2_e4_only); #else @@ -1775,13 +1654,13 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif // HOTENDS > 2 MENU_ITEM(function, MSG_PREHEAT_2_ALL, lcd_preheat_m2_all); #endif // HOTENDS > 1 - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_2_BEDONLY, lcd_preheat_m2_bedonly); #endif END_MENU(); } - #endif // HAS_TEMP_HOTEND || HAS_HEATED_BED + #endif // TEMP_SENSOR_0 && (TEMP_SENSOR_1 || TEMP_SENSOR_2 || TEMP_SENSOR_3 || TEMP_SENSOR_4 || TEMP_SENSOR_BED) void lcd_cooldown() { #if FAN_COUNT > 0 @@ -1791,29 +1670,13 @@ void lcd_quick_feedback(const bool clear_buttons) { lcd_return_to_status(); } - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE) - - /** - * If the queue is full, the command will fail, so we have to loop - * with idle() to make sure the command has been enqueued. - */ - void lcd_enqueue_command(char * const cmd) { - no_reentry = true; - enqueue_and_echo_command_now(cmd); - no_reentry = false; - } - - void lcd_enqueue_commands_P(const char * const cmd) { - no_reentry = true; - enqueue_and_echo_commands_now_P(cmd); - no_reentry = false; - } - - #endif - #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) - void lcd_autostart_sd() { card.beginautostart(); } + void lcd_autostart_sd() { + card.autostart_index = 0; + card.setroot(); + card.checkautostart(true); + } #endif @@ -1832,43 +1695,27 @@ void lcd_quick_feedback(const bool clear_buttons) { line_to_z(4.0); switch (bed_corner) { case 0: - current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; - current_position[Y_AXIS] = Y_MIN_BED + LEVEL_CORNERS_INSET; + current_position[X_AXIS] = X_MIN_BED + 10; + current_position[Y_AXIS] = Y_MIN_BED + 10; break; case 1: - current_position[X_AXIS] = X_MAX_BED - LEVEL_CORNERS_INSET; + current_position[X_AXIS] = X_MAX_BED - 10; break; case 2: - current_position[Y_AXIS] = Y_MAX_BED - LEVEL_CORNERS_INSET; + current_position[Y_AXIS] = Y_MAX_BED - 10; break; case 3: - current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; + current_position[X_AXIS] = X_MIN_BED + 10; break; - #if ENABLED(LEVEL_CENTER_TOO) - case 4: - current_position[X_AXIS] = X_CENTER; - current_position[Y_AXIS] = Y_CENTER; - break; - #endif } planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[X_AXIS]), active_extruder); line_to_z(0.0); - if (++bed_corner > 3 - #if ENABLED(LEVEL_CENTER_TOO) - + 1 - #endif - ) bed_corner = 0; + if (++bed_corner > 3) bed_corner = 0; } void _lcd_corner_submenu() { START_MENU(); - MENU_ITEM(function, - #if ENABLED(LEVEL_CENTER_TOO) - MSG_LEVEL_BED_NEXT_POINT - #else - MSG_NEXT_CORNER - #endif - , _lcd_goto_next_corner); + MENU_ITEM(function, MSG_NEXT_CORNER, _lcd_goto_next_corner); MENU_ITEM(function, MSG_BACK, lcd_goto_previous_menu_no_defer); END_MENU(); } @@ -1882,7 +1729,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif // LEVEL_BED_CORNERS - #if ENABLED(LCD_BED_LEVELING) && (ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING)) + #if ENABLED(LCD_BED_LEVELING) /** * @@ -1918,11 +1765,12 @@ void lcd_quick_feedback(const bool clear_buttons) { if (!lcd_wait_for_move) { #if MANUAL_PROBE_HEIGHT > 0 && DISABLED(MESH_BED_LEVELING) // Display "Done" screen and wait for moves to complete - line_to_z(MANUAL_PROBE_HEIGHT); + line_to_z(Z_MIN_POS + MANUAL_PROBE_HEIGHT); lcd_synchronize(PSTR(MSG_LEVEL_BED_DONE)); #endif - lcd_goto_previous_menu_no_defer(); + lcd_goto_previous_menu(); lcd_completion_feedback(); + defer_return_to_status = false; } if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_DONE)); lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; @@ -1936,7 +1784,7 @@ void lcd_quick_feedback(const bool clear_buttons) { void _lcd_level_bed_get_z() { ENCODER_DIRECTION_NORMAL(); - if (use_click()) { + if (lcd_clicked) { // // Save the current Z position and move @@ -1949,10 +1797,10 @@ void lcd_quick_feedback(const bool clear_buttons) { // lcd_wait_for_move = true; lcd_goto_screen(_lcd_level_bed_done); - #if ENABLED(MESH_BED_LEVELING) - enqueue_and_echo_commands_P(PSTR("G29 S2")); - #elif ENABLED(PROBE_MANUALLY) + #if ENABLED(PROBE_MANUALLY) enqueue_and_echo_commands_P(PSTR("G29 V1")); + #elif ENABLED(MESH_BED_LEVELING) + enqueue_and_echo_commands_P(PSTR("G29 S2")); #endif } else @@ -1965,8 +1813,9 @@ void lcd_quick_feedback(const bool clear_buttons) { // Encoder knob or keypad buttons adjust the Z position // if (encoderPosition) { + refresh_cmd_timeout(); const float z = current_position[Z_AXIS] + float((int32_t)encoderPosition) * (MBL_Z_STEP); - line_to_z(constrain(z, -(LCD_PROBE_Z_RANGE) * 0.5f, (LCD_PROBE_Z_RANGE) * 0.5f)); + line_to_z(constrain(z, -(LCD_PROBE_Z_RANGE) * 0.5, (LCD_PROBE_Z_RANGE) * 0.5)); lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; encoderPosition = 0; } @@ -1976,7 +1825,7 @@ void lcd_quick_feedback(const bool clear_buttons) { // if (lcdDrawUpdate) { const float v = current_position[Z_AXIS]; - lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); + lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001 : 0.0001), '+')); } } @@ -1997,14 +1846,15 @@ void lcd_quick_feedback(const bool clear_buttons) { * Step 5: Initiate a move to the next point */ void _lcd_level_goto_next_point() { + // Set the menu to display ahead of blocking call lcd_goto_screen(_lcd_level_bed_moving); // G29 Records Z, moves, and signals when it pauses lcd_wait_for_move = true; - #if ENABLED(MESH_BED_LEVELING) - enqueue_and_echo_commands_P(manual_probe_index ? PSTR("G29 S2") : PSTR("G29 S1")); - #elif ENABLED(PROBE_MANUALLY) + #if ENABLED(PROBE_MANUALLY) enqueue_and_echo_commands_P(PSTR("G29 V1")); + #elif ENABLED(MESH_BED_LEVELING) + enqueue_and_echo_commands_P(manual_probe_index ? PSTR("G29 S2") : PSTR("G29 S1")); #endif } @@ -2014,7 +1864,7 @@ void lcd_quick_feedback(const bool clear_buttons) { */ void _lcd_level_bed_homing_done() { if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING)); - if (use_click()) { + if (lcd_clicked) { manual_probe_index = 0; _lcd_level_goto_next_point(); } @@ -2026,7 +1876,8 @@ void lcd_quick_feedback(const bool clear_buttons) { void _lcd_level_bed_homing() { if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL); lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW; - if (all_axes_homed()) lcd_goto_screen(_lcd_level_bed_homing_done); + if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) + lcd_goto_screen(_lcd_level_bed_homing_done); } #if ENABLED(PROBE_MANUALLY) @@ -2038,11 +1889,86 @@ void lcd_quick_feedback(const bool clear_buttons) { */ void _lcd_level_bed_continue() { defer_return_to_status = true; - axis_homed = 0; + axis_homed[X_AXIS] = axis_homed[Y_AXIS] = axis_homed[Z_AXIS] = false; lcd_goto_screen(_lcd_level_bed_homing); enqueue_and_echo_commands_P(PSTR("G28")); } + static bool new_level_state; + void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(new_level_state); } + + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + static float new_z_fade_height; + void _lcd_set_z_fade_height() { set_z_fade_height(new_z_fade_height); } + #endif + + /** + * Step 1: Bed Level entry-point + * + * << Prepare + * Auto Home (if homing needed) + * Leveling On/Off (if data exists, and homed) + * Fade Height: --- (Req: ENABLE_LEVELING_FADE_HEIGHT) + * Mesh Z Offset: --- (Req: MESH_BED_LEVELING) + * Z Probe Offset: --- (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET) + * Level Bed > + * Level Corners > (if homed) + * Load Settings (Req: EEPROM_SETTINGS) + * Save Settings (Req: EEPROM_SETTINGS) + */ + void lcd_bed_leveling() { + START_MENU(); + MENU_BACK(MSG_PREPARE); + + #if DISABLED(MESH_BED_LEVELING) + if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) + MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); + else + #endif + if (leveling_is_valid()) { + new_level_state = planner.leveling_active; + MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling); + } + + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0.0, 100.0, _lcd_set_z_fade_height); + #endif + + // + // MBL Z Offset + // + #if ENABLED(MESH_BED_LEVELING) + MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); + #endif + + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); + #elif HAS_BED_PROBE + MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + #endif + + MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue); + + #if ENABLED(LEVEL_BED_CORNERS) + // Move to the next corner for leveling + if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) + MENU_ITEM(submenu, MSG_LEVEL_CORNERS, _lcd_level_bed_corners); + #endif + + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); + MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); + #endif + END_MENU(); + } + + void _lcd_goto_bed_leveling() { + lcd_goto_screen(lcd_bed_leveling); + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + new_z_fade_height = planner.z_fade_height; + #endif + } + #elif ENABLED(AUTO_BED_LEVELING_UBL) void _lcd_ubl_level_bed(); @@ -2056,7 +1982,7 @@ void lcd_quick_feedback(const bool clear_buttons) { x_plot = 0, y_plot = 0; - #if HAS_HEATED_BED + #if HAS_TEMP_BED static int16_t custom_bed_temp = 50; #endif @@ -2066,12 +1992,12 @@ void lcd_quick_feedback(const bool clear_buttons) { void _lcd_ubl_build_custom_mesh() { char UBL_LCD_GCODE[20]; enqueue_and_echo_commands_P(PSTR("G28")); - #if HAS_HEATED_BED + #if HAS_TEMP_BED sprintf_P(UBL_LCD_GCODE, PSTR("M190 S%i"), custom_bed_temp); - lcd_enqueue_command(UBL_LCD_GCODE); + enqueue_and_echo_command(UBL_LCD_GCODE); #endif sprintf_P(UBL_LCD_GCODE, PSTR("M109 S%i"), custom_hotend_temp); - lcd_enqueue_command(UBL_LCD_GCODE); + enqueue_and_echo_command(UBL_LCD_GCODE); enqueue_and_echo_commands_P(PSTR("G29 P1")); } @@ -2087,8 +2013,8 @@ void lcd_quick_feedback(const bool clear_buttons) { START_MENU(); MENU_BACK(MSG_UBL_BUILD_MESH_MENU); MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_HOTEND_TEMP, &custom_hotend_temp, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP - 10)); - #if HAS_HEATED_BED - MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_BED_TEMP, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 15)); + #if HAS_TEMP_BED + MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_BED_TEMP, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 5)); #endif MENU_ITEM(function, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh); END_MENU(); @@ -2101,8 +2027,8 @@ void lcd_quick_feedback(const bool clear_buttons) { char UBL_LCD_GCODE[16]; const int ind = ubl_height_amount > 0 ? 9 : 10; strcpy_P(UBL_LCD_GCODE, PSTR("G29 P6 C -")); - sprintf_P(&UBL_LCD_GCODE[ind], PSTR(".%i"), ABS(ubl_height_amount)); - lcd_enqueue_command(UBL_LCD_GCODE); + sprintf_P(&UBL_LCD_GCODE[ind], PSTR(".%i"), abs(ubl_height_amount)); + enqueue_and_echo_command(UBL_LCD_GCODE); } /** @@ -2146,15 +2072,14 @@ void lcd_quick_feedback(const bool clear_buttons) { void _lcd_ubl_validate_custom_mesh() { char UBL_LCD_GCODE[24]; const int temp = - #if HAS_HEATED_BED + #if HAS_TEMP_BED custom_bed_temp #else 0 #endif ; - sprintf_P(UBL_LCD_GCODE, PSTR("G26 C B%i H%i P"), temp, custom_hotend_temp); - lcd_enqueue_commands_P(PSTR("G28")); - lcd_enqueue_command(UBL_LCD_GCODE); + sprintf_P(UBL_LCD_GCODE, PSTR("G28\nG26 C B%i H%i P"), temp, custom_hotend_temp); + enqueue_and_echo_command(UBL_LCD_GCODE); } /** @@ -2169,7 +2094,7 @@ void lcd_quick_feedback(const bool clear_buttons) { void _lcd_ubl_validate_mesh() { START_MENU(); MENU_BACK(MSG_UBL_TOOLS); - #if HAS_HEATED_BED + #if HAS_TEMP_BED MENU_ITEM(gcode, MSG_UBL_VALIDATE_PLA_MESH, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_1_TEMP_BED) " H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); MENU_ITEM(gcode, MSG_UBL_VALIDATE_ABS_MESH, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_2_TEMP_BED) " H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); #else @@ -2187,7 +2112,7 @@ void lcd_quick_feedback(const bool clear_buttons) { void _lcd_ubl_grid_level_cmd() { char UBL_LCD_GCODE[10]; sprintf_P(UBL_LCD_GCODE, PSTR("G29 J%i"), side_points); - lcd_enqueue_command(UBL_LCD_GCODE); + enqueue_and_echo_command(UBL_LCD_GCODE); } /** @@ -2228,7 +2153,16 @@ void lcd_quick_feedback(const bool clear_buttons) { void _lcd_ubl_fillin_amount_cmd() { char UBL_LCD_GCODE[16]; sprintf_P(UBL_LCD_GCODE, PSTR("G29 P3 R C.%i"), ubl_fillin_amount); - lcd_enqueue_command(UBL_LCD_GCODE); + enqueue_and_echo_command(UBL_LCD_GCODE); + } + + /** + * UBL Smart Fill-in Command + */ + void _lcd_ubl_smart_fillin_cmd() { + char UBL_LCD_GCODE[12]; + sprintf_P(UBL_LCD_GCODE, PSTR("G29 P3 T0")); + enqueue_and_echo_command(UBL_LCD_GCODE); } /** @@ -2245,7 +2179,7 @@ void lcd_quick_feedback(const bool clear_buttons) { START_MENU(); MENU_BACK(MSG_UBL_BUILD_MESH_MENU); MENU_ITEM_EDIT_CALLBACK(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9, _lcd_ubl_fillin_amount_cmd); - MENU_ITEM(gcode, MSG_UBL_SMART_FILLIN, PSTR("G29 P3 T0")); + MENU_ITEM(function, MSG_UBL_SMART_FILLIN, _lcd_ubl_smart_fillin_cmd); MENU_ITEM(gcode, MSG_UBL_MANUAL_FILLIN, PSTR("G29 P2 B T0")); MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); END_MENU(); @@ -2273,7 +2207,7 @@ void lcd_quick_feedback(const bool clear_buttons) { void _lcd_ubl_build_mesh() { START_MENU(); MENU_BACK(MSG_UBL_TOOLS); - #if HAS_HEATED_BED + #if HAS_TEMP_BED MENU_ITEM(gcode, MSG_UBL_BUILD_PLA_MESH, PSTR( "G28\n" "M190 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\n" @@ -2320,9 +2254,9 @@ void lcd_quick_feedback(const bool clear_buttons) { void _lcd_ubl_load_mesh_cmd() { char UBL_LCD_GCODE[25]; sprintf_P(UBL_LCD_GCODE, PSTR("G29 L%i"), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_LOADED), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); + enqueue_and_echo_command(UBL_LCD_GCODE); + sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_LOADED "."), ubl_storage_slot); + enqueue_and_echo_command(UBL_LCD_GCODE); } /** @@ -2331,9 +2265,9 @@ void lcd_quick_feedback(const bool clear_buttons) { void _lcd_ubl_save_mesh_cmd() { char UBL_LCD_GCODE[25]; sprintf_P(UBL_LCD_GCODE, PSTR("G29 S%i"), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_SAVED), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); + enqueue_and_echo_command(UBL_LCD_GCODE); + sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_SAVED "."), ubl_storage_slot); + enqueue_and_echo_command(UBL_LCD_GCODE); } /** @@ -2350,6 +2284,7 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_BACK(MSG_UBL_LEVEL_BED); if (!WITHIN(ubl_storage_slot, 0, a - 1)) { STATIC_ITEM(MSG_NO_STORAGE); + STATIC_ITEM(MSG_INIT_EEPROM); } else { MENU_ITEM_EDIT(int3, MSG_UBL_STORAGE_SLOT, &ubl_storage_slot, 0, a - 1); @@ -2368,7 +2303,7 @@ void lcd_quick_feedback(const bool clear_buttons) { defer_return_to_status = true; if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT < 3 ? 0 : (LCD_HEIGHT > 4 ? 2 : 1), PSTR(MSG_LEVEL_BED_HOMING)); lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW; - if (all_axes_homed()) { + if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) { ubl.lcd_map_control = true; // Return to the map screen lcd_goto_screen(_lcd_ubl_output_map_lcd); } @@ -2378,11 +2313,12 @@ void lcd_quick_feedback(const bool clear_buttons) { * UBL LCD "radar" map point editing */ void _lcd_ubl_map_lcd_edit_cmd() { - char UBL_LCD_GCODE[50], str[10], str2[10]; + char ubl_lcd_gcode [50], str[10], str2[10]; + dtostrf(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]), 0, 2, str); dtostrf(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]), 0, 2, str2); - snprintf_P(UBL_LCD_GCODE, sizeof(UBL_LCD_GCODE), PSTR("G29 P4 X%s Y%s R%i"), str, str2, n_edit_pts); - lcd_enqueue_command(UBL_LCD_GCODE); + snprintf_P(ubl_lcd_gcode, sizeof(ubl_lcd_gcode), PSTR("G29 P4 X%s Y%s R%i"), str, str2, n_edit_pts); + enqueue_and_echo_command(ubl_lcd_gcode); } /** @@ -2398,27 +2334,37 @@ void lcd_quick_feedback(const bool clear_buttons) { * UBL LCD "radar" map */ void set_current_from_steppers_for_axis(const AxisEnum axis); + void sync_plan_position(); void _lcd_do_nothing() {} void _lcd_hard_stop() { + stepper.quick_stop(); const screenFunc_t old_screen = currentScreen; currentScreen = _lcd_do_nothing; - planner.quick_stop(); + while (planner.movesplanned()) idle(); currentScreen = old_screen; + stepper.cleaning_buffer_counter = 0; set_current_from_steppers_for_axis(ALL_AXES); sync_plan_position(); + refresh_cmd_timeout(); } void _lcd_ubl_output_map_lcd() { static int16_t step_scaler = 0; - if (use_click()) return _lcd_ubl_map_lcd_edit_cmd(); + if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) + return lcd_goto_screen(_lcd_ubl_map_homing); + + if (lcd_clicked) return _lcd_ubl_map_lcd_edit_cmd(); ENCODER_DIRECTION_NORMAL(); if (encoderPosition) { step_scaler += (int32_t)encoderPosition; x_plot += step_scaler / (ENCODER_STEPS_PER_MENU_ITEM); - if (ABS(step_scaler) >= ENCODER_STEPS_PER_MENU_ITEM) step_scaler = 0; + if (abs(step_scaler) >= ENCODER_STEPS_PER_MENU_ITEM) + step_scaler = 0; + refresh_cmd_timeout(); + encoderPosition = 0; lcdDrawUpdate = LCDVIEW_REDRAW_NOW; } @@ -2458,8 +2404,8 @@ void lcd_quick_feedback(const bool clear_buttons) { * UBL Homing before LCD map */ void _lcd_ubl_output_map_lcd_cmd() { - if (!all_axes_known()) { - axis_homed = 0; + if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) { + axis_homed[X_AXIS] = axis_homed[Y_AXIS] = axis_homed[Z_AXIS] = false; enqueue_and_echo_commands_P(PSTR("G28")); } lcd_goto_screen(_lcd_ubl_map_homing); @@ -2520,7 +2466,7 @@ void lcd_quick_feedback(const bool clear_buttons) { START_MENU(); MENU_BACK(MSG_UBL_LEVEL_BED); MENU_ITEM(gcode, "1 " MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); - MENU_ITEM(gcode, "2 " MSG_UBL_SMART_FILLIN, PSTR("G29 P3 T0")); + MENU_ITEM(function, "2 " MSG_UBL_SMART_FILLIN, _lcd_ubl_smart_fillin_cmd); MENU_ITEM(submenu, "3 " MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); MENU_ITEM(gcode, "4 " MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); MENU_ITEM(submenu, "5 " MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); @@ -2554,93 +2500,11 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_ITEM(submenu, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); MENU_ITEM(submenu, MSG_UBL_TOOLS, _lcd_ubl_tools_menu); MENU_ITEM(gcode, MSG_UBL_INFO_UBL, PSTR("G29 W")); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif END_MENU(); } #endif // AUTO_BED_LEVELING_UBL - - #if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) - void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(!planner.leveling_active); } - #endif - - #if ENABLED(LCD_BED_LEVELING) - - /** - * Step 1: Bed Level entry-point - * - * << Prepare - * Auto Home (if homing needed) - * Leveling On/Off (if data exists, and homed) - * Fade Height: --- (Req: ENABLE_LEVELING_FADE_HEIGHT) - * Mesh Z Offset: --- (Req: MESH_BED_LEVELING) - * Z Probe Offset: --- (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET) - * Level Bed > - * Level Corners > (if homed) - * Load Settings (Req: EEPROM_SETTINGS) - * Save Settings (Req: EEPROM_SETTINGS) - */ - void lcd_bed_leveling() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - - const bool is_homed = all_axes_known(); - - // Auto Home if not using manual probing - #if DISABLED(PROBE_MANUALLY) && DISABLED(MESH_BED_LEVELING) - if (!is_homed) MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); - #endif - - // Level Bed - #if ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING) - // Manual leveling uses a guided procedure - MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue); - #else - // Automatic leveling can just run the G-code - MENU_ITEM(gcode, MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G28\nG29")); - #endif - - // Homed and leveling is valid? Then leveling can be toggled. - if (is_homed && leveling_is_valid()) { - bool new_level_state = planner.leveling_active; - MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling); - } - - // Z Fade Height - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - - // - // MBL Z Offset - // - #if ENABLED(MESH_BED_LEVELING) - MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); - #endif - - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); - #elif HAS_BED_PROBE - MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); - #endif - - #if ENABLED(LEVEL_BED_CORNERS) - // Move to the next corner for leveling - if (all_axes_homed()) MENU_ITEM(submenu, MSG_LEVEL_CORNERS, _lcd_level_bed_corners); - #endif - - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - #endif - END_MENU(); - } - - #endif // LCD_BED_LEVELING - /** * * "Prepare" submenu @@ -2659,7 +2523,7 @@ void lcd_quick_feedback(const bool clear_buttons) { // Move Axis // #if ENABLED(DELTA) - if (all_axes_homed()) + if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) #endif MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu); @@ -2673,52 +2537,37 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_ITEM(gcode, MSG_AUTO_HOME_Z, PSTR("G28 Z")); #endif - // - // TMC Z Calibration - // - #if ENABLED(TMC_Z_CALIBRATION) - MENU_ITEM(gcode, MSG_TMC_Z_CALIBRATION, PSTR("G28\nM915")); - #endif - // // Level Bed // #if ENABLED(AUTO_BED_LEVELING_UBL) - MENU_ITEM(submenu, MSG_UBL_LEVEL_BED, _lcd_ubl_level_bed); - #elif ENABLED(LCD_BED_LEVELING) - #if ENABLED(PROBE_MANUALLY) if (!g29_in_progress) #endif - MENU_ITEM(submenu, MSG_BED_LEVELING, lcd_bed_leveling); - - #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS) - - #if DISABLED(PROBE_MANUALLY) - MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G28\nG29")); - #endif - if (leveling_is_valid()) { - bool new_level_state = planner.leveling_active; - MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling); - } - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - + MENU_ITEM(submenu, MSG_BED_LEVELING, + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + _lcd_goto_bed_leveling + #else + lcd_bed_leveling + #endif + ); + #elif PLANNER_LEVELING && DISABLED(PROBE_MANUALLY) + MENU_ITEM(gcode, MSG_BED_LEVELING, PSTR("G28\nG29")); #endif #if ENABLED(LEVEL_BED_CORNERS) && DISABLED(LCD_BED_LEVELING) - if (all_axes_homed()) + if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) MENU_ITEM(function, MSG_LEVEL_CORNERS, _lcd_level_bed_corners); #endif - #if HAS_M206_COMMAND && DISABLED(SLIM_LCD_MENUS) + #if HAS_M206_COMMAND // // 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")); #endif // @@ -2730,26 +2579,18 @@ void lcd_quick_feedback(const bool clear_buttons) { // Change filament // #if ENABLED(ADVANCED_PAUSE_FEATURE) - if (!IS_SD_FILE_OPEN()) { - #if E_STEPPERS == 1 && !ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0")); - else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_temp_menu_e0_filament_change); - #else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_change_filament_menu); - #endif - } - #endif // ADVANCED_PAUSE_FEATURE + if (!thermalManager.tooColdToExtrude(active_extruder) && !IS_SD_FILE_OPEN) + MENU_ITEM(function, MSG_FILAMENTCHANGE, lcd_enqueue_filament_change); + #endif - #if HAS_TEMP_HOTEND + #if TEMP_SENSOR_0 != 0 // // Cooldown // bool has_heat = false; HOTEND_LOOP() if (thermalManager.target_temperature[HOTEND_INDEX]) { has_heat = true; break; } - #if HAS_HEATED_BED + #if HAS_TEMP_BED if (thermalManager.target_temperature_bed) has_heat = true; #endif if (has_heat) MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown); @@ -2757,7 +2598,7 @@ void lcd_quick_feedback(const bool clear_buttons) { // // Preheat for Material 1 and 2 // - #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || HAS_HEATED_BED + #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || TEMP_SENSOR_BED != 0 MENU_ITEM(submenu, MSG_PREHEAT_1, lcd_preheat_m1_menu); MENU_ITEM(submenu, MSG_PREHEAT_2, lcd_preheat_m2_menu); #else @@ -2765,15 +2606,15 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only); #endif - #endif // HAS_TEMP_HOTEND + #endif // TEMP_SENSOR_0 != 0 // // BLTouch Self-Test and Reset // #if ENABLED(BLTOUCH) - MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); + MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_ENDSTOP_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); if (!endstops.z_probe_enabled && TEST_BLTOUCH()) - MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); + MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_ENDSTOP_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); #endif // @@ -2805,22 +2646,29 @@ void lcd_quick_feedback(const bool clear_buttons) { float move_menu_scale; - #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) + #if ENABLED(DELTA_CALIBRATION_MENU) || (ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE) void lcd_move_z(); void _man_probe_pt(const float &rx, const float &ry) { - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - do_blocking_move_to_xy(rx, ry); + #if HAS_LEVELING + reset_bed_level(); // After calibration bed-level data is no longer valid + #endif + + line_to_z((Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5); + current_position[X_AXIS] = rx; + current_position[Y_AXIS] = ry; + line_to_current_z(); + line_to_z(Z_CLEARANCE_BETWEEN_PROBES); lcd_synchronize(); - move_menu_scale = MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT)); + move_menu_scale = PROBE_MANUALLY_STEP; lcd_goto_screen(lcd_move_z); } - #endif // DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION + #endif // DELTA_CALIBRATION_MENU || (DELTA_AUTO_CALIBRATION && !HAS_BED_PROBE) - #if ENABLED(DELTA_AUTO_CALIBRATION) + #if ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE float lcd_probe_pt(const float &rx, const float &ry) { _man_probe_pt(rx, ry); @@ -2833,18 +2681,22 @@ void lcd_quick_feedback(const bool clear_buttons) { return current_position[Z_AXIS]; } - #endif // DELTA_AUTO_CALIBRATION + #endif // DELTA_AUTO_CALIBRATION && !HAS_BED_PROBE #if ENABLED(DELTA_CALIBRATION_MENU) void _lcd_calibrate_homing() { if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_HOMING)); lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - if (all_axes_homed()) + if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) lcd_goto_previous_menu(); } void _lcd_delta_calibrate_home() { + #if HAS_LEVELING + reset_bed_level(); // After calibration bed-level data is no longer valid + #endif + enqueue_and_echo_commands_P(PSTR("G28")); lcd_goto_screen(_lcd_calibrate_homing); } @@ -2858,25 +2710,18 @@ void lcd_quick_feedback(const bool clear_buttons) { #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) - void _recalc_delta_settings() { - #if HAS_LEVELING - reset_bed_level(); // After changing kinematics bed-level data is no longer valid - #endif - recalc_delta_settings(); - } - void lcd_delta_settings() { START_MENU(); MENU_BACK(MSG_DELTA_CALIBRATE); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ex", &delta_endstop_adj[A_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ey", &delta_endstop_adj[B_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ez", &delta_endstop_adj[C_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Tx", &delta_tower_angle_trim[A_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ty", &delta_tower_angle_trim[B_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Tz", &delta_tower_angle_trim[C_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5, delta_diagonal_rod + 5, _recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5.0, delta_diagonal_rod + 5.0, recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10.0, delta_height + 10.0, recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float43, "Ex", &delta_endstop_adj[A_AXIS], -5.0, 5.0, recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float43, "Ey", &delta_endstop_adj[B_AXIS], -5.0, 5.0, recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float43, "Ez", &delta_endstop_adj[C_AXIS], -5.0, 5.0, recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5.0, delta_radius + 5.0, recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float43, "Tx", &delta_tower_angle_trim[A_AXIS], -5.0, 5.0, recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float43, "Ty", &delta_tower_angle_trim[B_AXIS], -5.0, 5.0, recalc_delta_settings); + MENU_ITEM_EDIT_CALLBACK(float43, "Tz", &delta_tower_angle_trim[C_AXIS], -5.0, 5.0, recalc_delta_settings); END_MENU(); } @@ -2886,7 +2731,6 @@ void lcd_quick_feedback(const bool clear_buttons) { #if ENABLED(DELTA_AUTO_CALIBRATION) MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33")); MENU_ITEM(gcode, MSG_DELTA_HEIGHT_CALIBRATE, PSTR("G33 P1")); - MENU_ITEM(gcode, MSG_DELTA_Z_OFFSET_CALIBRATE, PSTR("G33 P-1")); #if ENABLED(EEPROM_SETTINGS) MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); @@ -2895,7 +2739,7 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_ITEM(submenu, MSG_DELTA_SETTINGS, lcd_delta_settings); #if ENABLED(DELTA_CALIBRATION_MENU) MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home); - if (all_axes_homed()) { + if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) { MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_X, _goto_tower_x); MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Y, _goto_tower_y); MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Z, _goto_tower_z); @@ -2924,7 +2768,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #if EXTRUDERS > 1 const int8_t old_extruder = active_extruder; - if (manual_move_axis == E_AXIS) active_extruder = manual_move_e_index; + active_extruder = manual_move_e_index; #endif // Set movement on a single axis @@ -2932,13 +2776,10 @@ void lcd_quick_feedback(const bool clear_buttons) { destination[manual_move_axis] += manual_move_offset; // Reset for the next move - manual_move_offset = 0; + manual_move_offset = 0.0; manual_move_axis = (int8_t)NO_AXIS; - // DELTA and SCARA machines use segmented moves, which could fill the planner during the call to - // move_to_destination. This will cause idle() to be called, which can then call this function while the - // previous invocation is being blocked. Modifications to manual_move_offset shouldn't be made while - // processing_manual_move is true or the planner will get out of sync. + // Set a blocking flag so no new moves can be added until all segments are done processing_manual_move = true; prepare_move_to_destination(); // will call set_current_from_destination() processing_manual_move = false; @@ -2950,7 +2791,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #else - planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_axis == E_AXIS ? manual_move_e_index : active_extruder); + planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_e_index); manual_move_axis = (int8_t)NO_AXIS; #endif @@ -2963,7 +2804,7 @@ void lcd_quick_feedback(const bool clear_buttons) { */ inline void manual_move_to_current(AxisEnum axis #if E_MANUAL > 1 - , const int8_t eindex=-1 + , int8_t eindex=-1 #endif ) { #if ENABLED(DUAL_X_CARRIAGE) || E_MANUAL > 1 @@ -2972,7 +2813,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif manual_move_e_index = eindex >= 0 ? eindex : active_extruder; #endif - manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves + manual_move_start_time = millis() + (move_menu_scale < 0.99 ? 0UL : 250UL); // delay for bigger moves manual_move_axis = (int8_t)axis; } @@ -2983,9 +2824,10 @@ void lcd_quick_feedback(const bool clear_buttons) { */ void _lcd_move_xyz(const char* name, AxisEnum axis) { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } + if (lcd_clicked) { return lcd_goto_previous_menu(); } ENCODER_DIRECTION_NORMAL(); if (encoderPosition && !processing_manual_move) { + refresh_cmd_timeout(); // Start with no limits to movement float min = current_position[axis] - 1000, @@ -3034,29 +2876,29 @@ void lcd_quick_feedback(const bool clear_buttons) { const float diff = float((int32_t)encoderPosition) * move_menu_scale; #if IS_KINEMATIC manual_move_offset += diff; - if ((int32_t)encoderPosition < 0) - NOLESS(manual_move_offset, min - current_position[axis]); - else - NOMORE(manual_move_offset, max - current_position[axis]); + // Limit only when trying to move towards the limit + if ((int32_t)encoderPosition < 0) NOLESS(manual_move_offset, min - current_position[axis]); + if ((int32_t)encoderPosition > 0) NOMORE(manual_move_offset, max - current_position[axis]); #else current_position[axis] += diff; - if ((int32_t)encoderPosition < 0) - NOLESS(current_position[axis], min); - else - NOMORE(current_position[axis], max); + // Limit only when trying to move towards the limit + if ((int32_t)encoderPosition < 0) NOLESS(current_position[axis], min); + if ((int32_t)encoderPosition > 0) NOMORE(current_position[axis], max); #endif + encoderPosition = 0; + manual_move_to_current(axis); + lcdDrawUpdate = LCDVIEW_REDRAW_NOW; } - encoderPosition = 0; if (lcdDrawUpdate) { - const float pos = NATIVE_TO_LOGICAL(processing_manual_move ? destination[axis] : current_position[axis] + const float pos = current_position[axis] #if IS_KINEMATIC + manual_move_offset #endif - , axis); - lcd_implementation_drawedit(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos)); + ; + lcd_implementation_drawedit(name, move_menu_scale >= 0.1 ? ftostr41sign(pos) : ftostr43sign(pos)); } } void lcd_move_x() { _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS); } @@ -3064,10 +2906,10 @@ void lcd_quick_feedback(const bool clear_buttons) { void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS); } void _lcd_move_e( #if E_MANUAL > 1 - const int8_t eindex=-1 + int8_t eindex=-1 #endif ) { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } + if (lcd_clicked) { return lcd_goto_previous_menu(); } ENCODER_DIRECTION_NORMAL(); if (encoderPosition) { if (!processing_manual_move) { @@ -3075,7 +2917,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #if IS_KINEMATIC manual_move_offset += diff; #else - current_position[E_CART] += diff; + current_position[E_AXIS] += diff; #endif manual_move_to_current(E_AXIS #if E_MANUAL > 1 @@ -3086,7 +2928,7 @@ void lcd_quick_feedback(const bool clear_buttons) { } encoderPosition = 0; } - if (lcdDrawUpdate) { + if (lcdDrawUpdate && !processing_manual_move) { PGM_P pos_label; #if E_MANUAL == 1 pos_label = PSTR(MSG_MOVE_E); @@ -3105,7 +2947,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif // E_MANUAL > 2 } #endif // E_MANUAL > 1 - lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_CART] + lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS] #if IS_KINEMATIC + manual_move_offset #endif @@ -3141,15 +2983,15 @@ void lcd_quick_feedback(const bool clear_buttons) { move_menu_scale = scale; lcd_goto_screen(_manual_move_func_ptr); } - void lcd_move_menu_10mm() { _goto_manual_move(10); } - void lcd_move_menu_1mm() { _goto_manual_move( 1); } - void lcd_move_menu_01mm() { _goto_manual_move( 0.1f); } + void lcd_move_menu_10mm() { _goto_manual_move(10.0); } + void lcd_move_menu_1mm() { _goto_manual_move( 1.0); } + void lcd_move_menu_01mm() { _goto_manual_move( 0.1); } void _lcd_move_distance_menu(const AxisEnum axis, const screenFunc_t func) { _manual_move_func_ptr = func; START_MENU(); if (LCD_HEIGHT >= 4) { - switch (axis) { + switch(axis) { case X_AXIS: STATIC_ITEM(MSG_MOVE_X, true, true); break; case Y_AXIS: @@ -3191,7 +3033,7 @@ void lcd_quick_feedback(const bool clear_buttons) { */ #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING) - #define _MOVE_XYZ_ALLOWED (all_axes_homed()) + #define _MOVE_XYZ_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) #else #define _MOVE_XYZ_ALLOWED true #endif @@ -3210,10 +3052,6 @@ void lcd_quick_feedback(const bool clear_buttons) { START_MENU(); MENU_BACK(MSG_PREPARE); - #if HAS_SOFTWARE_ENDSTOPS && ENABLED(SOFT_ENDSTOPS_MENU_ITEM) - MENU_ITEM_EDIT(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstops_enabled); - #endif - if (_MOVE_XYZ_ALLOWED) { if (_MOVE_XY_ALLOWED) { MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_get_x_amount); @@ -3229,68 +3067,27 @@ void lcd_quick_feedback(const bool clear_buttons) { else MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); - #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE) - - #if EXTRUDERS == 4 - switch (active_extruder) { - case 0: MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); break; - case 1: MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); break; - case 2: MENU_ITEM(gcode, MSG_SELECT " " MSG_E4, PSTR("T3")); break; - case 3: MENU_ITEM(gcode, MSG_SELECT " " MSG_E3, PSTR("T2")); break; - } - #elif EXTRUDERS == 3 - if (active_extruder < 2) { - if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); - else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); - } - #else - if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); - else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); - #endif - - #elif ENABLED(DUAL_X_CARRIAGE) - + #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(DUAL_X_CARRIAGE) if (active_extruder) MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); else MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); - #endif - #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE) - - // Only the current... - MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount); - // ...and the non-switching - #if E_MANUAL == 5 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount); - #elif E_MANUAL == 3 + MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount); + #if E_MANUAL > 1 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_get_e0_amount); + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_get_e1_amount); + #if E_MANUAL > 2 MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount); - #endif - - #else - - // Independent extruders with one E-stepper per hotend - MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount); - #if E_MANUAL > 1 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_get_e0_amount); - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_get_e1_amount); - #if E_MANUAL > 2 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount); - #if E_MANUAL > 3 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_get_e3_amount); - #if E_MANUAL > 4 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount); - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - #endif // E_MANUAL > 1 - - #endif + #if E_MANUAL > 3 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_get_e3_amount); + #if E_MANUAL > 4 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount); + #endif // E_MANUAL > 4 + #endif // E_MANUAL > 3 + #endif // E_MANUAL > 2 + #endif // E_MANUAL > 1 END_MENU(); } @@ -3310,10 +3107,11 @@ void lcd_quick_feedback(const bool clear_buttons) { lcd_completion_feedback(); } - #if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) + #if ENABLED(EEPROM_SETTINGS) static void lcd_init_eeprom() { - lcd_completion_feedback(settings.init_eeprom()); + lcd_factory_settings(); + settings.save(); lcd_goto_previous_menu(); } @@ -3331,12 +3129,7 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_BACK(MSG_MAIN); MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu); MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu); - - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - MENU_ITEM(submenu, MSG_FILAMENT, lcd_control_filament_menu); - #elif ENABLED(LIN_ADVANCE) - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K, 0, 999); - #endif + MENU_ITEM(submenu, MSG_FILAMENT, lcd_control_filament_menu); #if HAS_LCD_CONTRAST MENU_ITEM_EDIT_CALLBACK(int3, MSG_CONTRAST, &lcd_contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, lcd_callback_set_contrast, true); @@ -3359,10 +3152,8 @@ void lcd_quick_feedback(const bool clear_buttons) { MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); #endif - MENU_ITEM(function, MSG_RESTORE_FAILSAFE, lcd_factory_settings); - - #if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) + #if ENABLED(EEPROM_SETTINGS) MENU_ITEM(submenu, MSG_INIT_EEPROM, lcd_init_eeprom_confirm); #endif @@ -3396,7 +3187,7 @@ void lcd_quick_feedback(const bool clear_buttons) { autotune_temp[e] #endif ); - lcd_enqueue_command(cmd); + enqueue_and_echo_command(cmd); } #endif // PID_AUTOTUNE_MENU @@ -3485,7 +3276,7 @@ void lcd_quick_feedback(const bool clear_buttons) { // // Bed: // - #if HAS_HEATED_BED + #if HAS_TEMP_BED MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); #endif @@ -3516,11 +3307,11 @@ void lcd_quick_feedback(const bool clear_buttons) { // // Autotemp, Min, Max, Fact // - #if ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND + #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, float(HEATER_0_MAXTEMP) - 15); - MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, float(HEATER_0_MAXTEMP) - 15); - MENU_ITEM_EDIT(float52, MSG_FACTOR, &planner.autotemp_factor, 0, 1); + 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 // @@ -3536,9 +3327,9 @@ void lcd_quick_feedback(const bool clear_buttons) { #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(float52sign, MSG_PID_P ELABEL, &PID_PARAM(Kp, eindex), 1, 9990); \ - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_I ELABEL, &raw_Ki, 0.01f, 9990, copy_and_scalePID_i_E ## eindex); \ - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## 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) \ @@ -3574,232 +3365,64 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif // PIDTEMP - #if DISABLED(SLIM_LCD_MENUS) - // - // Preheat Material 1 conf - // - MENU_ITEM(submenu, MSG_PREHEAT_1_SETTINGS, lcd_control_temperature_preheat_material1_settings_menu); - - // - // Preheat Material 2 conf - // - MENU_ITEM(submenu, MSG_PREHEAT_2_SETTINGS, lcd_control_temperature_preheat_material2_settings_menu); - #endif + // + // Preheat Material 1 conf + // + MENU_ITEM(submenu, MSG_PREHEAT_1_SETTINGS, lcd_control_temperature_preheat_material1_settings_menu); + // + // Preheat Material 2 conf + // + MENU_ITEM(submenu, MSG_PREHEAT_2_SETTINGS, lcd_control_temperature_preheat_material2_settings_menu); END_MENU(); } - #if DISABLED(SLIM_LCD_MENUS) - - void _lcd_control_temperature_preheat_settings_menu(const uint8_t material) { - #if HOTENDS > 4 - #define MINTEMP_ALL MIN5(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP, HEATER_4_MINTEMP) - #define MAXTEMP_ALL MAX5(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP) - #elif HOTENDS > 3 - #define MINTEMP_ALL MIN4(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP) - #define MAXTEMP_ALL MAX4(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP) - #elif HOTENDS > 2 - #define MINTEMP_ALL MIN3(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP) - #define MAXTEMP_ALL MAX3(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP) - #elif HOTENDS > 1 - #define MINTEMP_ALL MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP) - #define MAXTEMP_ALL MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP) - #else - #define MINTEMP_ALL HEATER_0_MINTEMP - #define MAXTEMP_ALL HEATER_0_MAXTEMP - #endif - START_MENU(); - MENU_BACK(MSG_TEMPERATURE); - MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &lcd_preheat_fan_speed[material], 0, 255); - #if HAS_TEMP_HOTEND - MENU_ITEM_EDIT(int3, MSG_NOZZLE, &lcd_preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15); - #endif - #if HAS_HEATED_BED - MENU_ITEM_EDIT(int3, MSG_BED, &lcd_preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 15); - #endif - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - #endif - END_MENU(); - } - - /** - * - * "Temperature" > "Preheat Material 1 conf" submenu - * - */ - void lcd_control_temperature_preheat_material1_settings_menu() { _lcd_control_temperature_preheat_settings_menu(0); } - - /** - * - * "Temperature" > "Preheat Material 2 conf" submenu - * - */ - void lcd_control_temperature_preheat_material2_settings_menu() { _lcd_control_temperature_preheat_settings_menu(1); } - - void _reset_acceleration_rates() { planner.reset_acceleration_rates(); } - #if ENABLED(DISTINCT_E_FACTORS) - void _reset_e_acceleration_rate(const uint8_t e) { if (e == active_extruder) _reset_acceleration_rates(); } - void _reset_e0_acceleration_rate() { _reset_e_acceleration_rate(0); } - void _reset_e1_acceleration_rate() { _reset_e_acceleration_rate(1); } - #if E_STEPPERS > 2 - void _reset_e2_acceleration_rate() { _reset_e_acceleration_rate(2); } - #if E_STEPPERS > 3 - void _reset_e3_acceleration_rate() { _reset_e_acceleration_rate(3); } - #if E_STEPPERS > 4 - void _reset_e4_acceleration_rate() { _reset_e_acceleration_rate(4); } - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 + void _lcd_control_temperature_preheat_settings_menu(uint8_t material) { + #if HOTENDS > 4 + #define MINTEMP_ALL MIN5(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP, HEATER_4_MINTEMP) + #define MAXTEMP_ALL MAX5(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP) + #elif HOTENDS > 3 + #define MINTEMP_ALL MIN4(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP) + #define MAXTEMP_ALL MAX4(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP) + #elif HOTENDS > 2 + #define MINTEMP_ALL MIN3(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP) + #define MAXTEMP_ALL MAX3(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP) + #elif HOTENDS > 1 + #define MINTEMP_ALL min(HEATER_0_MINTEMP, HEATER_1_MINTEMP) + #define MAXTEMP_ALL max(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP) + #else + #define MINTEMP_ALL HEATER_0_MINTEMP + #define MAXTEMP_ALL HEATER_0_MAXTEMP #endif - - void _planner_refresh_positioning() { planner.refresh_positioning(); } - #if ENABLED(DISTINCT_E_FACTORS) - void _planner_refresh_e_positioning(const uint8_t e) { - if (e == active_extruder) - _planner_refresh_positioning(); - else - planner.steps_to_mm[E_AXIS + e] = 1.0f / planner.axis_steps_per_mm[E_AXIS + e]; - } - void _planner_refresh_e0_positioning() { _planner_refresh_e_positioning(0); } - void _planner_refresh_e1_positioning() { _planner_refresh_e_positioning(1); } - #if E_STEPPERS > 2 - void _planner_refresh_e2_positioning() { _planner_refresh_e_positioning(2); } - #if E_STEPPERS > 3 - void _planner_refresh_e3_positioning() { _planner_refresh_e_positioning(3); } - #if E_STEPPERS > 4 - void _planner_refresh_e4_positioning() { _planner_refresh_e_positioning(4); } - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 + START_MENU(); + MENU_BACK(MSG_TEMPERATURE); + MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &lcd_preheat_fan_speed[material], 0, 255); + #if TEMP_SENSOR_0 != 0 + MENU_ITEM_EDIT(int3, MSG_NOZZLE, &lcd_preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15); #endif + #if TEMP_SENSOR_BED != 0 + MENU_ITEM_EDIT(int3, MSG_BED, &lcd_preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 15); + #endif + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); + #endif + END_MENU(); + } - // M203 / M205 Velocity options - void lcd_control_motion_velocity_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); + /** + * + * "Temperature" > "Preheat Material 1 conf" submenu + * + */ + void lcd_control_temperature_preheat_material1_settings_menu() { _lcd_control_temperature_preheat_settings_menu(0); } - // M203 Max Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_A, &planner.max_feedrate_mm_s[A_AXIS], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_B, &planner.max_feedrate_mm_s[B_AXIS], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_C, &planner.max_feedrate_mm_s[C_AXIS], 1, 999); + /** + * + * "Temperature" > "Preheat Material 2 conf" submenu + * + */ + void lcd_control_temperature_preheat_material2_settings_menu() { _lcd_control_temperature_preheat_settings_menu(1); } - #if ENABLED(DISTINCT_E_FACTORS) - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS + active_extruder], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E1, &planner.max_feedrate_mm_s[E_AXIS], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E2, &planner.max_feedrate_mm_s[E_AXIS + 1], 1, 999); - #if E_STEPPERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E3, &planner.max_feedrate_mm_s[E_AXIS + 2], 1, 999); - #if E_STEPPERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E4, &planner.max_feedrate_mm_s[E_AXIS + 3], 1, 999); - #if E_STEPPERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E5, &planner.max_feedrate_mm_s[E_AXIS + 4], 1, 999); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #else - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS], 1, 999); - #endif - - // M205 S Min Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate_mm_s, 0, 999); - - // M205 T Min Travel Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate_mm_s, 0, 999); - - END_MENU(); - } - - // M201 / M204 Accelerations - void lcd_control_motion_acceleration_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); - - // M204 P Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_ACC, &planner.acceleration, 10, 99000); - - // M204 R Retract Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.retract_acceleration, 100, 99000); - - // M204 T Travel Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.travel_acceleration, 100, 99000); - - // M201 settings - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_A, &planner.max_acceleration_mm_per_s2[A_AXIS], 100, 99000, _reset_acceleration_rates); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_B, &planner.max_acceleration_mm_per_s2[B_AXIS], 100, 99000, _reset_acceleration_rates); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_C, &planner.max_acceleration_mm_per_s2[C_AXIS], 10, 99000, _reset_acceleration_rates); - - #if ENABLED(DISTINCT_E_FACTORS) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS + active_extruder], 100, 99000, _reset_acceleration_rates); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E1, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_e0_acceleration_rate); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E2, &planner.max_acceleration_mm_per_s2[E_AXIS + 1], 100, 99000, _reset_e1_acceleration_rate); - #if E_STEPPERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E3, &planner.max_acceleration_mm_per_s2[E_AXIS + 2], 100, 99000, _reset_e2_acceleration_rate); - #if E_STEPPERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E4, &planner.max_acceleration_mm_per_s2[E_AXIS + 3], 100, 99000, _reset_e3_acceleration_rate); - #if E_STEPPERS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E5, &planner.max_acceleration_mm_per_s2[E_AXIS + 4], 100, 99000, _reset_e4_acceleration_rate); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #else - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates); - #endif - - END_MENU(); - } - - // M205 Jerk - void lcd_control_motion_jerk_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); - - #if ENABLED(JUNCTION_DEVIATION) - MENU_ITEM_EDIT_CALLBACK(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.01f, 0.3f, planner.recalculate_max_e_jerk); - #else - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VA_JERK, &planner.max_jerk[A_AXIS], 1, 990); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VB_JERK, &planner.max_jerk[B_AXIS], 1, 990); - #if ENABLED(DELTA) - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 1, 990); - #else - MENU_MULTIPLIER_ITEM_EDIT(float52sign, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 0.1f, 990); - #endif - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_jerk[E_AXIS], 1, 990); - #endif - - END_MENU(); - } - - // M92 Steps-per-mm - void lcd_control_motion_steps_per_mm_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); - - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ASTEPS, &planner.axis_steps_per_mm[A_AXIS], 5, 9999, _planner_refresh_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_BSTEPS, &planner.axis_steps_per_mm[B_AXIS], 5, 9999, _planner_refresh_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_CSTEPS, &planner.axis_steps_per_mm[C_AXIS], 5, 9999, _planner_refresh_positioning); - - #if ENABLED(DISTINCT_E_FACTORS) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS + active_extruder], 5, 9999, _planner_refresh_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E1STEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_e0_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E2STEPS, &planner.axis_steps_per_mm[E_AXIS + 1], 5, 9999, _planner_refresh_e1_positioning); - #if E_STEPPERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E3STEPS, &planner.axis_steps_per_mm[E_AXIS + 2], 5, 9999, _planner_refresh_e2_positioning); - #if E_STEPPERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E4STEPS, &planner.axis_steps_per_mm[E_AXIS + 3], 5, 9999, _planner_refresh_e3_positioning); - #if E_STEPPERS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E5STEPS, &planner.axis_steps_per_mm[E_AXIS + 4], 5, 9999, _planner_refresh_e4_positioning); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #else - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning); - #endif - - END_MENU(); - } - - #endif // !SLIM_LCD_MENUS /** * @@ -3807,6 +3430,164 @@ void lcd_quick_feedback(const bool clear_buttons) { * */ + void _reset_acceleration_rates() { planner.reset_acceleration_rates(); } + #if ENABLED(DISTINCT_E_FACTORS) + void _reset_e_acceleration_rate(const uint8_t e) { if (e == active_extruder) _reset_acceleration_rates(); } + void _reset_e0_acceleration_rate() { _reset_e_acceleration_rate(0); } + void _reset_e1_acceleration_rate() { _reset_e_acceleration_rate(1); } + #if E_STEPPERS > 2 + void _reset_e2_acceleration_rate() { _reset_e_acceleration_rate(2); } + #if E_STEPPERS > 3 + void _reset_e3_acceleration_rate() { _reset_e_acceleration_rate(3); } + #if E_STEPPERS > 4 + void _reset_e4_acceleration_rate() { _reset_e_acceleration_rate(4); } + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #endif + + void _planner_refresh_positioning() { planner.refresh_positioning(); } + #if ENABLED(DISTINCT_E_FACTORS) + void _planner_refresh_e_positioning(const uint8_t e) { + if (e == active_extruder) + _planner_refresh_positioning(); + else + planner.steps_to_mm[E_AXIS + e] = 1.0 / planner.axis_steps_per_mm[E_AXIS + e]; + } + void _planner_refresh_e0_positioning() { _planner_refresh_e_positioning(0); } + void _planner_refresh_e1_positioning() { _planner_refresh_e_positioning(1); } + #if E_STEPPERS > 2 + void _planner_refresh_e2_positioning() { _planner_refresh_e_positioning(2); } + #if E_STEPPERS > 3 + void _planner_refresh_e3_positioning() { _planner_refresh_e_positioning(3); } + #if E_STEPPERS > 4 + void _planner_refresh_e4_positioning() { _planner_refresh_e_positioning(4); } + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #endif + + // M203 / M205 Velocity options + void lcd_control_motion_velocity_menu() { + START_MENU(); + MENU_BACK(MSG_MOTION); + + // M203 Max Feedrate + 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); + + #if ENABLED(DISTINCT_E_FACTORS) + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS + active_extruder], 1, 999); + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E1, &planner.max_feedrate_mm_s[E_AXIS], 1, 999); + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E2, &planner.max_feedrate_mm_s[E_AXIS + 1], 1, 999); + #if E_STEPPERS > 2 + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E3, &planner.max_feedrate_mm_s[E_AXIS + 2], 1, 999); + #if E_STEPPERS > 3 + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E4, &planner.max_feedrate_mm_s[E_AXIS + 3], 1, 999); + #if E_STEPPERS > 4 + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E5, &planner.max_feedrate_mm_s[E_AXIS + 4], 1, 999); + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #else + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS], 1, 999); + #endif + + // M205 S Min Feedrate + MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate_mm_s, 0, 999); + + // M205 T Min Travel Feedrate + MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate_mm_s, 0, 999); + + END_MENU(); + } + + // M201 / M204 Accelerations + void lcd_control_motion_acceleration_menu() { + START_MENU(); + MENU_BACK(MSG_MOTION); + + // M204 P Acceleration + MENU_ITEM_EDIT(float5, MSG_ACC, &planner.acceleration, 10, 99000); + + // M204 R Retract Acceleration + MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.retract_acceleration, 100, 99000); + + // M204 T Travel Acceleration + MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.travel_acceleration, 100, 99000); + + // M201 settings + 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); + + #if ENABLED(DISTINCT_E_FACTORS) + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS + active_extruder], 100, 99000, _reset_acceleration_rates); + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E1, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_e0_acceleration_rate); + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E2, &planner.max_acceleration_mm_per_s2[E_AXIS + 1], 100, 99000, _reset_e1_acceleration_rate); + #if E_STEPPERS > 2 + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E3, &planner.max_acceleration_mm_per_s2[E_AXIS + 2], 100, 99000, _reset_e2_acceleration_rate); + #if E_STEPPERS > 3 + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E4, &planner.max_acceleration_mm_per_s2[E_AXIS + 3], 100, 99000, _reset_e3_acceleration_rate); + #if E_STEPPERS > 4 + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E5, &planner.max_acceleration_mm_per_s2[E_AXIS + 4], 100, 99000, _reset_e4_acceleration_rate); + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #else + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates); + #endif + + END_MENU(); + } + + // M205 Jerk + void lcd_control_motion_jerk_menu() { + START_MENU(); + MENU_BACK(MSG_MOTION); + + MENU_ITEM_EDIT(float3, MSG_VX_JERK, &planner.max_jerk[X_AXIS], 1, 990); + MENU_ITEM_EDIT(float3, MSG_VY_JERK, &planner.max_jerk[Y_AXIS], 1, 990); + #if ENABLED(DELTA) + MENU_ITEM_EDIT(float3, MSG_VZ_JERK, &planner.max_jerk[Z_AXIS], 1, 990); + #else + MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &planner.max_jerk[Z_AXIS], 0.1, 990); + #endif + MENU_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_jerk[E_AXIS], 1, 990); + + END_MENU(); + } + + // M92 Steps-per-mm + void lcd_control_motion_steps_per_mm_menu() { + START_MENU(); + MENU_BACK(MSG_MOTION); + + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_XSTEPS, &planner.axis_steps_per_mm[X_AXIS], 5, 9999, _planner_refresh_positioning); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_YSTEPS, &planner.axis_steps_per_mm[Y_AXIS], 5, 9999, _planner_refresh_positioning); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999, _planner_refresh_positioning); + + #if ENABLED(DISTINCT_E_FACTORS) + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS + active_extruder], 5, 9999, _planner_refresh_positioning); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E1STEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_e0_positioning); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E2STEPS, &planner.axis_steps_per_mm[E_AXIS + 1], 5, 9999, _planner_refresh_e1_positioning); + #if E_STEPPERS > 2 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E3STEPS, &planner.axis_steps_per_mm[E_AXIS + 2], 5, 9999, _planner_refresh_e2_positioning); + #if E_STEPPERS > 3 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E4STEPS, &planner.axis_steps_per_mm[E_AXIS + 3], 5, 9999, _planner_refresh_e3_positioning); + #if E_STEPPERS > 4 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E5STEPS, &planner.axis_steps_per_mm[E_AXIS + 4], 5, 9999, _planner_refresh_e4_positioning); + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #else + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning); + #endif + + END_MENU(); + } + void lcd_control_motion_menu() { START_MENU(); MENU_BACK(MSG_CONTROL); @@ -3814,117 +3595,65 @@ void lcd_quick_feedback(const bool clear_buttons) { #if ENABLED(BABYSTEP_ZPROBE_OFFSET) MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); #elif HAS_BED_PROBE - MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #endif - #if DISABLED(SLIM_LCD_MENUS) + // M203 / M205 - Feedrate items + MENU_ITEM(submenu, MSG_VELOCITY, lcd_control_motion_velocity_menu); - // M203 / M205 - Feedrate items - MENU_ITEM(submenu, MSG_VELOCITY, lcd_control_motion_velocity_menu); + // M201 - Acceleration items + MENU_ITEM(submenu, MSG_ACCELERATION, lcd_control_motion_acceleration_menu); - // M201 - Acceleration items - MENU_ITEM(submenu, MSG_ACCELERATION, lcd_control_motion_acceleration_menu); + // M205 - Max Jerk + MENU_ITEM(submenu, MSG_JERK, lcd_control_motion_jerk_menu); - // M205 - Max Jerk - MENU_ITEM(submenu, MSG_JERK, lcd_control_motion_jerk_menu); - - // M92 - Steps Per mm - MENU_ITEM(submenu, MSG_STEPS_PER_MM, lcd_control_motion_steps_per_mm_menu); - - #endif // !SLIM_LCD_MENUS + // M92 - Steps Per mm + MENU_ITEM(submenu, MSG_STEPS_PER_MM, lcd_control_motion_steps_per_mm_menu); // M540 S - Abort on endstop hit when SD printing #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &planner.abort_on_endstop_hit); + MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &stepper.abort_on_endstop_hit); #endif END_MENU(); } - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - /** - * - * "Control" > "Filament" submenu - * - */ - void lcd_control_filament_menu() { - START_MENU(); - MENU_BACK(MSG_CONTROL); + /** + * + * "Control" > "Filament" submenu + * + */ + void lcd_control_filament_menu() { + START_MENU(); + MENU_BACK(MSG_CONTROL); - #if ENABLED(LIN_ADVANCE) - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K, 0, 999); - #endif + #if ENABLED(LIN_ADVANCE) + MENU_ITEM_EDIT(float3, MSG_ADVANCE_K, &planner.extruder_advance_k, 0, 999); + #endif - #if DISABLED(NO_VOLUMETRICS) - MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &parser.volumetric_enabled, planner.calculate_volumetric_multipliers); + MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &parser.volumetric_enabled, planner.calculate_volumetric_multipliers); - if (parser.volumetric_enabled) { - #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &planner.filament_size[1], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &planner.filament_size[2], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &planner.filament_size[3], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E5, &planner.filament_size[4], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - } - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - const float extrude_maxlength = - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - EXTRUDE_MAXLENGTH - #else - 999 - #endif - ; - - #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &filament_change_unload_length[0], 0, extrude_maxlength); - #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &filament_change_unload_length[active_extruder], 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E1, &filament_change_unload_length[0], 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E2, &filament_change_unload_length[1], 0, extrude_maxlength); - #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E3, &filament_change_unload_length[2], 0, extrude_maxlength); + if (parser.volumetric_enabled) { + #if EXTRUDERS == 1 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5, 3.25, planner.calculate_volumetric_multipliers); + #else // EXTRUDERS > 1 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5, 3.25, planner.calculate_volumetric_multipliers); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &planner.filament_size[0], 1.5, 3.25, planner.calculate_volumetric_multipliers); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &planner.filament_size[1], 1.5, 3.25, planner.calculate_volumetric_multipliers); + #if EXTRUDERS > 2 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &planner.filament_size[2], 1.5, 3.25, planner.calculate_volumetric_multipliers); #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E4, &filament_change_unload_length[3], 0, extrude_maxlength); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &planner.filament_size[3], 1.5, 3.25, planner.calculate_volumetric_multipliers); #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E5, &filament_change_unload_length[4], 0, extrude_maxlength); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &filament_change_load_length[0], 0, extrude_maxlength); - #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &filament_change_load_length[active_extruder], 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E1, &filament_change_load_length[0], 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E2, &filament_change_load_length[1], 0, extrude_maxlength); - #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E3, &filament_change_load_length[2], 0, extrude_maxlength); - #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E4, &filament_change_load_length[3], 0, extrude_maxlength); - #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E5, &filament_change_load_length[4], 0, extrude_maxlength); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - #endif - - END_MENU(); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E5, &planner.filament_size[4], 1.5, 3.25, planner.calculate_volumetric_multipliers); + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 + #endif // EXTRUDERS > 1 } - #endif // !NO_VOLUMETRICS || ADVANCED_PAUSE_FEATURE + + END_MENU(); + } /** * @@ -3936,20 +3665,20 @@ void lcd_quick_feedback(const bool clear_buttons) { void lcd_control_retract_menu() { START_MENU(); MENU_BACK(MSG_CONTROL); - MENU_ITEM_EDIT_CALLBACK(bool, MSG_AUTORETRACT, &fwretract.autoretract_enabled, fwretract.refresh_autoretract); - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT, &fwretract.retract_length, 0, 100); + 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(float52sign, MSG_CONTROL_RETRACT_SWAP, &fwretract.swap_retract_length, 0, 100); + MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_SWAP, &swap_retract_length, 0, 100); #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &fwretract.retract_feedrate_mm_s, 1, 999); - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_ZLIFT, &fwretract.retract_zlift, 0, 999); - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER, &fwretract.retract_recover_length, -100, 100); + 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, -100, 100); #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER_SWAP, &fwretract.swap_retract_recover_length, -100, 100); + MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &swap_retract_recover_length, -100, 100); #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &fwretract.retract_recover_feedrate_mm_s, 1, 999); + MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate_mm_s, 1, 999); #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVER_SWAPF, &fwretract.swap_retract_recover_feedrate_mm_s, 1, 999); + MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVER_SWAPF, &swap_retract_recover_feedrate_mm_s, 1, 999); #endif END_MENU(); } @@ -3969,7 +3698,7 @@ void lcd_quick_feedback(const bool clear_buttons) { encoderPosition = card.updir() ? ENCODER_STEPS_PER_MENU_ITEM : 0; encoderTopLine = 0; screen_changed = true; - lcd_refresh(); + lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; } /** @@ -4036,9 +3765,9 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif if (card.filenameIsDir) - MENU_ITEM(sddirectory, MSG_CARD_MENU, card); + MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename); else - MENU_ITEM(sdfile, MSG_CARD_MENU, card); + MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename); } else { MENU_ITEM_DUMMY(); @@ -4058,7 +3787,7 @@ void lcd_quick_feedback(const bool clear_buttons) { * */ void lcd_info_stats_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } + if (lcd_clicked) { return lcd_goto_previous_menu(); } char buffer[21]; printStatistics stats = print_job_timer.getStats(); @@ -4092,7 +3821,7 @@ void lcd_quick_feedback(const bool clear_buttons) { * */ void lcd_info_thermistors_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } + if (lcd_clicked) { return lcd_goto_previous_menu(); } START_SCREEN(); #define THERMISTOR_ID TEMP_SENSOR_0 #include "thermistornames.h" @@ -4136,7 +3865,7 @@ void lcd_quick_feedback(const bool clear_buttons) { STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_4_MAXTEMP), false); #endif - #if HAS_HEATED_BED + #if TEMP_SENSOR_BED != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_BED #include "thermistornames.h" @@ -4153,7 +3882,7 @@ void lcd_quick_feedback(const bool clear_buttons) { * */ void lcd_info_board_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } + if (lcd_clicked) { return lcd_goto_previous_menu(); } START_SCREEN(); STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000 @@ -4174,7 +3903,7 @@ void lcd_quick_feedback(const bool clear_buttons) { * */ void lcd_info_printer_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } + if (lcd_clicked) { return lcd_goto_previous_menu(); } START_SCREEN(); STATIC_ITEM(MSG_MARLIN, true, true); // Marlin STATIC_ITEM(SHORT_BUILD_VERSION, true); // x.x.x-Branch @@ -4260,8 +3989,10 @@ void lcd_quick_feedback(const bool clear_buttons) { void lcd_led_menu() { START_MENU(); MENU_BACK(MSG_MAIN); - bool led_on = leds.lights_on; - MENU_ITEM_EDIT_CALLBACK(bool, MSG_LEDS, &led_on, leds.toggle); + if (leds.lights_on) + MENU_ITEM(function, MSG_LEDS_OFF, leds.toggle); + else + MENU_ITEM(function, MSG_LEDS_ON, leds.toggle); MENU_ITEM(function, MSG_SET_LEDS_DEFAULT, leds.set_default); #if ENABLED(LED_COLOR_PRESETS) MENU_ITEM(submenu, MSG_LED_PRESETS, lcd_led_presets_menu); @@ -4279,258 +4010,12 @@ void lcd_quick_feedback(const bool clear_buttons) { */ #if ENABLED(ADVANCED_PAUSE_FEATURE) - /** - * - * "Change Filament" > "Change/Unload/Load Filament" submenu - * - */ - static AdvancedPauseMode _change_filament_temp_mode; - static int8_t _change_filament_temp_extruder; - - static const char* _change_filament_temp_command() { - switch (_change_filament_temp_mode) { - case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: - return PSTR("M701 T%d"); - case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: - return _change_filament_temp_extruder >= 0 ? PSTR("M702 T%d") : PSTR("M702 ;%d"); - case ADVANCED_PAUSE_MODE_PAUSE_PRINT: - default: - return PSTR("M600 B0 T%d"); - } - return PSTR(MSG_FILAMENTCHANGE); - } - - void _change_filament_temp(const uint8_t index) { - char cmd[11]; - sprintf_P(cmd, _change_filament_temp_command(), _change_filament_temp_extruder); - thermalManager.setTargetHotend(index == 1 ? PREHEAT_1_TEMP_HOTEND : PREHEAT_2_TEMP_HOTEND, _change_filament_temp_extruder); - lcd_enqueue_command(cmd); - } - void _lcd_change_filament_temp_1_menu() { _change_filament_temp(1); } - void _lcd_change_filament_temp_2_menu() { _change_filament_temp(2); } - - static const char* change_filament_header(const AdvancedPauseMode mode) { - switch (mode) { - case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: - return PSTR(MSG_FILAMENTLOAD); - case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: - return PSTR(MSG_FILAMENTUNLOAD); - default: break; - } - return PSTR(MSG_FILAMENTCHANGE); - } - - void _lcd_temp_menu_filament_op(const AdvancedPauseMode mode, const int8_t extruder) { - _change_filament_temp_mode = mode; - _change_filament_temp_extruder = extruder; - START_MENU(); - if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), true, true); - MENU_BACK(MSG_FILAMENTCHANGE); - MENU_ITEM(submenu, MSG_PREHEAT_1, _lcd_change_filament_temp_1_menu); - MENU_ITEM(submenu, MSG_PREHEAT_2, _lcd_change_filament_temp_2_menu); - END_MENU(); - } - void lcd_temp_menu_e0_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 0); } - void lcd_temp_menu_e0_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 0); } - void lcd_temp_menu_e0_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 0); } - #if E_STEPPERS > 1 - void lcd_temp_menu_e1_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 1); } - void lcd_temp_menu_e1_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 1); } - void lcd_temp_menu_e1_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 1); } - #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - void lcd_unload_filament_all_temp_menu() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, -1); } - #endif - #if E_STEPPERS > 2 - void lcd_temp_menu_e2_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 2); } - void lcd_temp_menu_e2_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 2); } - void lcd_temp_menu_e2_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 2); } - #if E_STEPPERS > 3 - void lcd_temp_menu_e3_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 3); } - void lcd_temp_menu_e3_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 3); } - void lcd_temp_menu_e3_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 3); } - #if E_STEPPERS > 4 - void lcd_temp_menu_e4_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 4); } - void lcd_temp_menu_e4_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 4); } - void lcd_temp_menu_e4_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 4); } - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - - /** - * - * "Change Filament" submenu - * - */ - #if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - void lcd_change_filament_menu() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - - // Change filament - #if E_STEPPERS == 1 - PGM_P msg0 = PSTR(MSG_FILAMENTCHANGE); - if (thermalManager.targetTooColdToExtrude(active_extruder)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_change); - else - MENU_ITEM_P(gcode, msg0, PSTR("M600 B0")); - #else - PGM_P msg0 = PSTR(MSG_FILAMENTCHANGE " " MSG_E1); - PGM_P msg1 = PSTR(MSG_FILAMENTCHANGE " " MSG_E2); - if (thermalManager.targetTooColdToExtrude(0)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_change); - else - MENU_ITEM_P(gcode, msg0, PSTR("M600 B0 T0")); - if (thermalManager.targetTooColdToExtrude(1)) - MENU_ITEM_P(submenu, msg1, lcd_temp_menu_e1_filament_change); - else - MENU_ITEM_P(gcode, msg1, PSTR("M600 B0 T1")); - #if E_STEPPERS > 2 - PGM_P msg2 = PSTR(MSG_FILAMENTCHANGE " " MSG_E3); - if (thermalManager.targetTooColdToExtrude(2)) - MENU_ITEM_P(submenu, msg2, lcd_temp_menu_e2_filament_change); - else - MENU_ITEM_P(gcode, msg2, PSTR("M600 B0 T2")); - #if E_STEPPERS > 3 - PGM_P msg3 = PSTR(MSG_FILAMENTCHANGE " " MSG_E4); - if (thermalManager.targetTooColdToExtrude(3)) - MENU_ITEM_P(submenu, msg3, lcd_temp_menu_e3_filament_change); - else - MENU_ITEM_P(gcode, msg3, PSTR("M600 B0 T3")); - #if E_STEPPERS > 4 - PGM_P msg4 = PSTR(MSG_FILAMENTCHANGE " " MSG_E5); - if (thermalManager.targetTooColdToExtrude(4)) - MENU_ITEM_P(submenu, msg4, lcd_temp_menu_e4_filament_change); - else - MENU_ITEM_P(gcode, msg4, PSTR("M600 B0 T4")); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 - - #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (!planner.movesplanned() && !IS_SD_FILE_OPEN()) { - // Load filament - #if E_STEPPERS == 1 - PGM_P msg0 = PSTR(MSG_FILAMENTLOAD); - if (thermalManager.targetTooColdToExtrude(active_extruder)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_load); - else - MENU_ITEM_P(gcode, msg0, PSTR("M701")); - #else - PGM_P msg0 = PSTR(MSG_FILAMENTLOAD " " MSG_E1); - PGM_P msg1 = PSTR(MSG_FILAMENTLOAD " " MSG_E2); - if (thermalManager.targetTooColdToExtrude(0)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_load); - else - MENU_ITEM_P(gcode, msg0, PSTR("M701 T0")); - if (thermalManager.targetTooColdToExtrude(1)) - MENU_ITEM_P(submenu, msg1, lcd_temp_menu_e1_filament_load); - else - MENU_ITEM_P(gcode, msg1, PSTR("M701 T1")); - #if E_STEPPERS > 2 - PGM_P msg2 = PSTR(MSG_FILAMENTLOAD " " MSG_E3); - if (thermalManager.targetTooColdToExtrude(2)) - MENU_ITEM_P(submenu, msg2, lcd_temp_menu_e2_filament_load); - else - MENU_ITEM_P(gcode, msg2, PSTR("M701 T2")); - #if E_STEPPERS > 3 - PGM_P msg3 = PSTR(MSG_FILAMENTLOAD " " MSG_E4); - if (thermalManager.targetTooColdToExtrude(3)) - MENU_ITEM_P(submenu, msg3, lcd_temp_menu_e3_filament_load); - else - MENU_ITEM_P(gcode, msg3, PSTR("M701 T3")); - #if E_STEPPERS > 4 - PGM_P msg4 = PSTR(MSG_FILAMENTLOAD " " MSG_E5); - if (thermalManager.targetTooColdToExtrude(4)) - MENU_ITEM_P(submenu, msg4, lcd_temp_menu_e4_filament_load); - else - MENU_ITEM_P(gcode, msg4, PSTR("M701 T4")); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 - - // Unload filament - #if E_STEPPERS == 1 - if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD, PSTR("M702")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD, lcd_temp_menu_e0_filament_unload); - #else - #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - if (thermalManager.targetHotEnoughToExtrude(0) - #if E_STEPPERS > 1 - && thermalManager.targetHotEnoughToExtrude(1) - #if E_STEPPERS > 2 - && thermalManager.targetHotEnoughToExtrude(2) - #if E_STEPPERS > 3 - && thermalManager.targetHotEnoughToExtrude(3) - #if E_STEPPERS > 4 - && thermalManager.targetHotEnoughToExtrude(4) - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - ) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD_ALL, PSTR("M702")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD_ALL, lcd_unload_filament_all_temp_menu); - #endif - if (thermalManager.targetHotEnoughToExtrude(0)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E1, PSTR("M702 T0")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E1, lcd_temp_menu_e0_filament_unload); - if (thermalManager.targetHotEnoughToExtrude(1)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E2, PSTR("M702 T1")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E2, lcd_temp_menu_e1_filament_unload); - #if E_STEPPERS > 2 - if (thermalManager.targetHotEnoughToExtrude(2)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E3, PSTR("M702 T2")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E3, lcd_temp_menu_e2_filament_unload); - #if E_STEPPERS > 3 - if (thermalManager.targetHotEnoughToExtrude(3)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E4, PSTR("M702 T3")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E4, lcd_temp_menu_e3_filament_unload); - #if E_STEPPERS > 4 - if (thermalManager.targetHotEnoughToExtrude(4)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E5, PSTR("M702 T4")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E5, lcd_temp_menu_e4_filament_unload); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 - } - #endif - - END_MENU(); - } - #endif - - static AdvancedPauseMode advanced_pause_mode = ADVANCED_PAUSE_MODE_PAUSE_PRINT; - static uint8_t hotend_status_extruder = 0; - - static const char* advanced_pause_header() { - switch (advanced_pause_mode) { - case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: - return PSTR(MSG_FILAMENT_CHANGE_HEADER_LOAD); - case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: - return PSTR(MSG_FILAMENT_CHANGE_HEADER_UNLOAD); - default: break; - } - return PSTR(MSG_FILAMENT_CHANGE_HEADER_PAUSE); - } - // Portions from STATIC_ITEM... #define HOTEND_STATUS_ITEM() do { \ if (_menuLineNr == _thisItemNr) { \ if (lcdDrawUpdate) { \ lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(MSG_FILAMENT_CHANGE_NOZZLE), false, true); \ - lcd_implementation_hotend_status(_lcdLineNr, hotend_status_extruder); \ + lcd_implementation_hotend_status(_lcdLineNr); \ } \ if (_skipStatic && encoderLine <= _thisItemNr) { \ encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ @@ -4541,6 +4026,18 @@ void lcd_quick_feedback(const bool clear_buttons) { ++_thisItemNr; \ }while(0) + void lcd_advanced_pause_toocold_menu() { + START_MENU(); + STATIC_ITEM(MSG_HEATING_FAILED_LCD, true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_MINTEMP STRINGIFY(EXTRUDE_MINTEMP) ".", false, false); + MENU_BACK(MSG_BACK); + #if LCD_HEIGHT > 4 + STATIC_ITEM(" "); + #endif + HOTEND_STATUS_ITEM(); + END_MENU(); + } + void lcd_advanced_pause_resume_print() { advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_RESUME_PRINT; } @@ -4555,13 +4052,13 @@ void lcd_quick_feedback(const bool clear_buttons) { STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false); #endif MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_RESUME, lcd_advanced_pause_resume_print); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_PURGE, lcd_advanced_pause_extrude_more); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_EXTRUDE, lcd_advanced_pause_extrude_more); END_MENU(); } void lcd_advanced_pause_init_message() { START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); + 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); @@ -4584,7 +4081,7 @@ void lcd_quick_feedback(const bool clear_buttons) { void lcd_advanced_pause_unload_message() { START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); + 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); @@ -4607,7 +4104,7 @@ void lcd_quick_feedback(const bool clear_buttons) { void lcd_advanced_pause_wait_for_nozzles_to_heat() { START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true); STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_1); #ifdef MSG_FILAMENT_CHANGE_HEATING_2 STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_2); @@ -4624,7 +4121,7 @@ void lcd_quick_feedback(const bool clear_buttons) { void lcd_advanced_pause_heat_nozzle() { START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true); STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_1); #ifdef MSG_FILAMENT_CHANGE_INSERT_2 STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_2); @@ -4641,7 +4138,7 @@ void lcd_quick_feedback(const bool clear_buttons) { void lcd_advanced_pause_insert_message() { START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); + 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); @@ -4664,7 +4161,7 @@ void lcd_quick_feedback(const bool clear_buttons) { void lcd_advanced_pause_load_message() { START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); + 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); @@ -4685,18 +4182,18 @@ void lcd_quick_feedback(const bool clear_buttons) { END_SCREEN(); } - void lcd_advanced_pause_purge_message() { + void lcd_advanced_pause_extrude_message() { START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_1); - #ifdef MSG_FILAMENT_CHANGE_PURGE_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_2); + 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); #define __FC_LINES_G 3 #else #define __FC_LINES_G 2 #endif - #ifdef MSG_FILAMENT_CHANGE_PURGE_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_3); + #ifdef MSG_FILAMENT_CHANGE_EXTRUDE_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_3); #define _FC_LINES_G (__FC_LINES_G + 1) #else #define _FC_LINES_G __FC_LINES_G @@ -4708,34 +4205,9 @@ void lcd_quick_feedback(const bool clear_buttons) { END_SCREEN(); } - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - void lcd_advanced_pause_continuous_purge_menu() { - START_SCREEN(); - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_1); - #ifdef MSG_FILAMENT_CHANGE_PURGE_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_2); - #define __FC_LINES_G 3 - #else - #define __FC_LINES_G 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_PURGE_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_3); - #define _FC_LINES_G (__FC_LINES_G + 1) - #else - #define _FC_LINES_G __FC_LINES_G - #endif - #if LCD_HEIGHT > _FC_LINES_G + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - STATIC_ITEM(MSG_USERWAIT); - END_SCREEN(); - } - #endif - void lcd_advanced_pause_resume_message() { START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); + 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); @@ -4746,41 +4218,49 @@ void lcd_quick_feedback(const bool clear_buttons) { END_SCREEN(); } - FORCE_INLINE screenFunc_t ap_message_screen(const AdvancedPauseMessage message) { + void lcd_advanced_pause_show_message(const AdvancedPauseMessage message) { switch (message) { - case ADVANCED_PAUSE_MESSAGE_INIT: return lcd_advanced_pause_init_message; - case ADVANCED_PAUSE_MESSAGE_UNLOAD: return lcd_advanced_pause_unload_message; - case ADVANCED_PAUSE_MESSAGE_INSERT: return lcd_advanced_pause_insert_message; - case ADVANCED_PAUSE_MESSAGE_LOAD: return lcd_advanced_pause_load_message; - case ADVANCED_PAUSE_MESSAGE_PURGE: return lcd_advanced_pause_purge_message; - case ADVANCED_PAUSE_MESSAGE_RESUME: return lcd_advanced_pause_resume_message; - case ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE: return lcd_advanced_pause_heat_nozzle; - case ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT: return lcd_advanced_pause_wait_for_nozzles_to_heat; - case ADVANCED_PAUSE_MESSAGE_OPTION: advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_WAIT_FOR; - return lcd_advanced_pause_option_menu; - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - case ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE: return lcd_advanced_pause_continuous_purge_menu; - #endif + case ADVANCED_PAUSE_MESSAGE_INIT: + defer_return_to_status = true; + lcd_goto_screen(lcd_advanced_pause_init_message); + break; + case ADVANCED_PAUSE_MESSAGE_UNLOAD: + defer_return_to_status = true; + lcd_goto_screen(lcd_advanced_pause_unload_message); + break; + case ADVANCED_PAUSE_MESSAGE_INSERT: + defer_return_to_status = true; + lcd_goto_screen(lcd_advanced_pause_insert_message); + break; + case ADVANCED_PAUSE_MESSAGE_LOAD: + defer_return_to_status = true; + lcd_goto_screen(lcd_advanced_pause_load_message); + break; + case ADVANCED_PAUSE_MESSAGE_EXTRUDE: + defer_return_to_status = true; + lcd_goto_screen(lcd_advanced_pause_extrude_message); + break; + case ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE: + defer_return_to_status = true; + lcd_goto_screen(lcd_advanced_pause_heat_nozzle); + break; + case ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT: + defer_return_to_status = true; + lcd_goto_screen(lcd_advanced_pause_wait_for_nozzles_to_heat); + break; + case ADVANCED_PAUSE_MESSAGE_OPTION: + defer_return_to_status = true; + advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_WAIT_FOR; + lcd_goto_screen(lcd_advanced_pause_option_menu); + break; + case ADVANCED_PAUSE_MESSAGE_RESUME: + defer_return_to_status = true; + lcd_goto_screen(lcd_advanced_pause_resume_message); + break; case ADVANCED_PAUSE_MESSAGE_STATUS: - default: break; + lcd_return_to_status(); + break; } - return NULL; - } - - void lcd_advanced_pause_show_message( - const AdvancedPauseMessage message, - const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/, - const uint8_t extruder/*=active_extruder*/ - ) { - advanced_pause_mode = mode; - hotend_status_extruder = extruder; - const screenFunc_t next_screen = ap_message_screen(message); - if (next_screen) { - defer_return_to_status = true; - lcd_goto_screen(next_screen); - } - else - lcd_return_to_status(); } #endif // ADVANCED_PAUSE_FEATURE @@ -4815,19 +4295,21 @@ void lcd_quick_feedback(const bool clear_buttons) { 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)) * (1.0f / _scale))); \ + lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) * (1.0 / _scale))); \ if (lcd_clicked || (liveEdit && lcdDrawUpdate)) { \ - _type value = ((_type)((int32_t)encoderPosition + minEditValue)) * (1.0f / _scale); \ + _type value = ((_type)((int32_t)encoderPosition + minEditValue)) * (1.0 / _scale); \ if (editValue != NULL) *((_type*)editValue) = value; \ - if (callbackFunc && (liveEdit || lcd_clicked)) (*callbackFunc)(); \ + if (liveEdit) (*callbackFunc)(); \ if (lcd_clicked) lcd_goto_previous_menu(); \ } \ - return use_click(); \ + return lcd_clicked; \ } \ void menu_edit_ ## _name() { _menu_edit_ ## _name(); } \ + void menu_edit_callback_ ## _name() { if (_menu_edit_ ## _name()) (*callbackFunc)(); } \ void _menu_action_setting_edit_ ## _name(const char * const pstr, _type* const ptr, const _type minValue, const _type maxValue) { \ lcd_save_previous_screen(); \ - lcd_refresh(); \ + \ + lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; \ \ editLabel = pstr; \ editValue = ptr; \ @@ -4835,27 +4317,28 @@ void lcd_quick_feedback(const bool clear_buttons) { maxEditValue = maxValue * _scale - minEditValue; \ encoderPosition = (*ptr) * _scale - minEditValue; \ } \ - void menu_action_setting_edit_callback_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback, const bool live) { \ + void menu_action_setting_edit_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue) { \ _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \ currentScreen = menu_edit_ ## _name; \ + } \ + void menu_action_setting_edit_callback_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback, const bool live) { \ + _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \ + currentScreen = menu_edit_callback_ ## _name; \ callbackFunc = callback; \ liveEdit = live; \ } \ - FORCE_INLINE void menu_action_setting_edit_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue) { \ - menu_action_setting_edit_callback_ ## _name(pstr, ptr, minValue, maxValue); \ - } \ - typedef void _name##_void + typedef void _name + DEFINE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01); DEFINE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1); DEFINE_MENU_EDIT_TYPE(uint8_t, int8, i8tostr3, 1); - DEFINE_MENU_EDIT_TYPE(float, float3, ftostr3, 1); - DEFINE_MENU_EDIT_TYPE(float, float52, ftostr52, 100); - DEFINE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000); - DEFINE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01f); - DEFINE_MENU_EDIT_TYPE(float, float51, ftostr51sign, 10); - DEFINE_MENU_EDIT_TYPE(float, float52sign, ftostr52sign, 100); - DEFINE_MENU_EDIT_TYPE(float, float62, ftostr62rj, 100); - DEFINE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01f); + DEFINE_MENU_EDIT_TYPE(float, float3, ftostr3, 1.0); + DEFINE_MENU_EDIT_TYPE(float, float32, ftostr32, 100.0); + DEFINE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000.0); + DEFINE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01); + DEFINE_MENU_EDIT_TYPE(float, float51, ftostr51sign, 10.0); + DEFINE_MENU_EDIT_TYPE(float, float52, ftostr52sign, 100.0); + DEFINE_MENU_EDIT_TYPE(float, float62, ftostr62rj, 100.0); /** * @@ -4871,8 +4354,8 @@ void lcd_quick_feedback(const bool clear_buttons) { if (encoderDirection == -1) { // side effect which signals we are inside a menu if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM; else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT) { menu_action_back(); lcd_quick_feedback(true); } - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) { lcd_return_to_status(); lcd_quick_feedback(true); } + else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT) { menu_action_back(); lcd_quick_feedback(); } + else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) { lcd_return_to_status(); lcd_quick_feedback(); } } else { if (buttons_reprapworld_keypad & (EN_REPRAPWORLD_KEYPAD_DOWN|EN_REPRAPWORLD_KEYPAD_UP|EN_REPRAPWORLD_KEYPAD_RIGHT)) { @@ -4929,7 +4412,7 @@ void lcd_quick_feedback(const bool clear_buttons) { if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); #endif - if (all_axes_homed()) { + 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 @@ -4959,29 +4442,27 @@ void lcd_quick_feedback(const bool clear_buttons) { #if ENABLED(SDSUPPORT) - void menu_action_sdfile(CardReader& theCard) { + void menu_action_sdfile(const char* filename, char* longFilename) { #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) last_sdfile_encoderPosition = encoderPosition; // Save which file was selected for later use #endif - card.openAndPrintFile(theCard.filename); + UNUSED(longFilename); + card.openAndPrintFile(filename); lcd_return_to_status(); - lcd_reset_status(); } - void menu_action_sddirectory(CardReader& theCard) { - card.chdir(theCard.filename); + void menu_action_sddirectory(const char* filename, char* longFilename) { + UNUSED(longFilename); + card.chdir(filename); encoderTopLine = 0; encoderPosition = 2 * ENCODER_STEPS_PER_MENU_ITEM; screen_changed = true; - #if ENABLED(DOGLCD) - drawing_screen = false; - #endif - lcd_refresh(); + lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; } #endif // SDSUPPORT - void menu_action_setting_edit_bool(const char* pstr, bool* ptr) { UNUSED(pstr); *ptr ^= true; lcd_refresh(); } + void menu_action_setting_edit_bool(const char* pstr, bool* ptr) { UNUSED(pstr); *ptr ^= true; lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; } void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callback) { menu_action_setting_edit_bool(pstr, ptr); (*callback)(); @@ -4997,9 +4478,11 @@ void lcd_init() { #if BUTTON_EXISTS(EN1) SET_INPUT_PULLUP(BTN_EN1); #endif + #if BUTTON_EXISTS(EN2) SET_INPUT_PULLUP(BTN_EN2); #endif + #if BUTTON_EXISTS(ENC) SET_INPUT_PULLUP(BTN_ENC); #endif @@ -5053,19 +4536,19 @@ void lcd_init() { #endif } -int16_t utf8_strlen(const char* s) { +int16_t lcd_strlen(const char* s) { int16_t i = 0, j = 0; while (s[i]) { - if (START_OF_UTF8_CHAR(s[i])) j++; + if (PRINTABLE(s[i])) j++; i++; } return j; } -int16_t utf8_strlen_P(const char* s) { +int16_t lcd_strlen_P(const char* s) { int16_t j = 0; while (pgm_read_byte(s)) { - if (START_OF_UTF8_CHAR(pgm_read_byte(s))) j++; + if (PRINTABLE(pgm_read_byte(s))) j++; s++; } return j; @@ -5077,7 +4560,7 @@ bool lcd_blink() { millis_t ms = millis(); if (ELAPSED(ms, next_blink_ms)) { blink ^= 0xFF; - next_blink_ms = ms + 1000 - (LCD_UPDATE_INTERVAL) / 2; + next_blink_ms = ms + 1000 - LCD_UPDATE_INTERVAL / 2; } return blink != 0; } @@ -5138,44 +4621,30 @@ void lcd_update() { if (UBL_CONDITION && LCD_CLICKED) { if (!wait_for_unclick) { // If not waiting for a debounce release: wait_for_unclick = true; // Set debounce flag to ignore continous clicks - lcd_clicked = !wait_for_user && !no_reentry; // Keep the click if not waiting for a user-click + lcd_clicked = !wait_for_user; // Keep the click if not waiting for a user-click wait_for_user = false; // Any click clears wait for user - lcd_quick_feedback(true); // Always make a click sound + lcd_quick_feedback(); // Always make a click sound } } else wait_for_unclick = false; - - #if BUTTON_EXISTS(BACK) - if (LCD_BACK_CLICKED) { - lcd_quick_feedback(true); - lcd_goto_previous_menu(); - } - #endif - - #endif // ULTIPANEL + #endif #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) - const uint8_t sd_status = (uint8_t)IS_SD_INSERTED(); + const bool sd_status = IS_SD_INSERTED; if (sd_status != lcd_sd_status && lcd_detected()) { - uint8_t old_sd_status = lcd_sd_status; // prevent re-entry to this block! - lcd_sd_status = sd_status; - if (sd_status) { - safe_delay(500); // Some boards need a delay to get settled card.initsd(); - if (old_sd_status == 2) - card.beginautostart(); // Initial boot - else - LCD_MESSAGEPGM(MSG_SD_INSERTED); + if (lcd_sd_status != 2) LCD_MESSAGEPGM(MSG_SD_INSERTED); } else { card.release(); - if (old_sd_status != 2) LCD_MESSAGEPGM(MSG_SD_REMOVED); + if (lcd_sd_status != 2) LCD_MESSAGEPGM(MSG_SD_REMOVED); } - lcd_refresh(); + lcd_sd_status = sd_status; + lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. #if ENABLED(LCD_PROGRESS_BAR) currentScreen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU @@ -5185,19 +4654,12 @@ void lcd_update() { #endif // SDSUPPORT && SD_DETECT_PIN - #if ENABLED(POWER_LOSS_RECOVERY) - if (job_recovery_commands_count && job_recovery_phase == JOB_RECOVERY_IDLE) { - lcd_goto_screen(lcd_job_recovery_menu); - job_recovery_phase = JOB_RECOVERY_MAYBE; // Waiting for a response - } - #endif - const millis_t ms = millis(); if (ELAPSED(ms, next_lcd_update_ms) #if ENABLED(DOGLCD) || drawing_screen #endif - ) { + ) { next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL; @@ -5222,7 +4684,7 @@ void lcd_update() { #endif - const bool encoderPastThreshold = (ABS(encoderDiff) >= ENCODER_PULSES_PER_STEP); + const bool encoderPastThreshold = (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP); if (encoderPastThreshold || lcd_clicked) { if (encoderPastThreshold) { int32_t encoderMultiplier = 1; @@ -5230,12 +4692,12 @@ void lcd_update() { #if ENABLED(ENCODER_RATE_MULTIPLIER) if (encoderRateMultiplierEnabled) { - int32_t encoderMovementSteps = ABS(encoderDiff) / ENCODER_PULSES_PER_STEP; + int32_t encoderMovementSteps = abs(encoderDiff) / ENCODER_PULSES_PER_STEP; if (lastEncoderMovementMillis) { // Note that the rate is always calculated between two passes through the // loop and that the abs of the encoderDiff value is tracked. - float encoderStepRate = float(encoderMovementSteps) / float(ms - lastEncoderMovementMillis) * 1000; + float encoderStepRate = float(encoderMovementSteps) / float(ms - lastEncoderMovementMillis) * 1000.0; if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; @@ -5279,7 +4741,7 @@ void lcd_update() { lcdDrawUpdate = LCDVIEW_REDRAW_NOW; } - #if ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES) + #if ENABLED(SCROLL_LONG_FILENAMES) // If scrolling of long file names is enabled and we are in the sd card menu, // cause a refresh to occur until all the text has scrolled into view. if (currentScreen == lcd_sdcard_menu && filename_scroll_pos < filename_scroll_max && !lcd_status_update_delay--) { @@ -5301,13 +4763,12 @@ void lcd_update() { if ((lcdDrawUpdate || IS_DRAWING) && (!bbr2 || bbr2 > max_display_update_time)) { - // Change state of drawing flag between screen updates if (!IS_DRAWING) switch (lcdDrawUpdate) { case LCDVIEW_CALL_NO_REDRAW: lcdDrawUpdate = LCDVIEW_NONE; break; - case LCDVIEW_CLEAR_CALL_REDRAW: - case LCDVIEW_CALL_REDRAW_NEXT: + case LCDVIEW_CLEAR_CALL_REDRAW: // set by handlers, then altered after (rarely occurs here) + case LCDVIEW_CALL_REDRAW_NEXT: // set by handlers, then altered after (never occurs here?) lcdDrawUpdate = LCDVIEW_REDRAW_NOW; case LCDVIEW_REDRAW_NOW: // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT case LCDVIEW_NONE: @@ -5319,50 +4780,31 @@ void lcd_update() { #endif #if ENABLED(ULTIPANEL) - #define CURRENTSCREEN() (*currentScreen)() + #define CURRENTSCREEN() (*currentScreen)(), lcd_clicked = false #else #define CURRENTSCREEN() lcd_status_screen() #endif #if ENABLED(DOGLCD) - #if ENABLED(LIGHTWEIGHT_UI) - #if ENABLED(ULTIPANEL) - const bool in_status = currentScreen == lcd_status_screen; - #else - constexpr bool in_status = true; - #endif - const bool do_u8g_loop = !in_status; - lcd_in_status(in_status); - if (in_status) lcd_status_screen(); - #else - constexpr bool do_u8g_loop = true; - #endif - if (do_u8g_loop) { - if (!drawing_screen) { // If not already drawing pages - u8g.firstPage(); // Start the first page - drawing_screen = first_page = true; // Flag as drawing pages - } - lcd_setFont(FONT_MENU); // Setup font for every page draw - u8g.setColorIndex(1); // And reset the color - CURRENTSCREEN(); // Draw and process the current screen - first_page = false; + if (!drawing_screen) { // If not already drawing pages + u8g.firstPage(); // Start the first page + drawing_screen = 1; // Flag as drawing pages + } + lcd_setFont(FONT_MENU); // Setup font for every page draw + u8g.setColorIndex(1); // And reset the color + CURRENTSCREEN(); // Draw and process the current screen - // The screen handler can clear drawing_screen for an action that changes the screen. - // If still drawing and there's another page, update max-time and return now. - // The nextPage will already be set up on the next call. - if (drawing_screen && (drawing_screen = u8g.nextPage())) { - NOLESS(max_display_update_time, millis() - ms); - return; - } + // The screen handler can clear drawing_screen for an action that changes the screen. + // If still drawing and there's another page, update max-time and return now. + // The nextPage will already be set up on the next call. + if (drawing_screen && (drawing_screen = u8g.nextPage())) { + NOLESS(max_display_update_time, millis() - ms); + return; } #else CURRENTSCREEN(); #endif - #if ENABLED(ULTIPANEL) - lcd_clicked = false; - #endif - // Keeping track of the longest time for an individual LCD update. // Used to do screen throttling when the planner starts to fill up. NOLESS(max_display_update_time, millis() - ms); @@ -5378,23 +4820,45 @@ void lcd_update() { #endif // ULTIPANEL - // Change state of drawing flag between screen updates if (!IS_DRAWING) switch (lcdDrawUpdate) { case LCDVIEW_CLEAR_CALL_REDRAW: - lcd_implementation_clear(); break; + lcd_implementation_clear(); + case LCDVIEW_CALL_REDRAW_NEXT: + lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + break; case LCDVIEW_REDRAW_NOW: lcdDrawUpdate = LCDVIEW_NONE; + break; case LCDVIEW_NONE: - case LCDVIEW_CALL_REDRAW_NEXT: - case LCDVIEW_CALL_NO_REDRAW: - default: break; + break; } // switch } // ELAPSED(ms, next_lcd_update_ms) } +inline void pad_message_string() { + uint8_t i = 0, j = 0; + char c; + while ((c = lcd_status_message[i]) && j < LCD_WIDTH) { + if (PRINTABLE(c)) j++; + i++; + } + if (true + #if ENABLED(STATUS_MESSAGE_SCROLLING) + && j < LCD_WIDTH + #endif + ) { + // pad with spaces to fill up the line + while (j++ < LCD_WIDTH) lcd_status_message[i++] = ' '; + // chop off at the edge + lcd_status_message[i] = '\0'; + } +} + void lcd_finishstatus(const bool persist=false) { + pad_message_string(); + #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0)) UNUSED(persist); #endif @@ -5405,14 +4869,14 @@ void lcd_finishstatus(const bool persist=false) { expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE; #endif #endif - lcd_refresh(); + lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) previous_lcd_status_ms = millis(); //get status message to show up for a while #endif #if ENABLED(STATUS_MESSAGE_SCROLLING) - status_scroll_offset = 0; + status_scroll_pos = 0; #endif } @@ -5424,26 +4888,7 @@ bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); } void lcd_setstatus(const char * const message, const bool persist) { if (lcd_status_message_level > 0) return; - - // Here we have a problem. The message is encoded in UTF8, so - // arbitrarily cutting it will be a problem. We MUST be sure - // that there is no cutting in the middle of a multibyte character! - - // Get a pointer to the null terminator - const char* pend = message + strlen(message); - - // If length of supplied UTF8 string is greater than - // our buffer size, start cutting whole UTF8 chars - while ((pend - message) > MAX_MESSAGE_LENGTH) { - --pend; - while (!START_OF_UTF8_CHAR(*pend)) --pend; - }; - - // At this point, we have the proper cut point. Use it - uint8_t maxLen = pend - message; - strncpy(lcd_status_message, message, maxLen); - lcd_status_message[maxLen] = '\0'; - + strncpy(lcd_status_message, message, 3 * (LCD_WIDTH)); lcd_finishstatus(persist); } @@ -5451,26 +4896,7 @@ void lcd_setstatusPGM(const char * const message, int8_t level) { if (level < 0) level = lcd_status_message_level = 0; if (level < lcd_status_message_level) return; lcd_status_message_level = level; - - // Here we have a problem. The message is encoded in UTF8, so - // arbitrarily cutting it will be a problem. We MUST be sure - // that there is no cutting in the middle of a multibyte character! - - // Get a pointer to the null terminator - const char* pend = message + strlen_P(message); - - // If length of supplied UTF8 string is greater than - // our buffer size, start cutting whole UTF8 chars - while ((pend - message) > MAX_MESSAGE_LENGTH) { - --pend; - while (!START_OF_UTF8_CHAR(pgm_read_byte(pend))) --pend; - }; - - // At this point, we have the proper cut point. Use it - uint8_t maxLen = pend - message; - strncpy_P(lcd_status_message, message, maxLen); - lcd_status_message[maxLen] = '\0'; - + strncpy_P(lcd_status_message, message, 3 * (LCD_WIDTH)); lcd_finishstatus(level > 0); } @@ -5479,7 +4905,7 @@ void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) { lcd_status_message_level = level; va_list args; va_start(args, fmt); - vsnprintf_P(lcd_status_message, MAX_MESSAGE_LENGTH, fmt, args); + vsnprintf_P(lcd_status_message, 3 * (LCD_WIDTH), fmt, args); va_end(args); lcd_finishstatus(level > 0); } @@ -5495,7 +4921,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } #if HAS_LCD_CONTRAST - void set_lcd_contrast(const int16_t value) { + void set_lcd_contrast(const uint16_t value) { lcd_contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); u8g.setContrast(lcd_contrast); } @@ -5544,21 +4970,18 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } #if BUTTON_EXISTS(EN1) if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; #endif + #if BUTTON_EXISTS(EN2) if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; #endif + #if BUTTON_EXISTS(ENC) if (BUTTON_PRESSED(ENC)) newbutton |= EN_C; #endif - #if BUTTON_EXISTS(BACK) - if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; - #endif - // - // Directional buttons - // #if LCD_HAS_DIRECTIONAL_BUTTONS + // Manage directional buttons #if ENABLED(REVERSE_MENU_DIRECTION) #define _ENCODER_UD_STEPS (ENCODER_STEPS_PER_MENU_ITEM * encoderDirection) #else @@ -5659,8 +5082,9 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } } #if ENABLED(AUTO_BED_LEVELING_UBL) if (lcd_external_control) { - ubl.encoder_diff = encoderDiff; // Make encoder rotation available to UBL G29 mesh editing. - encoderDiff = 0; // Hide the encoder event from the current screen handler. + ubl.encoder_diff = encoderDiff; // Make the encoder's rotation available to G29's Mesh Editor + encoderDiff = 0; // We are going to lie to the LCD Panel and claim the encoder + // knob has not turned. } #endif lastEncoderBits = enc; diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 5386fa0..ab2ce15 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -25,33 +25,35 @@ #include "MarlinConfig.h" -#if ENABLED(ULTRA_LCD) || ENABLED(MALYAN_LCD) - void lcd_init(); - bool lcd_detected(); - void lcd_update(); - void lcd_setalertstatusPGM(const char* message); -#else - inline void lcd_init() {} - inline bool lcd_detected() { return true; } - inline void lcd_update() {} - inline void lcd_setalertstatusPGM(const char* message) { UNUSED(message); } -#endif - #if ENABLED(ULTRA_LCD) #include "Marlin.h" - int16_t utf8_strlen(const char* s); - int16_t utf8_strlen_P(const char* s); + #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) + extern bool lcd_external_control; + #if ENABLED(G26_MESH_VALIDATION) + void lcd_chirp(); + #endif + #endif + + #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0) + #define BUTTON_PRESSED(BN) !READ(BTN_## BN) + + extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2]; + + int16_t lcd_strlen(const char* s); + int16_t lcd_strlen_P(const char* s); + void lcd_update(); + void lcd_init(); bool lcd_hasstatus(); void lcd_setstatus(const char* message, const bool persist=false); void lcd_setstatusPGM(const char* message, const int8_t level=0); void lcd_setalertstatusPGM(const char* message); - void lcd_reset_alert_level(); - void lcd_reset_status(); void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...); + void lcd_reset_alert_level(); void lcd_kill_screen(); void kill_screen(const char* lcd_msg); + bool lcd_detected(void); extern uint8_t lcdDrawUpdate; inline void lcd_refresh() { lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; } @@ -60,23 +62,17 @@ void lcd_buzz(const long duration, const uint16_t freq); #endif - void lcd_quick_feedback(const bool clear_buttons); // Audible feedback for a button click - could also be visual - #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 void dontExpireStatus(); #endif - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - extern uint8_t progress_bar_percent; - #endif - #if ENABLED(ADC_KEYPAD) uint8_t get_ADC_keyValue(); #endif #if ENABLED(DOGLCD) - extern int16_t lcd_contrast; - void set_lcd_contrast(const int16_t value); + extern uint16_t lcd_contrast; + void set_lcd_contrast(const uint16_t value); #endif #if ENABLED(SHOW_BOOTSCREEN) @@ -84,52 +80,31 @@ #endif #define LCD_UPDATE_INTERVAL 100 - #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0) - #define BUTTON_PRESSED(BN) !READ(BTN_## BN) - #if ENABLED(ULTIPANEL) // LCD with a click-wheel input + #if ENABLED(ULTIPANEL) - extern bool defer_return_to_status; - - // Function pointer to menu functions. - typedef void (*screenFunc_t)(); - typedef void (*menuAction_t)(); - - extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2]; - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - extern bool lcd_external_control; - #else - constexpr bool lcd_external_control = false; + #define BLEN_A 0 + #define BLEN_B 1 + // Encoder click is directly connected + #if BUTTON_EXISTS(ENC) + #define BLEN_C 2 #endif + #define EN_A (_BV(BLEN_A)) + #define EN_B (_BV(BLEN_B)) + #define EN_C (_BV(BLEN_C)) - #if ENABLED(LCD_BED_LEVELING) - extern bool lcd_wait_for_move; - #else - constexpr bool lcd_wait_for_move = false; - #endif - - void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder=0); - + 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 void lcd_completion_feedback(const bool good=true); #if ENABLED(ADVANCED_PAUSE_FEATURE) - extern uint8_t active_extruder; - void lcd_advanced_pause_show_message(const AdvancedPauseMessage message, - const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT, - const uint8_t extruder=active_extruder); - #endif + void lcd_advanced_pause_show_message(const AdvancedPauseMessage message); + #endif // ADVANCED_PAUSE_FEATURE - #if ENABLED(G26_MESH_VALIDATION) - void lcd_chirp(); - #endif + #else - #if ENABLED(AUTO_BED_LEVELING_UBL) - void lcd_mesh_edit_setup(const float &initial); - float lcd_mesh_edit(); - void lcd_z_offset_edit_setup(const float &initial); - float lcd_z_offset_edit(); - #endif + inline void lcd_buttons_update() {} #endif @@ -178,6 +153,12 @@ #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad & KEYPAD_HOME) #define REPRAPWORLD_KEYPAD_MOVE_MENU (buttons_reprapworld_keypad & KEYPAD_EN_C) + #if BUTTON_EXISTS(ENC) + #define LCD_CLICKED ((buttons & EN_C) || REPRAPWORLD_KEYPAD_MOVE_MENU) + #else + #define LCD_CLICKED REPRAPWORLD_KEYPAD_MOVE_MENU + #endif + #define REPRAPWORLD_KEYPAD_PRESSED (buttons_reprapworld_keypad & ( \ EN_REPRAPWORLD_KEYPAD_F3 | \ EN_REPRAPWORLD_KEYPAD_F2 | \ @@ -189,6 +170,10 @@ EN_REPRAPWORLD_KEYPAD_LEFT) \ ) + #elif ENABLED(NEWPANEL) + #define LCD_CLICKED (buttons & EN_C) + #else + #define LCD_CLICKED false #endif #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) @@ -196,68 +181,42 @@ void wait_for_release(); #endif -#else // MALYAN_LCD or no LCD + #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD)) + extern uint8_t progress_bar_percent; + #endif - constexpr bool lcd_wait_for_move = false; +#else // no LCD - inline void lcd_refresh() {} + inline void lcd_update() {} + inline void lcd_init() {} inline bool lcd_hasstatus() { return false; } inline void lcd_setstatus(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); } inline void lcd_setstatusPGM(const char* const message, const int8_t level=0) { UNUSED(message); UNUSED(level); } + inline void lcd_setalertstatusPGM(const char* message) { UNUSED(message); } inline void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) { UNUSED(level); UNUSED(fmt); } + inline void lcd_buttons_update() {} inline void lcd_reset_alert_level() {} - inline void lcd_reset_status() {} + inline bool lcd_detected() { return true; } + inline void lcd_refresh() {} #endif // ULTRA_LCD -#if ENABLED(ULTIPANEL) - - #if ENABLED(NEWPANEL) // Uses digital switches, not a shift register - - // Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes) - #define BLEN_A 0 - #define BLEN_B 1 - - #define EN_A _BV(BLEN_A) - #define EN_B _BV(BLEN_B) - - #if BUTTON_EXISTS(ENC) - #define BLEN_C 2 - #define EN_C _BV(BLEN_C) - #endif - - #if BUTTON_EXISTS(BACK) - #define BLEN_D 3 - #define EN_D _BV(BLEN_D) - #define LCD_BACK_CLICKED (buttons & EN_D) - #endif - - #endif // NEWPANEL - - extern volatile uint8_t buttons; // The last-checked buttons in a bit array. - void lcd_buttons_update(); - -#else - - inline void lcd_buttons_update() {} - -#endif - -#if ENABLED(REPRAPWORLD_KEYPAD) - #ifdef EN_C - #define LCD_CLICKED ((buttons & EN_C) || REPRAPWORLD_KEYPAD_MOVE_MENU) - #else - #define LCD_CLICKED REPRAPWORLD_KEYPAD_MOVE_MENU - #endif -#elif defined(EN_C) - #define LCD_CLICKED (buttons & EN_C) -#else - #define LCD_CLICKED false -#endif - #define LCD_MESSAGEPGM(x) lcd_setstatusPGM(PSTR(x)) #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatusPGM(PSTR(x)) +void lcd_reset_status(); + +#if ENABLED(AUTO_BED_LEVELING_UBL) + void lcd_mesh_edit_setup(const float initial); + float lcd_mesh_edit(); + void lcd_z_offset_edit_setup(float); + float lcd_z_offset_edit(); +#endif + +#if ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE + float lcd_probe_pt(const float &rx, const float &ry); +#endif + #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) void lcd_reselect_last_file(); #endif diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 935b992..0cd6687 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -33,32 +33,16 @@ * License: http://opensource.org/licenses/BSD-3-Clause */ -/** - * Implementation of the LCD display routines for a DOGM128 graphic display. - * These are common LCD 128x64 pixel graphic displays. - */ - #ifndef ULTRALCD_IMPL_DOGM_H #define ULTRALCD_IMPL_DOGM_H #include "MarlinConfig.h" -#include - +/** + * Implementation of the LCD display routines for a DOGM128 graphic display. + * These are common LCD 128x64 pixel graphic displays. + */ #include "ultralcd.h" -#include "dogm_bitmaps.h" -#include "utility.h" -#include "duration_t.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" -#endif - -// Only Western languages support big / small fonts -#if DISABLED(DISPLAY_CHARSET_ISO10646_1) - #undef USE_BIG_EDIT_FONT - #undef USE_SMALL_INFOFONT -#endif #if ENABLED(U8GLIB_ST7920) #include "ultralcd_st7920_u8glib_rrd.h" @@ -68,13 +52,31 @@ #include "ultralcd_st7565_u8glib_VIKI.h" #endif +#include "dogm_bitmaps.h" +#include "utility.h" +#include "duration_t.h" + +#include + +#if ENABLED(AUTO_BED_LEVELING_UBL) + #include "ubl.h" +#endif + +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_Bootscreen.h" +#endif + +// Only Western languages support big / small fonts +#if DISABLED(DISPLAY_CHARSET_ISO10646_1) + #undef USE_BIG_EDIT_FONT + #undef USE_SMALL_INFOFONT +#endif + #if ENABLED(USE_SMALL_INFOFONT) #include "dogm_font_data_6x9_marlin.h" #define FONT_STATUSMENU_NAME u8g_font_6x9 - #define INFO_FONT_HEIGHT 7 #else #define FONT_STATUSMENU_NAME FONT_MENU_NAME - #define INFO_FONT_HEIGHT 8 #endif #include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols @@ -142,11 +144,13 @@ #if ENABLED(USE_BIG_EDIT_FONT) #define FONT_MENU_EDIT_NAME u8g_font_9x18 #define DOG_CHAR_WIDTH_EDIT 9 - #define DOG_CHAR_HEIGHT_EDIT 18 + #define DOG_CHAR_HEIGHT_EDIT 13 + #define LCD_WIDTH_EDIT 14 #else #define FONT_MENU_EDIT_NAME FONT_MENU_NAME - #define DOG_CHAR_WIDTH_EDIT DOG_CHAR_WIDTH - #define DOG_CHAR_HEIGHT_EDIT DOG_CHAR_HEIGHT + #define DOG_CHAR_WIDTH_EDIT 6 + #define DOG_CHAR_HEIGHT_EDIT 12 + #define LCD_WIDTH_EDIT 22 #endif #ifndef TALL_FONT_CORRECTION @@ -199,9 +203,6 @@ // Generic support for SH1106 OLED I2C LCDs //U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 8 stripes U8GLIB_SH1106_128X64_2X u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 4 stripes -#elif ENABLED(U8GLIB_SSD1309) - // Generic support for SSD1309 OLED I2C LCDs - U8GLIB_SSD1309_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); #elif ENABLED(MINIPANEL) // The MINIPanel display //U8GLIB_MINI12864 u8g(DOGLCD_CS, DOGLCD_A0); // 8 stripes @@ -221,7 +222,7 @@ #include "utf_mapper.h" -int16_t lcd_contrast; // Initialized by settings.load() +uint16_t lcd_contrast; // Initialized by settings.load() static char currentfont = 0; // The current graphical page being rendered @@ -282,26 +283,17 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #ifndef CUSTOM_BOOTSCREEN_TIMEOUT + #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 + #endif + void lcd_custom_bootscreen() { - constexpr u8g_uint_t left = (LCD_PIXEL_WIDTH - (CUSTOM_BOOTSCREEN_BMPWIDTH)) / 2, - top = (LCD_PIXEL_HEIGHT - (CUSTOM_BOOTSCREEN_BMPHEIGHT)) / 2; - #if ENABLED(CUSTOM_BOOTSCREEN_INVERTED) - constexpr u8g_uint_t right = left + CUSTOM_BOOTSCREEN_BMPWIDTH, - bottom = top + CUSTOM_BOOTSCREEN_BMPHEIGHT; - #endif u8g.firstPage(); do { u8g.drawBitmapP( - left, top, - CEILING(CUSTOM_BOOTSCREEN_BMPWIDTH, 8), CUSTOM_BOOTSCREEN_BMPHEIGHT, custom_start_bmp - ); - #if ENABLED(CUSTOM_BOOTSCREEN_INVERTED) - u8g.setColorIndex(1); - if (top) u8g.drawBox(0, 0, LCD_PIXEL_WIDTH, top); - if (left) u8g.drawBox(0, top, left, CUSTOM_BOOTSCREEN_BMPHEIGHT); - if (right < LCD_PIXEL_WIDTH) u8g.drawBox(right, top, LCD_PIXEL_WIDTH - right, CUSTOM_BOOTSCREEN_BMPHEIGHT); - if (bottom < LCD_PIXEL_HEIGHT) u8g.drawBox(0, bottom, LCD_PIXEL_WIDTH, LCD_PIXEL_HEIGHT - bottom); - #endif + (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); } @@ -313,29 +305,25 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { lcd_custom_bootscreen(); #endif - constexpr uint8_t offy = - #if ENABLED(START_BMPHIGH) - (LCD_PIXEL_HEIGHT - (START_BMPHEIGHT)) / 2 - #else - DOG_CHAR_HEIGHT - #endif - ; + #if ENABLED(START_BMPHIGH) + constexpr uint8_t offy = 0; + #else + constexpr uint8_t offy = DOG_CHAR_HEIGHT; + #endif - const uint8_t width = u8g.getWidth(), height = u8g.getHeight(), - offx = (width - (START_BMPWIDTH)) / 2; + const uint8_t offx = (u8g.getWidth() - (START_BMPWIDTH)) / 2, + txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2; u8g.firstPage(); do { u8g.drawBitmapP(offx, offy, (START_BMPWIDTH + 7) / 8, START_BMPHEIGHT, start_bmp); lcd_setFont(FONT_MENU); #ifndef STRING_SPLASH_LINE2 - const uint8_t txt1X = width - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH); - u8g.drawStr(txt1X, (height + DOG_CHAR_HEIGHT) / 2, STRING_SPLASH_LINE1); + u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT), STRING_SPLASH_LINE1); #else - const uint8_t txt1X = (width - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2, - txt2X = (width - (sizeof(STRING_SPLASH_LINE2) - 1) * (DOG_CHAR_WIDTH)) / 2; - u8g.drawStr(txt1X, height - (DOG_CHAR_HEIGHT) * 3 / 2, STRING_SPLASH_LINE1); - u8g.drawStr(txt2X, height - (DOG_CHAR_HEIGHT) * 1 / 2, STRING_SPLASH_LINE2); + const uint8_t txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1) * (DOG_CHAR_WIDTH)) / 2; + 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()); safe_delay(BOOTSCREEN_TIMEOUT); @@ -343,12 +331,6 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { #endif // SHOW_BOOTSCREEN -#if ENABLED(LIGHTWEIGHT_UI) - #include "status_screen_lite_ST7920.h" -#else - #include "status_screen_DOGM.h" -#endif - // Initialize or re-initialize the LCD static void lcd_implementation_init() { @@ -356,19 +338,12 @@ static void lcd_implementation_init() { OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); #endif - #if !defined(LCD_RESET_PIN) && (ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)) - #define LCD_RESET_PIN LCD_PINS_RS - #endif - #if PIN_EXISTS(LCD_RESET) OUT_WRITE(LCD_RESET_PIN, LOW); // perform a clean hardware reset _delay_ms(5); OUT_WRITE(LCD_RESET_PIN, HIGH); _delay_ms(5); // delay to allow the display to initalize - #endif - - #if PIN_EXISTS(LCD_RESET) - u8g.begin(); + u8g.begin(); // re-initialize the display #endif #if DISABLED(MINIPANEL) // setContrast not working for Mini Panel @@ -386,24 +361,402 @@ static void lcd_implementation_init() { // The kill screen is displayed for unrecoverable conditions void lcd_kill_screen() { - #if ENABLED(LIGHTWEIGHT_UI) - ST7920_Lite_Status_Screen::clear_text_buffer(); - #endif - const uint8_t h4 = u8g.getHeight() / 4; u8g.firstPage(); do { lcd_setFont(FONT_MENU); - u8g.setPrintPos(0, h4 * 1); + u8g.setPrintPos(0, u8g.getHeight()/4*1); lcd_print_utf(lcd_status_message); - u8g.setPrintPos(0, h4 * 2); - lcd_printPGM_utf(PSTR(MSG_HALTED)); - u8g.setPrintPos(0, h4 * 3); - lcd_printPGM_utf(PSTR(MSG_PLEASE_RESET)); + 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)); } while (u8g.nextPage()); } void lcd_implementation_clear() { } // Automatically cleared by Picture Loop +// +// Status Screen +// + +FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t x, const uint8_t y) { + const uint8_t degsize = 6 * (temp >= 100 ? 3 : temp >= 10 ? 2 : 1); // number's pixel width + u8g.setPrintPos(x - (18 - degsize) / 2, y); // move left if shorter + lcd_print(itostr3(temp)); + lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); +} + +FORCE_INLINE void _draw_heater_status(const uint8_t x, const int8_t heater, const bool blink) { + #if !HEATER_IDLE_HANDLER + UNUSED(blink); + #endif + + #if HAS_TEMP_BED + const bool isBed = heater < 0; + #else + constexpr bool isBed = false; + #endif + + if (PAGE_UNDER(7)) { + #if HEATER_IDLE_HANDLER + const bool is_idle = (!isBed ? thermalManager.is_heater_idle(heater) : + #if HAS_TEMP_BED + thermalManager.is_bed_idle() + #else + false + #endif + ); + + if (blink || !is_idle) + #endif + _draw_centered_temp((isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater)) + 0.5, x, 7); } + + if (PAGE_CONTAINS(21, 28)) + _draw_centered_temp((isBed ? thermalManager.degBed() : thermalManager.degHotend(heater)) + 0.5, x, 28); + + if (PAGE_CONTAINS(17, 20)) { + const uint8_t h = isBed ? 7 : 8, + y = isBed ? 18 : 17; + if (isBed ? thermalManager.isHeatingBed() : thermalManager.isHeatingHotend(heater)) { + u8g.setColorIndex(0); // white on black + u8g.drawBox(x + h, y, 2, 2); + u8g.setColorIndex(1); // black on white + } + else { + u8g.drawBox(x + h, y, 2, 2); + } + } +} + +FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr, const bool blink) { + if (blink) + lcd_printPGM(pstr); + else { + if (!axis_homed[axis]) + u8g.print('?'); + else { + #if DISABLED(HOME_AFTER_DEACTIVATE) && DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) + if (!axis_known_position[axis]) + u8g.print(' '); + else + #endif + lcd_printPGM(pstr); + } + } +} + +inline void lcd_implementation_status_message(const bool blink) { + #if ENABLED(STATUS_MESSAGE_SCROLLING) + static bool last_blink = false; + const uint8_t slen = lcd_strlen(lcd_status_message); + const char *stat = lcd_status_message + status_scroll_pos; + if (slen <= LCD_WIDTH) + lcd_print_utf(stat); // The string isn't scrolling + else { + if (status_scroll_pos <= slen - LCD_WIDTH) + lcd_print_utf(stat); // The string fills the screen + else { + uint8_t chars = LCD_WIDTH; + if (status_scroll_pos < slen) { // First string still visible + lcd_print_utf(stat); // The string leaves space + chars -= slen - status_scroll_pos; // Amount of space left + } + u8g.print('.'); // Always at 1+ spaces left, draw a dot + if (--chars) { + if (status_scroll_pos < slen + 1) // Draw a second dot if there's space + --chars, u8g.print('.'); + if (chars) lcd_print_utf(lcd_status_message, chars); // Print a second copy of the message + } + } + if (last_blink != blink) { + last_blink = blink; + // Skip any non-printing bytes + if (status_scroll_pos < slen) while (!PRINTABLE(lcd_status_message[status_scroll_pos])) status_scroll_pos++; + if (++status_scroll_pos >= slen + 2) status_scroll_pos = 0; + } + } + #else + UNUSED(blink); + lcd_print_utf(lcd_status_message); + #endif +} + +//#define DOGM_SD_PERCENT + +static void lcd_implementation_status_screen() { + + const bool blink = lcd_blink(); + + // Status Menu Font + lcd_setFont(FONT_STATUSMENU); + + // + // Fan Animation + // + + if (PAGE_UNDER(STATUS_SCREENHEIGHT + 1)) { + + u8g.drawBitmapP(9, 1, (STATUS_SCREENWIDTH + 7) / 8, STATUS_SCREENHEIGHT, + #if HAS_FAN0 + blink && fanSpeeds[0] ? status_screen0_bmp : status_screen1_bmp + #else + status_screen0_bmp + #endif + ); + + } + + // + // Temperature Graphics and Info + // + + if (PAGE_UNDER(28)) { + // Extruders + HOTEND_LOOP() _draw_heater_status(5 + e * 25, e, blink); + + // Heated bed + #if HOTENDS < 4 && HAS_TEMP_BED + _draw_heater_status(81, -1, blink); + #endif + + #if HAS_FAN0 + if (PAGE_CONTAINS(20, 27)) { + // Fan + const int16_t per = ((fanSpeeds[0] + 1) * 100) / 256; + if (per) { + u8g.setPrintPos(104, 27); + lcd_print(itostr3(per)); + u8g.print('%'); + } + } + #endif + } + + #if ENABLED(SDSUPPORT) + + // + // SD Card Symbol + // + + if (card.isFileOpen() && PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION))) { + // Upper box + u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7); // 42-48 (or 41-47) + // Right edge + u8g.drawBox(50, 44 - (TALL_FONT_CORRECTION), 2, 5); // 44-48 (or 43-47) + // Bottom hollow box + u8g.drawFrame(42, 49 - (TALL_FONT_CORRECTION), 10, 4); // 49-52 (or 48-51) + // Corner pixel + u8g.drawPixel(50, 43 - (TALL_FONT_CORRECTION)); // 43 (or 42) + } + + // + // Progress bar frame + // + + #define PROGRESS_BAR_X 54 + #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X) + + if (PAGE_CONTAINS(49, 52 - (TALL_FONT_CORRECTION))) // 49-52 (or 49-51) + u8g.drawFrame( + PROGRESS_BAR_X, 49, + PROGRESS_BAR_WIDTH, 4 - (TALL_FONT_CORRECTION) + ); + + #if DISABLED(LCD_SET_PROGRESS_MANUALLY) + const uint8_t progress_bar_percent = card.percentDone(); + #endif + + if (progress_bar_percent > 1) { + + // + // Progress bar solid part + // + + if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION))) // 50-51 (or just 50) + u8g.drawBox( + PROGRESS_BAR_X + 1, 50, + (uint16_t)((PROGRESS_BAR_WIDTH - 2) * progress_bar_percent * 0.01), 2 - (TALL_FONT_CORRECTION) + ); + + // + // SD Percent Complete + // + + #if ENABLED(DOGM_SD_PERCENT) + if (PAGE_CONTAINS(41, 48)) { + // Percent complete + u8g.setPrintPos(55, 48); + u8g.print(itostr3(progress_bar_percent)); + u8g.print('%'); + } + #endif + } + + // + // Elapsed Time + // + + #if DISABLED(DOGM_SD_PERCENT) + #define SD_DURATION_X (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH / 2) - len * (DOG_CHAR_WIDTH / 2)) + #else + #define SD_DURATION_X (LCD_PIXEL_WIDTH - len * DOG_CHAR_WIDTH) + #endif + + if (PAGE_CONTAINS(41, 48)) { + + char buffer[10]; + duration_t elapsed = print_job_timer.duration(); + bool has_days = (elapsed.value > 60*60*24L); + uint8_t len = elapsed.toDigital(buffer, has_days); + u8g.setPrintPos(SD_DURATION_X, 48); + lcd_print(buffer); + } + + #endif + + // + // XYZ Coordinates + // + + #if ENABLED(USE_SMALL_INFOFONT) + #define INFO_FONT_HEIGHT 7 + #else + #define INFO_FONT_HEIGHT 8 + #endif + + #define XYZ_BASELINE (30 + INFO_FONT_HEIGHT) + + #define X_LABEL_POS 3 + #define X_VALUE_POS 11 + #define XYZ_SPACING 40 + + #if ENABLED(XYZ_HOLLOW_FRAME) + #define XYZ_FRAME_TOP 29 + #define XYZ_FRAME_HEIGHT INFO_FONT_HEIGHT + 3 + #else + #define XYZ_FRAME_TOP 30 + #define XYZ_FRAME_HEIGHT INFO_FONT_HEIGHT + 1 + #endif + + // Before homing the axis letters are blinking 'X' <-> '?'. + // When axis is homed but axis_known_position is false the axis letters are blinking 'X' <-> ' '. + // When everything is ok you see a constant 'X'. + + static char xstring[5], ystring[5], zstring[7]; + #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT) + static char wstring[5], mstring[4]; + #endif + + // At the first page, regenerate the XYZ strings + if (page.page == 0) { + strcpy(xstring, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS]))); + strcpy(ystring, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS]))); + strcpy(zstring, ftostr52sp(FIXFLOAT(LOGICAL_Z_POSITION(current_position[Z_AXIS])))); + #if ENABLED(FILAMENT_LCD_DISPLAY) + strcpy(wstring, ftostr12ns(filament_width_meas)); + strcpy(mstring, itostr3(100.0 * ( + parser.volumetric_enabled + ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] + : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] + ) + )); + #endif + } + + if (PAGE_CONTAINS(XYZ_FRAME_TOP, XYZ_FRAME_TOP + XYZ_FRAME_HEIGHT - 1)) { + + #if ENABLED(XYZ_HOLLOW_FRAME) + u8g.drawFrame(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 29-40 7: 29-39 + #else + u8g.drawBox(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 30-39 7: 30-37 + #endif + + if (PAGE_CONTAINS(XYZ_BASELINE - (INFO_FONT_HEIGHT - 1), XYZ_BASELINE)) { + + #if DISABLED(XYZ_HOLLOW_FRAME) + u8g.setColorIndex(0); // white on black + #endif + + u8g.setPrintPos(0 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE); + _draw_axis_label(X_AXIS, PSTR(MSG_X), blink); + u8g.setPrintPos(0 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE); + lcd_print(xstring); + + u8g.setPrintPos(1 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE); + _draw_axis_label(Y_AXIS, PSTR(MSG_Y), blink); + u8g.setPrintPos(1 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE); + lcd_print(ystring); + + u8g.setPrintPos(2 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE); + _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink); + u8g.setPrintPos(2 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE); + lcd_print(zstring); + + #if DISABLED(XYZ_HOLLOW_FRAME) + u8g.setColorIndex(1); // black on white + #endif + } + } + + // + // Feedrate + // + + if (PAGE_CONTAINS(51 - INFO_FONT_HEIGHT, 49)) { + lcd_setFont(FONT_MENU); + u8g.setPrintPos(3, 50); + lcd_print(LCD_STR_FEEDRATE[0]); + + lcd_setFont(FONT_STATUSMENU); + u8g.setPrintPos(12, 50); + lcd_print(itostr3(feedrate_percentage)); + u8g.print('%'); + + // + // Filament sensor display if SD is disabled + // + #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT) + u8g.setPrintPos(56, 50); + lcd_print(wstring); + u8g.setPrintPos(102, 50); + lcd_print(mstring); + u8g.print('%'); + lcd_setFont(FONT_MENU); + u8g.setPrintPos(47, 50); + lcd_print(LCD_STR_FILAM_DIA); + u8g.setPrintPos(93, 50); + lcd_print(LCD_STR_FILAM_MUL); + #endif + } + + // + // Status line + // + + #define STATUS_BASELINE (55 + INFO_FONT_HEIGHT) + + if (PAGE_CONTAINS(STATUS_BASELINE - (INFO_FONT_HEIGHT - 1), STATUS_BASELINE)) { + u8g.setPrintPos(0, STATUS_BASELINE); + + #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) + if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) { //Display both Status message line and Filament display on the last line + lcd_implementation_status_message(blink); + } + else { + lcd_printPGM(PSTR(LCD_STR_FILAM_DIA)); + u8g.print(':'); + lcd_print(wstring); + lcd_printPGM(PSTR(" " LCD_STR_FILAM_MUL)); + u8g.print(':'); + lcd_print(mstring); + u8g.print('%'); + } + #else + lcd_implementation_status_message(blink); + #endif + } +} + #if ENABLED(ULTIPANEL) uint8_t row_y1, row_y2; @@ -411,7 +764,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop #if ENABLED(ADVANCED_PAUSE_FEATURE) - static void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder=active_extruder) { + static void lcd_implementation_hotend_status(const uint8_t row) { row_y1 = row * row_height + 1; row_y2 = row_y1 + row_height - 1; @@ -419,13 +772,13 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop u8g.setPrintPos(LCD_PIXEL_WIDTH - 11 * (DOG_CHAR_WIDTH), row_y2); lcd_print('E'); - lcd_print((char)('1' + extruder)); + lcd_print((char)('1' + active_extruder)); lcd_print(' '); - lcd_print(itostr3(thermalManager.degHotend(extruder))); + lcd_print(itostr3(thermalManager.degHotend(active_extruder))); lcd_print('/'); - if (lcd_blink() || !thermalManager.is_heater_idle(extruder)) - lcd_print(itostr3(thermalManager.degTargetHotend(extruder))); + if (lcd_blink() || !thermalManager.is_heater_idle(active_extruder)) + lcd_print(itostr3(thermalManager.degTargetHotend(active_extruder))); } #endif // ADVANCED_PAUSE_FEATURE @@ -466,7 +819,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop int8_t n = LCD_WIDTH - (START_COL); if (center && !valstr) { - int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; + int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; while (--pad >= 0) { u8g.print(' '); n--; } } while (n > 0 && (c = pgm_read_byte(pstr))) { @@ -512,7 +865,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop if (!PAGE_CONTAINS(row_y1, row_y2)) return; - const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen((char*)data)); + const uint8_t vallen = (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data))); uint8_t n = LCD_WIDTH - (START_COL) - 2 - vallen; while (char c = pgm_read_byte(pstr)) { @@ -533,18 +886,16 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop #define DRAW_BOOL_SETTING(sel, row, pstr, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF)) void lcd_implementation_drawedit(const char* const pstr, const char* const value=NULL) { - const uint8_t labellen = utf8_strlen_P(pstr), - vallen = utf8_strlen(value); + const uint8_t labellen = lcd_strlen_P(pstr), + vallen = lcd_strlen(value); uint8_t rows = (labellen > LCD_WIDTH - 2 - vallen) ? 2 : 1; #if ENABLED(USE_BIG_EDIT_FONT) - constexpr uint8_t lcd_width_edit = (LCD_PIXEL_WIDTH) / (DOG_CHAR_WIDTH_EDIT); - uint8_t lcd_width, char_width; - if (labellen <= lcd_width_edit - 1) { - if (labellen + vallen + 2 >= lcd_width_edit) rows = 2; - lcd_width = lcd_width_edit + 1; + if (labellen <= LCD_WIDTH_EDIT - 1) { + if (labellen + vallen + 2 >= LCD_WIDTH_EDIT) rows = 2; + lcd_width = LCD_WIDTH_EDIT + 1; char_width = DOG_CHAR_WIDTH_EDIT; lcd_setFont(FONT_MENU_EDIT); } @@ -565,7 +916,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop bool onpage = PAGE_CONTAINS(baseline + 1 - (DOG_CHAR_HEIGHT_EDIT), baseline); if (onpage) { u8g.setPrintPos(0, baseline); - lcd_printPGM_utf(pstr); + lcd_printPGM(pstr); } if (value != NULL) { @@ -584,7 +935,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop #if ENABLED(SDSUPPORT) - static void _drawmenu_sd(const bool isSelected, const uint8_t row, const char* const pstr, CardReader& theCard, const bool isDir) { + static void _drawmenu_sd(const bool isSelected, const uint8_t row, const char* const pstr, const char* filename, char* const longFilename, const bool isDir) { UNUSED(pstr); lcd_implementation_mark_as_selected(row, isSelected); @@ -592,23 +943,23 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop if (!PAGE_CONTAINS(row_y1, row_y2)) return; constexpr uint8_t maxlen = LCD_WIDTH - (START_COL) - 1; - const char *outstr = theCard.longest_filename(); - if (theCard.longFilename[0]) { + const char *outstr = longFilename[0] ? longFilename : filename; + if (longFilename[0]) { #if ENABLED(SCROLL_LONG_FILENAMES) if (isSelected) { uint8_t name_hash = row; for (uint8_t l = FILENAME_LENGTH; l--;) - name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ theCard.filename[l]; // rotate, xor + name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ filename[l]; // rotate, xor if (filename_scroll_hash != name_hash) { // If the hash changed... filename_scroll_hash = name_hash; // Save the new hash - filename_scroll_max = MAX(0, utf8_strlen(theCard.longFilename) - maxlen); // Update the scroll limit + filename_scroll_max = max(0, lcd_strlen(longFilename) - maxlen); // Update the scroll limit filename_scroll_pos = 0; // Reset scroll to the start lcd_status_update_delay = 8; // Don't scroll right away } outstr += filename_scroll_pos; } #else - theCard.longFilename[maxlen] = '\0'; // cutoff at screen edge + longFilename[maxlen] = '\0'; // cutoff at screen edge #endif } @@ -623,8 +974,8 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop while (n) { --n; u8g.print(' '); } } - #define lcd_implementation_drawmenu_sdfile(sel, row, pstr, theCard) _drawmenu_sd(sel, row, pstr, theCard, false) - #define lcd_implementation_drawmenu_sddirectory(sel, row, pstr, theCard) _drawmenu_sd(sel, row, pstr, theCard, true) + #define lcd_implementation_drawmenu_sdfile(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, false) + #define lcd_implementation_drawmenu_sddirectory(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, true) #endif // SDSUPPORT @@ -689,15 +1040,15 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop if (PAGE_UNDER(7)) { u8g.setPrintPos(5, 7); lcd_print("X:"); - lcd_print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot])))); + lcd_print(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot])))); u8g.setPrintPos(74, 7); lcd_print("Y:"); - lcd_print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot])))); + lcd_print(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot])))); } // Print plot position - if (PAGE_CONTAINS(LCD_PIXEL_HEIGHT - (INFO_FONT_HEIGHT - 1), LCD_PIXEL_HEIGHT)) { - u8g.setPrintPos(5, LCD_PIXEL_HEIGHT); + if (PAGE_CONTAINS(64 - (INFO_FONT_HEIGHT - 1), 64)) { + u8g.setPrintPos(5, 64); lcd_print('('); u8g.print(x_plot); lcd_print(','); @@ -705,7 +1056,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop lcd_print(')'); // Show the location value - u8g.setPrintPos(74, LCD_PIXEL_HEIGHT); + u8g.setPrintPos(74, 64); lcd_print("Z:"); if (!isnan(ubl.z_values[x_plot][y_plot])) lcd_print(ftostr43sign(ubl.z_values[x_plot][y_plot])); diff --git a/Marlin/ultralcd_impl_HD44780.h b/Marlin/ultralcd_impl_HD44780.h index 779b6d0..5a8fd5f 100644 --- a/Marlin/ultralcd_impl_HD44780.h +++ b/Marlin/ultralcd_impl_HD44780.h @@ -67,19 +67,20 @@ extern volatile uint8_t buttons; //an extended version of the last checked butt #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) // button and encoder bit positions within 'buttons' - #define B_LE (BUTTON_LEFT << B_I2C_BTN_OFFSET) // The remaining normalized buttons are all read via I2C - #define B_UP (BUTTON_UP << B_I2C_BTN_OFFSET) - #define B_MI (BUTTON_SELECT << B_I2C_BTN_OFFSET) - #define B_DW (BUTTON_DOWN << B_I2C_BTN_OFFSET) - #define B_RI (BUTTON_RIGHT << B_I2C_BTN_OFFSET) + #define B_LE (BUTTON_LEFT< '???'. -// Homed but unknown... '123' <-> ' '. -// Homed and known, display constantly. -// -FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) { - lcd_print('X' + uint8_t(axis)); +FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr, const bool blink) { if (blink) - lcd.print(value); + lcd_printPGM(pstr); else { - if (!TEST(axis_homed, axis)) - while (const char c = *value++) lcd_print(c <= '.' ? c : '?'); + if (!axis_homed[axis]) + lcd.write('?'); else { #if DISABLED(HOME_AFTER_DEACTIVATE) && DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - if (!TEST(axis_known_position, axis)) - lcd_printPGM(axis == Z_AXIS ? PSTR(" ") : PSTR(" ")); + if (!axis_known_position[axis]) + lcd.write(' '); else #endif - lcd.print(value); + lcd_printPGM(pstr); } } } FORCE_INLINE void _draw_heater_status(const int8_t heater, const char prefix, const bool blink) { - #if HAS_HEATED_BED - const bool isBed = heater < 0; - const float t1 = (isBed ? thermalManager.degBed() : thermalManager.degHotend(heater)), - t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater)); - #else - const float t1 = thermalManager.degHotend(heater), t2 = thermalManager.degTargetHotend(heater); - #endif + const bool isBed = heater < 0; + + const float t1 = (isBed ? thermalManager.degBed() : thermalManager.degHotend(heater)), + t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater)); if (prefix >= 0) lcd.print(prefix); @@ -666,11 +645,12 @@ FORCE_INLINE void _draw_heater_status(const int8_t heater, const char prefix, co #if !HEATER_IDLE_HANDLER UNUSED(blink); #else - const bool is_idle = ( - #if HAS_HEATED_BED - isBed ? thermalManager.is_bed_idle() : + const bool is_idle = (!isBed ? thermalManager.is_heater_idle(heater) : + #if HAS_TEMP_BED + thermalManager.is_bed_idle() + #else + false #endif - thermalManager.is_heater_idle(heater) ); if (!blink && is_idle) { @@ -752,7 +732,7 @@ static void lcd_implementation_status_screen() { // // Hotend 1 or Bed Temperature // - #if HOTENDS > 1 || HAS_HEATED_BED + #if HOTENDS > 1 || TEMP_SENSOR_BED != 0 lcd.setCursor(8, 0); #if HOTENDS > 1 @@ -763,7 +743,7 @@ static void lcd_implementation_status_screen() { _draw_heater_status(-1, -1, blink); #endif - #endif // HOTENDS > 1 || HAS_HEATED_BED + #endif // HOTENDS > 1 || TEMP_SENSOR_BED != 0 #else // LCD_WIDTH >= 20 @@ -775,20 +755,15 @@ static void lcd_implementation_status_screen() { // // Hotend 1 or Bed Temperature // - #if HOTENDS > 1 || HAS_HEATED_BED + #if HOTENDS > 1 || TEMP_SENSOR_BED != 0 lcd.setCursor(10, 0); #if HOTENDS > 1 _draw_heater_status(1, LCD_STR_THERMOMETER[0], blink); #else - _draw_heater_status(-1, ( - #if HAS_LEVELING - planner.leveling_active && blink ? '_' : - #endif - LCD_BEDTEMP_CHAR - ), blink); + _draw_heater_status(-1, LCD_BEDTEMP_CHAR, blink); #endif - #endif // HOTENDS > 1 || HAS_HEATED_BED + #endif // HOTENDS > 1 || TEMP_SENSOR_BED != 0 #endif // LCD_WIDTH >= 20 @@ -803,7 +778,7 @@ static void lcd_implementation_status_screen() { #if ENABLED(SDSUPPORT) lcd.setCursor(0, 2); lcd_printPGM(PSTR("SD")); - if (IS_SD_PRINTING()) + if (IS_SD_PRINTING) lcd.print(itostr3(card.percentDone())); else lcd_printPGM(PSTR("---")); @@ -814,39 +789,35 @@ static void lcd_implementation_status_screen() { lcd.setCursor(0, 1); - // If the first line has two extruder temps, - // show more temperatures on the next line + #if HOTENDS > 1 && TEMP_SENSOR_BED != 0 - #if HOTENDS > 2 || (HOTENDS > 1 && HAS_HEATED_BED) + // If we both have a 2nd extruder and a heated bed, + // show the heated bed temp on the left, + // since the first line is filled with extruder temps + _draw_heater_status(-1, LCD_BEDTEMP_CHAR, blink); - #if HOTENDS > 2 - _draw_heater_status(2, LCD_STR_THERMOMETER[0], blink); - lcd.setCursor(10, 1); - #endif + #else + // Before homing the axis letters are blinking 'X' <-> '?'. + // When axis is homed but axis_known_position is false the axis letters are blinking 'X' <-> ' '. + // When everything is ok you see a constant 'X'. - _draw_heater_status(-1, ( - #if HAS_LEVELING - planner.leveling_active && blink ? '_' : - #endif - LCD_BEDTEMP_CHAR - ), blink); - - #else // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) - - _draw_axis_value(X_AXIS, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])), blink); + _draw_axis_label(X_AXIS, PSTR(MSG_X), blink); + lcd.print(ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS]))); lcd.write(' '); - _draw_axis_value(Y_AXIS, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])), blink); + _draw_axis_label(Y_AXIS, PSTR(MSG_Y), blink); + lcd.print(ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS]))); - #endif // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) + #endif // HOTENDS > 1 || TEMP_SENSOR_BED != 0 #endif // LCD_WIDTH >= 20 lcd.setCursor(LCD_WIDTH - 8, 1); - _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])), blink); + _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink); + lcd.print(ftostr52sp(FIXFLOAT(current_position[Z_AXIS]))); - #if HAS_LEVELING && !HAS_HEATED_BED + #if HAS_LEVELING lcd.write(planner.leveling_active || blink ? '_' : ' '); #endif @@ -867,7 +838,7 @@ static void lcd_implementation_status_screen() { lcd.setCursor(7, 2); lcd_printPGM(PSTR("SD")); - if (IS_SD_PRINTING()) + if (IS_SD_PRINTING) lcd.print(itostr3(card.percentDone())); else lcd_printPGM(PSTR("---")); @@ -924,76 +895,35 @@ static void lcd_implementation_status_screen() { #if ENABLED(STATUS_MESSAGE_SCROLLING) static bool last_blink = false; - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); - - // If the string fits into the LCD, just print it and do not scroll it - if (slen <= LCD_WIDTH) { - - // The string isn't scrolling and may not fill the screen - lcd_print_utf(lcd_status_message); - - // Fill the rest with spaces - while (slen < LCD_WIDTH) { - lcd.write(' '); - ++slen; - } - } + const uint8_t slen = lcd_strlen(lcd_status_message); + const char *stat = lcd_status_message + status_scroll_pos; + if (slen <= LCD_WIDTH) + lcd_print_utf(stat); // The string isn't scrolling else { - // String is larger than the available space in screen. - - // Get a pointer to the next valid UTF8 character - const char *stat = lcd_status_message + status_scroll_offset; - - // Get the string remaining length - const uint8_t rlen = utf8_strlen(stat); - - // If we have enough characters to display - if (rlen >= LCD_WIDTH) { - // The remaining string fills the screen - Print it - lcd_print_utf(stat, LCD_WIDTH); - } + if (status_scroll_pos <= slen - LCD_WIDTH) + lcd_print_utf(stat); // The string fills the screen else { - - // The remaining string does not completely fill the screen - lcd_print_utf(stat, LCD_WIDTH); // The string leaves space - uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters - - lcd.write('.'); // Always at 1+ spaces left, draw a dot - if (--chars) { // Draw a second dot if there's space - lcd.write('.'); - if (--chars) - lcd_print_utf(lcd_status_message, chars); // Print a second copy of the message + uint8_t chars = LCD_WIDTH; + if (status_scroll_pos < slen) { // First string still visible + lcd_print_utf(stat); // The string leaves space + chars -= slen - status_scroll_pos; // Amount of space left + } + lcd.write('.'); // Always at 1+ spaces left, draw a dot + if (--chars) { + if (status_scroll_pos < slen + 1) // Draw a second dot if there's space + --chars, lcd.write('.'); + if (chars) lcd_print_utf(lcd_status_message, chars); // Print a second copy of the message } } if (last_blink != blink) { last_blink = blink; - - // Adjust by complete UTF8 characters - if (status_scroll_offset < slen) { - status_scroll_offset++; - while (!START_OF_UTF8_CHAR(lcd_status_message[status_scroll_offset])) - status_scroll_offset++; - } - else - status_scroll_offset = 0; + // Skip any non-printing bytes + if (status_scroll_pos < slen) while (!PRINTABLE(lcd_status_message[status_scroll_pos])) status_scroll_pos++; + if (++status_scroll_pos >= slen + 2) status_scroll_pos = 0; } } #else - UNUSED(blink); - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); - - // Just print the string to the LCD - lcd_print_utf(lcd_status_message, LCD_WIDTH); - - // Fill the rest with spaces if there are missing spaces - while (slen < LCD_WIDTH) { - lcd.write(' '); - ++slen; - } + lcd_print_utf(lcd_status_message); #endif } @@ -1001,10 +931,10 @@ static void lcd_implementation_status_screen() { #if ENABLED(ADVANCED_PAUSE_FEATURE) - static void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder=active_extruder) { + static void lcd_implementation_hotend_status(const uint8_t row) { if (row < LCD_HEIGHT) { lcd.setCursor(LCD_WIDTH - 9, row); - _draw_heater_status(extruder, LCD_STR_THERMOMETER[0], lcd_blink()); + _draw_heater_status(active_extruder, LCD_STR_THERMOMETER[0], lcd_blink()); } } @@ -1016,7 +946,7 @@ static void lcd_implementation_status_screen() { int8_t n = LCD_WIDTH; lcd.setCursor(0, row); if (center && !valstr) { - int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; + int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; while (--pad >= 0) { lcd.write(' '); n--; } } while (n > 0 && (c = pgm_read_byte(pstr))) { @@ -1045,7 +975,7 @@ static void lcd_implementation_status_screen() { static void lcd_implementation_drawmenu_setting_edit_generic(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char* const data) { char c; - uint8_t n = LCD_WIDTH - 2 - utf8_strlen(data); + uint8_t n = LCD_WIDTH - 2 - lcd_strlen(data); lcd.setCursor(0, row); lcd.print(sel ? pre_char : ' '); while ((c = pgm_read_byte(pstr)) && n > 0) { @@ -1058,7 +988,7 @@ static void lcd_implementation_status_screen() { } static void lcd_implementation_drawmenu_setting_edit_generic_P(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char* const data) { char c; - uint8_t n = LCD_WIDTH - 2 - utf8_strlen_P(data); + uint8_t n = LCD_WIDTH - 2 - lcd_strlen_P(data); lcd.setCursor(0, row); lcd.print(sel ? pre_char : ' '); while ((c = pgm_read_byte(pstr)) && n > 0) { @@ -1075,11 +1005,11 @@ static void lcd_implementation_status_screen() { void lcd_implementation_drawedit(const char* pstr, const char* const value=NULL) { lcd.setCursor(1, 1); - lcd_printPGM_utf(pstr); + lcd_printPGM(pstr); if (value != NULL) { lcd.write(':'); - const uint8_t valrow = (utf8_strlen_P(pstr) + 1 + utf8_strlen(value) + 1) > (LCD_WIDTH - 2) ? 2 : 1; // Value on the next row if it won't fit - lcd.setCursor((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), valrow); // Right-justified, padded by spaces + const uint8_t valrow = (lcd_strlen_P(pstr) + 1 + lcd_strlen(value) + 1) > (LCD_WIDTH - 2) ? 2 : 1; // Value on the next row if it won't fit + lcd.setCursor((LCD_WIDTH - 1) - (lcd_strlen(value) + 1), valrow); // Right-justified, padded by spaces lcd.write(' '); // overwrite char if value gets shorter lcd_print(value); } @@ -1087,29 +1017,29 @@ static void lcd_implementation_status_screen() { #if ENABLED(SDSUPPORT) - static void lcd_implementation_drawmenu_sd(const bool sel, const uint8_t row, const char* const pstr, CardReader& theCard, const uint8_t concat, const char post_char) { + static void lcd_implementation_drawmenu_sd(const bool sel, const uint8_t row, const char* const pstr, const char* filename, char* const longFilename, const uint8_t concat, const char post_char) { UNUSED(pstr); lcd.setCursor(0, row); lcd.print(sel ? '>' : ' '); uint8_t n = LCD_WIDTH - concat; - const char *outstr = theCard.longest_filename(); - if (theCard.longFilename[0]) { + const char *outstr = longFilename[0] ? longFilename : filename; + if (longFilename[0]) { #if ENABLED(SCROLL_LONG_FILENAMES) if (sel) { uint8_t name_hash = row; for (uint8_t l = FILENAME_LENGTH; l--;) - name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ theCard.filename[l]; // rotate, xor + name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ filename[l]; // rotate, xor if (filename_scroll_hash != name_hash) { // If the hash changed... filename_scroll_hash = name_hash; // Save the new hash - filename_scroll_max = MAX(0, utf8_strlen(theCard.longFilename) - n); // Update the scroll limit + filename_scroll_max = max(0, lcd_strlen(longFilename) - n); // Update the scroll limit filename_scroll_pos = 0; // Reset scroll to the start lcd_status_update_delay = 8; // Don't scroll right away } outstr += filename_scroll_pos; } #else - theCard.longFilename[n] = '\0'; // cutoff at screen edge + longFilename[n] = '\0'; // cutoff at screen edge #endif } @@ -1123,12 +1053,12 @@ static void lcd_implementation_status_screen() { lcd.print(post_char); } - static void lcd_implementation_drawmenu_sdfile(const bool sel, const uint8_t row, const char* pstr, CardReader& theCard) { - lcd_implementation_drawmenu_sd(sel, row, pstr, theCard, 2, ' '); + static void lcd_implementation_drawmenu_sdfile(const bool sel, const uint8_t row, const char* pstr, const char* filename, char* const longFilename) { + lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, ' '); } - static void lcd_implementation_drawmenu_sddirectory(const bool sel, const uint8_t row, const char* pstr, CardReader& theCard) { - lcd_implementation_drawmenu_sd(sel, row, pstr, theCard, 2, LCD_STR_FOLDER[0]); + static void lcd_implementation_drawmenu_sddirectory(const bool sel, const uint8_t row, const char* pstr, const char* filename, char* const longFilename) { + lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, LCD_STR_FOLDER[0]); } #endif // SDSUPPORT @@ -1294,10 +1224,10 @@ static void lcd_implementation_status_screen() { * Show X and Y positions */ _XLABEL(_PLOT_X, 0); - lcd.print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x])))); + lcd.print(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x])))); _YLABEL(_LCD_W_POS, 0); - lcd.print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y])))); + lcd.print(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y])))); lcd.setCursor(_PLOT_X, 0); @@ -1374,18 +1304,18 @@ static void lcd_implementation_status_screen() { } clear_custom_char(&new_char); - new_char.custom_char_bits[0] = 0b11111U; // char #0 is used for the top line of the box + new_char.custom_char_bits[0] = 0B11111U; // char #0 is used for the top line of the box lcd.createChar(0, (uint8_t*)&new_char); clear_custom_char(&new_char); k = (GRID_MAX_POINTS_Y) * pixels_per_y_mesh_pnt + 1; // row of pixels for the bottom box line l = k % (ULTRA_Y_PIXELS_PER_CHAR); // row within relevant character cell - new_char.custom_char_bits[l] = 0b11111U; // char #1 is used for the bottom line of the box + new_char.custom_char_bits[l] = 0B11111U; // char #1 is used for the bottom line of the box lcd.createChar(1, (uint8_t*)&new_char); clear_custom_char(&new_char); for (j = 0; j < ULTRA_Y_PIXELS_PER_CHAR; j++) - new_char.custom_char_bits[j] = 0b10000U; // char #2 is used for the left edge of the box + new_char.custom_char_bits[j] = 0B10000U; // char #2 is used for the left edge of the box lcd.createChar(2, (uint8_t*)&new_char); clear_custom_char(&new_char); @@ -1415,7 +1345,7 @@ static void lcd_implementation_status_screen() { //dump_custom_char("at entry:", &new_char); clear_custom_char(&new_char); - const uint8_t ypix = MIN(upper_left.y_pixel_offset + pixels_per_y_mesh_pnt, ULTRA_Y_PIXELS_PER_CHAR); + const uint8_t ypix = min(upper_left.y_pixel_offset + pixels_per_y_mesh_pnt, ULTRA_Y_PIXELS_PER_CHAR); for (j = upper_left.y_pixel_offset; j < ypix; j++) { i = upper_left.x_pixel_mask; for (k = 0; k < pixels_per_x_mesh_pnt; k++) { @@ -1530,9 +1460,9 @@ static void lcd_implementation_status_screen() { * Show all values at right of screen */ _XLABEL(_LCD_W_POS, 1); - lcd.print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x])))); + lcd.print(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x])))); _YLABEL(_LCD_W_POS, 2); - lcd.print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y])))); + lcd.print(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y])))); /** * Show the location value diff --git a/Marlin/ultralcd_st7565_u8glib_VIKI.h b/Marlin/ultralcd_st7565_u8glib_VIKI.h index adb48ea..2121b70 100644 --- a/Marlin/ultralcd_st7565_u8glib_VIKI.h +++ b/Marlin/ultralcd_st7565_u8glib_VIKI.h @@ -24,7 +24,6 @@ #define ULCDST7565_H #include -#include "delay.h" #define ST7565_CLK_PIN DOGLCD_SCK #define ST7565_DAT_PIN DOGLCD_MOSI @@ -39,9 +38,9 @@ #pragma GCC optimize (3) // If you want you can define your own set of delays in Configuration.h -//#define ST7565_DELAY_1 DELAY_NS(0) -//#define ST7565_DELAY_2 DELAY_NS(0) -//#define ST7565_DELAY_3 DELAY_NS(0) +//#define ST7565_DELAY_1 DELAY_0_NOP +//#define ST7565_DELAY_2 DELAY_0_NOP +//#define ST7565_DELAY_3 DELAY_0_NOP /* #define ST7565_DELAY_1 u8g_10MicroDelay() @@ -50,25 +49,25 @@ */ #if F_CPU >= 20000000 - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(0) - #define CPU_ST7565_DELAY_3 DELAY_NS(63) + #define CPU_ST7565_DELAY_1 DELAY_0_NOP + #define CPU_ST7565_DELAY_2 DELAY_0_NOP + #define CPU_ST7565_DELAY_3 DELAY_1_NOP #elif MB(3DRAG) || MB(K8200) || MB(K8400) - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(188) - #define CPU_ST7565_DELAY_3 DELAY_NS(0) + #define CPU_ST7565_DELAY_1 DELAY_0_NOP + #define CPU_ST7565_DELAY_2 DELAY_3_NOP + #define CPU_ST7565_DELAY_3 DELAY_0_NOP #elif MB(MINIRAMBO) - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(250) - #define CPU_ST7565_DELAY_3 DELAY_NS(0) + #define CPU_ST7565_DELAY_1 DELAY_0_NOP + #define CPU_ST7565_DELAY_2 DELAY_4_NOP + #define CPU_ST7565_DELAY_3 DELAY_0_NOP #elif MB(RAMBO) - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(0) - #define CPU_ST7565_DELAY_3 DELAY_NS(0) + #define CPU_ST7565_DELAY_1 DELAY_0_NOP + #define CPU_ST7565_DELAY_2 DELAY_0_NOP + #define CPU_ST7565_DELAY_3 DELAY_0_NOP #elif F_CPU == 16000000 - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(0) - #define CPU_ST7565_DELAY_3 DELAY_NS(63) + #define CPU_ST7565_DELAY_1 DELAY_0_NOP + #define CPU_ST7565_DELAY_2 DELAY_0_NOP + #define CPU_ST7565_DELAY_3 DELAY_1_NOP #else #error "No valid condition for delays in 'ultralcd_st7565_u8glib_VIKI.h'" #endif @@ -83,16 +82,12 @@ #define ST7565_DELAY_3 CPU_ST7565_DELAY_3 #endif -// On Viki2 the LCD and the SD card share a single SPI -#define HARDWARE_SPI ((DOGLCD_SCK == SCK_PIN) && (DOGLCD_MOSI == MOSI_PIN)) +#if ENABLED(SHARED_SPI) // Re-ARM requires that the LCD and the SD card share a single SPI -#if HARDWARE_SPI // using the hardware SPI - - #define ST7565_WRITE_BYTE(a) { SPDR = a; while (!TEST(SPSR, SPIF)); U8G_DELAY(); } - #define ST7560_WriteSequence(count, pointer) { uint8_t *ptr = pointer; for (uint8_t i = 0; i < count; i++) {SPDR = *ptr++; while (!TEST(SPSR, SPIF));} U8G_DELAY(); } - -#else // !HARDWARE_SPI + #define ST7565_WRITE_BYTE(a) { spiSend((uint8_t)a); U8G_DELAY(); } + #define ST7560_WriteSequence(count, pointer) { uint8_t *ptr = pointer; for (uint8_t i = 0; i < count; i++) {spiSend( *ptr++);} DELAY_10US; } +#else #define ST7565_SND_BIT \ WRITE(ST7565_CLK_PIN, LOW); ST7565_DELAY_1; \ WRITE(ST7565_DAT_PIN, val & 0x80); ST7565_DELAY_2; \ @@ -112,144 +107,134 @@ } #define ST7565_WRITE_BYTE(a) { ST7565_SWSPI_SND_8BIT((uint8_t)a); U8G_DELAY(); } - #define ST7560_WriteSequence(count, pointer) { uint8_t *ptr = pointer; for (uint8_t i = 0; i < count; i++) { ST7565_SWSPI_SND_8BIT(*ptr++); } U8G_DELAY(); } + #define ST7560_WriteSequence(count, pointer) { uint8_t *ptr = pointer; for (uint8_t i = 0; i < count; i++) {ST7565_SWSPI_SND_8BIT( *ptr++);} DELAY_10US; } +#endif -#endif // !HARDWARE_SPI - -#if DOGM_SPI_DELAY_US > 0 - #define U8G_DELAY() DELAY_US(DOGM_SPI_DELAY_US) +#if defined(DOGM_SPI_DELAY_US) && DOGM_SPI_DELAY_US > 0 + #define U8G_DELAY() delayMicroseconds(DOGM_SPI_DELAY_US) #else #define U8G_DELAY() u8g_10MicroDelay() #endif -#define ST7565_CS() do{ WRITE(ST7565_CS_PIN, HIGH); U8G_DELAY(); }while(0) -#define ST7565_NCS() WRITE(ST7565_CS_PIN, LOW) -#define ST7565_A0() do{ WRITE(ST7565_A0_PIN, HIGH); U8G_DELAY(); }while(0) -#define ST7565_NA0() WRITE(ST7565_A0_PIN, LOW) +#define ST7565_CS() { WRITE(ST7565_CS_PIN,1); U8G_DELAY(); } +#define ST7565_NCS() { WRITE(ST7565_CS_PIN,0); } +#define ST7565_A0() { WRITE(ST7565_A0_PIN,1); U8G_DELAY(); } +#define ST7565_NA0() { WRITE(ST7565_A0_PIN,0); } -#define ST7565_ADC_REVERSE(N) ST7565_WRITE_BYTE(0xA0 | ((N) & 0x1)) -#define ST7565_BIAS_MODE(N) ST7565_WRITE_BYTE(0xA2 | ((N) & 0x1)) -#define ST7565_ALL_PIX(N) ST7565_WRITE_BYTE(0xA4 | ((N) & 0x1)) -#define ST7565_INVERTED(N) ST7565_WRITE_BYTE(0xA6 | ((N) & 0x1)) -#define ST7565_ON(N) ST7565_WRITE_BYTE(0xAE | ((N) & 0x1)) -#define ST7565_OUT_MODE(N) ST7565_WRITE_BYTE(0xC0 | ((N) & 0x1) << 3) -#define ST7565_POWER_CONTROL(N) ST7565_WRITE_BYTE(0x28 | (N)) -#define ST7565_V0_RATIO(N) ST7565_WRITE_BYTE(0x10 | ((N) & 0x7)) // Specific to Displaytech 64128N? (ST7565 is 0x20 | N) -#define ST7565_CONTRAST(N) do{ ST7565_WRITE_BYTE(0x81); ST7565_WRITE_BYTE(N); }while(0) - -#define ST7565_COLUMN_ADR(N) do{ ST7565_WRITE_BYTE(0x10 | (((N) >> 4) & 0xF)); ST7565_WRITE_BYTE((N) & 0xF); }while(0) -#define ST7565_PAGE_ADR(N) ST7565_WRITE_BYTE(0xB0 | (N)) -#define ST7565_START_LINE(N) ST7565_WRITE_BYTE(0x40 | (N)) -#define ST7565_SLEEP_MODE() ST7565_WRITE_BYTE(0xAC) -#define ST7565_NOOP() ST7565_WRITE_BYTE(0xE3) uint8_t u8g_dev_st7565_64128n_2x_VIKI_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { switch (msg) { - case U8G_DEV_MSG_INIT: { - OUT_WRITE(ST7565_CS_PIN, LOW); - OUT_WRITE(ST7565_DAT_PIN, LOW); - OUT_WRITE(ST7565_CLK_PIN, LOW); - - #if HARDWARE_SPI - OUT_WRITE(SDSS, 1); // must be set to an output first or else will never go into master mode - SPCR = 0x50; // enable SPI in master mode at fast speed - SPSR = 1; // kick it up to 2x speed mode + #if ENABLED(SHARED_SPI) + u8g_Delay(250); + spiBegin(); + #ifndef SPI_SPEED + #define SPI_SPEED SPI_FULL_SPEED // use same SPI speed as SD card + #endif + spiInit(SPI_SPEED); + #else + OUT_WRITE(ST7565_DAT_PIN, LOW); + OUT_WRITE(ST7565_CLK_PIN, LOW); #endif - OUT_WRITE(ST7565_A0_PIN, LOW); - ST7565_CS(); // chip select off - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select + ST7565_CS(); /* disable chip */ + ST7565_NA0(); /* instruction mode */ + ST7565_NCS(); /* enable chip */ - ST7565_BIAS_MODE(0); // 0xA2: LCD bias 1/9 (according to Displaytech 64128N datasheet) - ST7565_ADC_REVERSE(0); // Normal (not flipped) ADC Select (according to Displaytech 64128N datasheet) + ST7565_WRITE_BYTE(0x0A2); /* 0x0A2: LCD bias 1/9 (according to Displaytech 64128N datasheet) */ + ST7565_WRITE_BYTE(0x0A0); /* Normal ADC Select (according to Displaytech 64128N datasheet) */ - ST7565_OUT_MODE(1); // common output mode: set scan direction normal operation/SHL Select; 0x0C0 --> SHL = 0; normal; 0x0C8 --> SHL = 1 - ST7565_START_LINE(0); // Display start line for Displaytech 64128N + ST7565_WRITE_BYTE(0x0C8); /* common output mode: set scan direction normal operation/SHL Select; 0x0C0 --> SHL = 0; normal; 0x0C8 --> SHL = 1 */ + ST7565_WRITE_BYTE(0x040); /* Display start line for Displaytech 64128N */ - ST7565_POWER_CONTROL(0x4); // power control: turn on Booster - U8G_ESC_DLY(50); // delay 50 ms - hangs after a reset if used + ST7565_WRITE_BYTE(0x028 | 0x04); /* power control: turn on voltage converter */ + //U8G_ESC_DLY(50); /* delay 50 ms - hangs after a reset if used */ - ST7565_POWER_CONTROL(0x6); // power control: turn on Booster, Voltage Regulator - U8G_ESC_DLY(50); // delay 50 ms - hangs after a reset if used + ST7565_WRITE_BYTE(0x028 | 0x06); /* power control: turn on voltage regulator */ + //U8G_ESC_DLY(50); /* delay 50 ms - hangs after a reset if used */ - ST7565_POWER_CONTROL(0x7); // power control: turn on Booster, Voltage Regulator, Voltage Follower - U8G_ESC_DLY(50); // delay 50 ms - hangs after a reset if used + ST7565_WRITE_BYTE(0x028 | 0x07); /* power control: turn on voltage follower */ + //U8G_ESC_DLY(50); /* delay 50 ms - hangs after a reset if used */ - ST7565_V0_RATIO(0); // Set V0 Voltage Resistor ratio. Setting for controlling brightness of Displaytech 64128N + ST7565_WRITE_BYTE(0x010); /* Set V0 voltage resistor ratio. Setting for controlling brightness of Displaytech 64128N */ - ST7565_INVERTED(0); // display normal, bit val 0: LCD pixel off. + ST7565_WRITE_BYTE(0x0A6); /* display normal, bit val 0: LCD pixel off. */ - ST7565_CONTRAST(0x1E); // Contrast value. Setting for controlling contrast of Displaytech 64128N + ST7565_WRITE_BYTE(0x081); /* set contrast */ + ST7565_WRITE_BYTE(0x01E); /* Contrast value. Setting for controlling brightness of Displaytech 64128N */ - ST7565_ON(1); // display on + ST7565_WRITE_BYTE(0x0AF); /* display on */ - U8G_ESC_DLY(100); // delay 100 ms - ST7565_ALL_PIX(1); // display all points; ST7565 - U8G_ESC_DLY(100); // delay 100 ms - U8G_ESC_DLY(100); // delay 100 ms - ST7565_ALL_PIX(0); // normal display - ST7565_CS(); // chip select off - } // end of sequence + U8G_ESC_DLY(100); /* delay 100 ms */ + ST7565_WRITE_BYTE(0x0A5); /* display all points; ST7565 */ + U8G_ESC_DLY(100); /* delay 100 ms */ + U8G_ESC_DLY(100); /* delay 100 ms */ + ST7565_WRITE_BYTE(0x0A4); /* normal display */ + ST7565_CS(); /* disable chip */ + } /* end of sequence */ break; case U8G_DEV_MSG_STOP: break; case U8G_DEV_MSG_PAGE_NEXT: { - u8g_pb_t *pb = (u8g_pb_t*)(dev->dev_mem); - ST7565_CS(); // chip select off - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - ST7565_COLUMN_ADR(0x00); // high 4 bits to 0, low 4 bits to 0. Changed for DisplayTech 64128N - // end of sequence - ST7565_PAGE_ADR(2 * pb->p.page); // select current page (ST7565R) - ST7565_A0(); // data mode - ST7560_WriteSequence((uint8_t)pb->width, (uint8_t*)pb->buf); - ST7565_CS(); // chip select off - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - ST7565_COLUMN_ADR(0x00); // high 4 bits to 0, low 4 bits to 0 - // end of sequence - ST7565_PAGE_ADR(2 * pb->p.page + 1); // select current page (ST7565R) - ST7565_A0(); // data mode - ST7560_WriteSequence((uint8_t)pb->width, (uint8_t*)(pb->buf) + pb->width); - ST7565_CS(); // chip select off + u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem); + ST7565_CS(); /* disable chip */ + ST7565_NA0(); /* instruction mode */ + ST7565_NCS(); /* enable chip */ + ST7565_WRITE_BYTE(0x010); /* set upper 4 bit of the col adr to 0x10 */ + ST7565_WRITE_BYTE(0x000); /* set lower 4 bit of the col adr to 0x00. Changed for DisplayTech 64128N */ + /* end of sequence */ + ST7565_WRITE_BYTE(0x0B0 | (2*pb->p.page));; /* select current page (ST7565R) */ + ST7565_A0(); /* data mode */ + ST7560_WriteSequence( (uint8_t) pb->width, (uint8_t *)pb->buf); + ST7565_CS(); /* disable chip */ + ST7565_NA0(); /* instruction mode */ + ST7565_NCS(); /* enable chip */ + ST7565_WRITE_BYTE(0x010); /* set upper 4 bit of the col adr to 0x10 */ + ST7565_WRITE_BYTE(0x000); /* set lower 4 bit of the col adr to 0x00. Changed for DisplayTech 64128N */ + /* end of sequence */ + ST7565_WRITE_BYTE(0x0B0 | (2*pb->p.page+1)); /* select current page (ST7565R) */ + ST7565_A0(); /* data mode */ + ST7560_WriteSequence( (uint8_t) pb->width, (uint8_t *)(pb->buf)+pb->width); + ST7565_CS(); /* disable chip */ } break; case U8G_DEV_MSG_CONTRAST: ST7565_NCS(); - ST7565_NA0(); // instruction mode - ST7565_CONTRAST((*(uint8_t*)arg) >> 2); - ST7565_CS(); // chip select off + ST7565_NA0(); /* instruction mode */ + ST7565_WRITE_BYTE(0x081); + ST7565_WRITE_BYTE((*(uint8_t *)arg) >> 2); + ST7565_CS(); /* disable chip */ return 1; case U8G_DEV_MSG_SLEEP_ON: - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - ST7565_SLEEP_MODE(); // static indicator off - //ST7565_WRITE_BYTE(0x00); // indicator register set (not sure if this is required) - ST7565_ON(0); // display off - ST7565_ALL_PIX(1); // all points on - ST7565_CS(); // chip select off + ST7565_NA0(); /* instruction mode */ + ST7565_NCS(); /* enable chip */ + ST7565_WRITE_BYTE(0x0AC); /* static indicator off */ + ST7565_WRITE_BYTE(0x000); /* indicator register set (not sure if this is required) */ + ST7565_WRITE_BYTE(0x0AE); /* display off */ + ST7565_WRITE_BYTE(0x0A5); /* all points on */ + ST7565_CS(); /* disable chip , bugfix 12 nov 2014 */ + /* end of sequence */ return 1; case U8G_DEV_MSG_SLEEP_OFF: - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - ST7565_ALL_PIX(0); // all points off - ST7565_ON(1); // display on - U8G_ESC_DLY(50); // delay 50 ms - ST7565_CS(); // chip select off + ST7565_NA0(); /* instruction mode */ + ST7565_NCS(); /* enable chip */ + ST7565_WRITE_BYTE(0x0A4); /* all points off */ + ST7565_WRITE_BYTE(0x0AF); /* display on */ + U8G_ESC_DLY(50); /* delay 50 ms */ + ST7565_CS(); /* disable chip , bugfix 12 nov 2014 */ + /* end of sequence */ return 1; } return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg); } -uint8_t u8g_dev_st7565_64128n_2x_VIKI_buf[LCD_PIXEL_WIDTH * 2] U8G_NOCOMMON; +uint8_t u8g_dev_st7565_64128n_2x_VIKI_buf[LCD_PIXEL_WIDTH*2] U8G_NOCOMMON; u8g_pb_t u8g_dev_st7565_64128n_2x_VIKI_pb = {{16, LCD_PIXEL_HEIGHT, 0, 0, 0}, LCD_PIXEL_WIDTH, u8g_dev_st7565_64128n_2x_VIKI_buf}; u8g_dev_t u8g_dev_st7565_64128n_2x_VIKI_sw_spi = {u8g_dev_st7565_64128n_2x_VIKI_fn, &u8g_dev_st7565_64128n_2x_VIKI_pb, &u8g_com_null_fn}; diff --git a/Marlin/ultralcd_st7920_u8glib_rrd.h b/Marlin/ultralcd_st7920_u8glib_rrd.h index b65a165..67de461 100644 --- a/Marlin/ultralcd_st7920_u8glib_rrd.h +++ b/Marlin/ultralcd_st7920_u8glib_rrd.h @@ -24,7 +24,6 @@ #define ULCDST7920_H #include -#include "delay.h" #define ST7920_CLK_PIN LCD_PINS_D4 #define ST7920_DAT_PIN LCD_PINS_ENABLE @@ -41,34 +40,30 @@ #pragma GCC optimize (3) // If you want you can define your own set of delays in Configuration.h -//#define ST7920_DELAY_1 DELAY_NS(0) -//#define ST7920_DELAY_2 DELAY_NS(0) -//#define ST7920_DELAY_3 DELAY_NS(0) +//#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_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(50) + #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 MB(3DRAG) || MB(K8200) || MB(K8400) || MB(SILVER_GATE) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(188) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(MINIRAMBO) || MB(EINSY_RAMBO) || MB(EINSY_RETRO) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(250) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) + #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 MB(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 MB(RAMBO) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(BQ_ZUM_MEGA_3D) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(189) + #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_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(63) + #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 @@ -100,8 +95,8 @@ static void ST7920_SWSPI_SND_8BIT(uint8_t val) { ST7920_SND_BIT; // 8 } -#if DOGM_SPI_DELAY_US > 0 - #define U8G_DELAY() DELAY_US(DOGM_SPI_DELAY_US) +#if defined(DOGM_SPI_DELAY_US) && DOGM_SPI_DELAY_US > 0 + #define U8G_DELAY() delayMicroseconds(DOGM_SPI_DELAY_US) #else #define U8G_DELAY() u8g_10MicroDelay() #endif @@ -124,12 +119,10 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo ST7920_CS(); u8g_Delay(120); //initial delay for boot up ST7920_SET_CMD(); - ST7920_WRITE_BYTE(0x20); //non-extended mode ST7920_WRITE_BYTE(0x08); //display off, cursor+blink off - ST7920_WRITE_BYTE(0x01); //clear DDRAM ram - u8g_Delay(15); //delay for DDRAM clear - ST7920_WRITE_BYTE(0x24); //extended mode - ST7920_WRITE_BYTE(0x26); //extended mode + GDRAM active + ST7920_WRITE_BYTE(0x01); //clear CGRAM ram + u8g_Delay(15); //delay for CGRAM clear + ST7920_WRITE_BYTE(0x3E); //extended mode + GDRAM active for (y = 0; y < (LCD_PIXEL_HEIGHT) / 2; y++) { //clear GDRAM ST7920_WRITE_BYTE(0x80 | y); //set y ST7920_WRITE_BYTE(0x80); //set x = 0 @@ -188,12 +181,6 @@ class U8GLIB_ST7920_128X64_RRD : public U8GLIB { U8GLIB_ST7920_128X64_RRD(uint8_t dummy) : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi) { UNUSED(dummy); } }; -#if ENABLED(LIGHTWEIGHT_UI) - // We have to include the code for the lightweight UI here - // as it relies on macros that are only defined in this file. - #include "status_screen_lite_ST7920_spi.h" -#endif - #pragma GCC reset_options #endif // ULCDST7920_H diff --git a/Marlin/utf_mapper.h b/Marlin/utf_mapper.h index aacf2f1..c49e6fc 100644 --- a/Marlin/utf_mapper.h +++ b/Marlin/utf_mapper.h @@ -144,7 +144,7 @@ #endif // DISPLAY_CHARSET_HD44780 #endif // SIMULATE_ROMFONT -#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) +#define PRINTABLE(C) (((C) & 0xC0u) != 0x80u) #if ENABLED(MAPPER_C2C3) diff --git a/Marlin/utility.cpp b/Marlin/utility.cpp index 88a0503..0f59193 100644 --- a/Marlin/utility.cpp +++ b/Marlin/utility.cpp @@ -40,14 +40,14 @@ void safe_delay(millis_t ms) { uint8_t *ptr = (uint8_t *)data; while (cnt--) { *crc = (uint16_t)(*crc ^ (uint16_t)(((uint16_t)*ptr++) << 8)); - for (uint8_t i = 0; i < 8; i++) + for (uint8_t x = 0; x < 8; x++) *crc = (uint16_t)((*crc & 0x8000) ? ((uint16_t)(*crc << 1) ^ 0x1021) : (*crc << 1)); } } #endif // EEPROM_SETTINGS -#if ENABLED(ULTRA_LCD) || (ENABLED(DEBUG_LEVELING_FEATURE) && (ENABLED(MESH_BED_LEVELING) || (HAS_ABL && !ABL_PLANAR))) +#if ENABLED(ULTRA_LCD) char conv[8] = { 0 }; @@ -57,190 +57,193 @@ void safe_delay(millis_t ms) { #define MINUSOR(n, alt) (n >= 0 ? (alt) : (n = -n, '-')) // Convert unsigned int to string 123 format - char* i8tostr3(const uint8_t i) { - conv[4] = RJDIGIT(i, 100); - conv[5] = RJDIGIT(i, 10); - conv[6] = DIGIMOD(i, 1); + char* i8tostr3(const uint8_t xx) { + conv[4] = RJDIGIT(xx, 100); + conv[5] = RJDIGIT(xx, 10); + conv[6] = DIGIMOD(xx, 1); return &conv[4]; } // Convert signed int to rj string with 123 or -12 format - char* itostr3(int i) { - conv[4] = MINUSOR(i, RJDIGIT(i, 100)); - conv[5] = RJDIGIT(i, 10); - conv[6] = DIGIMOD(i, 1); + char* itostr3(const int x) { + int xx = x; + conv[4] = MINUSOR(xx, RJDIGIT(xx, 100)); + conv[5] = RJDIGIT(xx, 10); + conv[6] = DIGIMOD(xx, 1); return &conv[4]; } // Convert unsigned int to lj string with 123 format - char* itostr3left(const int i) { + char* itostr3left(const int xx) { char *str = &conv[6]; - *str = DIGIMOD(i, 1); - if (i >= 10) { - *(--str) = DIGIMOD(i, 10); - if (i >= 100) - *(--str) = DIGIMOD(i, 100); + *str = DIGIMOD(xx, 1); + if (xx >= 10) { + *(--str) = DIGIMOD(xx, 10); + if (xx >= 100) + *(--str) = DIGIMOD(xx, 100); } return str; } // Convert signed int to rj string with 1234, _123, -123, _-12, or __-1 format - char* itostr4sign(const int i) { - const bool neg = i < 0; - const int ii = neg ? -i : i; - if (i >= 1000) { - conv[3] = DIGIMOD(ii, 1000); - conv[4] = DIGIMOD(ii, 100); - conv[5] = DIGIMOD(ii, 10); - } - else if (ii >= 100) { - conv[3] = neg ? '-' : ' '; - conv[4] = DIGIMOD(ii, 100); - conv[5] = DIGIMOD(ii, 10); + char *itostr4sign(const int x) { + const bool neg = x < 0; + const int xx = neg ? -x : x; + if (x >= 1000) { + conv[3] = DIGIMOD(xx, 1000); + conv[4] = DIGIMOD(xx, 100); + conv[5] = DIGIMOD(xx, 10); } else { - conv[3] = ' '; - conv[4] = ' '; - if (ii >= 10) { - conv[4] = neg ? '-' : ' '; - conv[5] = DIGIMOD(ii, 10); + if (xx >= 100) { + conv[3] = neg ? '-' : ' '; + conv[4] = DIGIMOD(xx, 100); + conv[5] = DIGIMOD(xx, 10); } else { - conv[5] = neg ? '-' : ' '; + conv[3] = ' '; + conv[4] = ' '; + if (xx >= 10) { + conv[4] = neg ? '-' : ' '; + conv[5] = DIGIMOD(xx, 10); + } + else { + conv[5] = neg ? '-' : ' '; + } } } - conv[6] = DIGIMOD(ii, 1); + conv[6] = DIGIMOD(xx, 1); return &conv[3]; } // Convert unsigned float to string with 1.23 format - char* ftostr12ns(const float &f) { - const long i = ((f < 0 ? -f : f) * 1000 + 5) / 10; - conv[3] = DIGIMOD(i, 100); + char* ftostr12ns(const float &x) { + const long xx = (x < 0 ? -x : x) * 100; + conv[3] = DIGIMOD(xx, 100); conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); + conv[5] = DIGIMOD(xx, 10); + conv[6] = DIGIMOD(xx, 1); return &conv[3]; } // Convert signed float to fixed-length string with 023.45 / -23.45 format - char* ftostr52(const float &f) { - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; - conv[1] = MINUSOR(i, DIGIMOD(i, 10000)); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); + char *ftostr32(const float &x) { + long xx = x * 100; + conv[1] = MINUSOR(xx, DIGIMOD(xx, 10000)); + conv[2] = DIGIMOD(xx, 1000); + conv[3] = DIGIMOD(xx, 100); conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); + conv[5] = DIGIMOD(xx, 10); + conv[6] = DIGIMOD(xx, 1); return &conv[1]; } #if ENABLED(LCD_DECIMAL_SMALL_XY) // Convert float to rj string with 1234, _123, -123, _-12, 12.3, _1.2, or -1.2 format - char* ftostr4sign(const float &f) { - const int i = (f * 100 + (f < 0 ? -5: 5)) / 10; - if (!WITHIN(i, -99, 999)) return itostr4sign((int)f); - const bool neg = i < 0; - const int ii = neg ? -i : i; - conv[3] = neg ? '-' : (ii >= 100 ? DIGIMOD(ii, 100) : ' '); - conv[4] = DIGIMOD(ii, 10); + char *ftostr4sign(const float &fx) { + const int x = fx * 10; + if (!WITHIN(x, -99, 999)) return itostr4sign((int)fx); + const bool neg = x < 0; + const int xx = neg ? -x : x; + conv[3] = neg ? '-' : (xx >= 100 ? DIGIMOD(xx, 100) : ' '); + conv[4] = DIGIMOD(xx, 10); conv[5] = '.'; - conv[6] = DIGIMOD(ii, 1); + conv[6] = DIGIMOD(xx, 1); return &conv[3]; } #endif // LCD_DECIMAL_SMALL_XY // Convert float to fixed-length string with +123.4 / -123.4 format - char* ftostr41sign(const float &f) { - int i = (f * 100 + (f < 0 ? -5: 5)) / 10; - conv[1] = MINUSOR(i, '+'); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = DIGIMOD(i, 10); + char* ftostr41sign(const float &x) { + int xx = x * 10; + conv[1] = MINUSOR(xx, '+'); + conv[2] = DIGIMOD(xx, 1000); + conv[3] = DIGIMOD(xx, 100); + conv[4] = DIGIMOD(xx, 10); conv[5] = '.'; - conv[6] = DIGIMOD(i, 1); + conv[6] = DIGIMOD(xx, 1); return &conv[1]; } // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format - char* ftostr43sign(const float &f, char plus/*=' '*/) { - long i = (f * 10000 + (f < 0 ? -5: 5)) / 10; - conv[1] = i ? MINUSOR(i, plus) : ' '; - conv[2] = DIGIMOD(i, 1000); + char* ftostr43sign(const float &x, char plus/*=' '*/) { + long xx = x * 1000; + conv[1] = xx ? MINUSOR(xx, plus) : ' '; + conv[2] = DIGIMOD(xx, 1000); conv[3] = '.'; - conv[4] = DIGIMOD(i, 100); - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); + conv[4] = DIGIMOD(xx, 100); + conv[5] = DIGIMOD(xx, 10); + conv[6] = DIGIMOD(xx, 1); return &conv[1]; } // Convert unsigned float to rj string with 12345 format - char* ftostr5rj(const float &f) { - const long i = ((f < 0 ? -f : f) * 10 + 5) / 10; - conv[2] = RJDIGIT(i, 10000); - conv[3] = RJDIGIT(i, 1000); - conv[4] = RJDIGIT(i, 100); - conv[5] = RJDIGIT(i, 10); - conv[6] = DIGIMOD(i, 1); + char* ftostr5rj(const float &x) { + const long xx = x < 0 ? -x : x; + conv[2] = RJDIGIT(xx, 10000); + conv[3] = RJDIGIT(xx, 1000); + conv[4] = RJDIGIT(xx, 100); + conv[5] = RJDIGIT(xx, 10); + conv[6] = DIGIMOD(xx, 1); return &conv[2]; } // Convert signed float to string with +1234.5 format - char* ftostr51sign(const float &f) { - long i = (f * 100 + (f < 0 ? -5: 5)) / 10; - conv[0] = MINUSOR(i, '+'); - conv[1] = DIGIMOD(i, 10000); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = DIGIMOD(i, 10); + char* ftostr51sign(const float &x) { + long xx = x * 10; + conv[0] = MINUSOR(xx, '+'); + conv[1] = DIGIMOD(xx, 10000); + conv[2] = DIGIMOD(xx, 1000); + conv[3] = DIGIMOD(xx, 100); + conv[4] = DIGIMOD(xx, 10); conv[5] = '.'; - conv[6] = DIGIMOD(i, 1); + conv[6] = DIGIMOD(xx, 1); return conv; } // Convert signed float to string with +123.45 format - char* ftostr52sign(const float &f) { - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; - conv[0] = MINUSOR(i, '+'); - conv[1] = DIGIMOD(i, 10000); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); + char* ftostr52sign(const float &x) { + long xx = x * 100; + conv[0] = MINUSOR(xx, '+'); + conv[1] = DIGIMOD(xx, 10000); + conv[2] = DIGIMOD(xx, 1000); + conv[3] = DIGIMOD(xx, 100); conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); + conv[5] = DIGIMOD(xx, 10); + conv[6] = DIGIMOD(xx, 1); return conv; } // Convert unsigned float to string with 1234.56 format omitting trailing zeros - char* ftostr62rj(const float &f) { - const long i = ((f < 0 ? -f : f) * 1000 + 5) / 10; - conv[0] = RJDIGIT(i, 100000); - conv[1] = RJDIGIT(i, 10000); - conv[2] = RJDIGIT(i, 1000); - conv[3] = DIGIMOD(i, 100); + char* ftostr62rj(const float &x) { + const long xx = (x < 0 ? -x : x) * 100; + conv[0] = RJDIGIT(xx, 100000); + conv[1] = RJDIGIT(xx, 10000); + conv[2] = RJDIGIT(xx, 1000); + conv[3] = DIGIMOD(xx, 100); conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); + conv[5] = DIGIMOD(xx, 10); + conv[6] = DIGIMOD(xx, 1); return conv; } // Convert signed float to space-padded string with -_23.4_ format - char* ftostr52sp(const float &f) { - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; + char* ftostr52sp(const float &x) { + long xx = x * 100; uint8_t dig; - conv[1] = MINUSOR(i, RJDIGIT(i, 10000)); - conv[2] = RJDIGIT(i, 1000); - conv[3] = DIGIMOD(i, 100); + conv[1] = MINUSOR(xx, RJDIGIT(xx, 10000)); + conv[2] = RJDIGIT(xx, 1000); + conv[3] = DIGIMOD(xx, 100); - if ((dig = i % 10)) { // second digit after decimal point? + if ((dig = xx % 10)) { // second digit after decimal point? conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); + conv[5] = DIGIMOD(xx, 10); conv[6] = DIGIT(dig); } else { - if ((dig = (i / 10) % 10)) { // first digit after decimal point? + if ((dig = (xx / 10) % 10)) { // first digit after decimal point? conv[4] = '.'; conv[5] = DIGIT(dig); } @@ -251,4 +254,4 @@ void safe_delay(millis_t ms) { return &conv[1]; } -#endif // ULTRA_LCD || (DEBUG_LEVELING_FEATURE && (MESH_BED_LEVELING || (HAS_ABL && !ABL_PLANAR))) +#endif // ULTRA_LCD diff --git a/Marlin/utility.h b/Marlin/utility.h index 991d662..426c583 100644 --- a/Marlin/utility.h +++ b/Marlin/utility.h @@ -23,15 +23,13 @@ #ifndef __UTILITY_H__ #define __UTILITY_H__ -#include "types.h" - void safe_delay(millis_t ms); #if ENABLED(EEPROM_SETTINGS) void crc16(uint16_t *crc, const void * const data, uint16_t cnt); #endif -#if ENABLED(ULTRA_LCD) || (ENABLED(DEBUG_LEVELING_FEATURE) && (ENABLED(MESH_BED_LEVELING) || (HAS_ABL && !ABL_PLANAR))) +#if ENABLED(ULTRA_LCD) // Convert uint8_t to string with 123 format char* i8tostr3(const uint8_t x); @@ -43,13 +41,13 @@ void safe_delay(millis_t ms); char* itostr3left(const int xx); // Convert signed int to rj string with _123, -123, _-12, or __-1 format - char* itostr4sign(const int x); + char *itostr4sign(const int x); // Convert unsigned float to string with 1.23 format char* ftostr12ns(const float &x); // Convert signed float to fixed-length string with 023.45 / -23.45 format - char* ftostr52(const float &x); + char* ftostr32(const float &x); // Convert float to fixed-length string with +123.4 / -123.4 format char* ftostr41sign(const float &x); @@ -73,16 +71,16 @@ void safe_delay(millis_t ms); char* ftostr62rj(const float &x); // Convert float to rj string with 123 or -12 format - FORCE_INLINE char* ftostr3(const float &x) { return itostr3(int(x + (x < 0 ? -0.5f : 0.5f))); } + FORCE_INLINE char *ftostr3(const float &x) { return itostr3((int)x); } #if ENABLED(LCD_DECIMAL_SMALL_XY) // Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format - char* ftostr4sign(const float &fx); + char *ftostr4sign(const float &fx); #else // Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format - FORCE_INLINE char* ftostr4sign(const float &x) { return itostr4sign(int(x + (x < 0 ? -0.5f : 0.5f))); } + FORCE_INLINE char *ftostr4sign(const float &x) { return itostr4sign((int)x); } #endif -#endif // ULTRA_LCD || (DEBUG_LEVELING_FEATURE && (MESH_BED_LEVELING || (HAS_ABL && !ABL_PLANAR))) +#endif // ULTRA_LCD #endif // __UTILITY_H__ diff --git a/Marlin/vector_3.cpp b/Marlin/vector_3.cpp index e5afd9e..f9615bc 100644 --- a/Marlin/vector_3.cpp +++ b/Marlin/vector_3.cpp @@ -38,14 +38,11 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - -#include "MarlinConfig.h" - -#if ABL_PLANAR || (HAS_BED_PROBE && ENABLED(AUTO_BED_LEVELING_UBL)) - -#include "vector_3.h" -#include "serial.h" #include +#include "Marlin.h" + +#if HAS_ABL +#include "vector_3.h" vector_3::vector_3() : x(0), y(0), z(0) { } @@ -69,7 +66,7 @@ vector_3 vector_3::get_normal() { float vector_3::get_length() { return SQRT(sq(x) + sq(y) + sq(z)); } void vector_3::normalize() { - const float inv_length = RSQRT(sq(x) + sq(y) + sq(z)); + const float inv_length = 1.0 / get_length(); x *= inv_length; y *= inv_length; z *= inv_length; @@ -146,10 +143,7 @@ matrix_3x3 matrix_3x3::transpose(matrix_3x3 original) { } void matrix_3x3::debug(const char * const title) { - if (title != NULL) { - serialprintPGM(title); - SERIAL_EOL(); - } + serialprintPGM(title); uint8_t count = 0; for (uint8_t i = 0; i < 3; i++) { for (uint8_t j = 0; j < 3; j++) { @@ -163,3 +157,4 @@ void matrix_3x3::debug(const char * const title) { } #endif // HAS_ABL + diff --git a/Marlin/vector_3.h b/Marlin/vector_3.h index a926600..19f6e3a 100644 --- a/Marlin/vector_3.h +++ b/Marlin/vector_3.h @@ -41,6 +41,8 @@ #ifndef VECTOR_3_H #define VECTOR_3_H +#if HAS_ABL + class matrix_3x3; struct vector_3 { @@ -77,4 +79,5 @@ struct matrix_3x3 { void apply_rotation_xyz(matrix_3x3 rotationMatrix, float &x, float &y, float &z); +#endif // HAS_ABL #endif // VECTOR_3_H diff --git a/README.md b/README.md index 4d55ddc..38b429b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Anycubic i3 Mega Marlin 1.1.9 by davidramiro +# Anycubic i3 Mega Marlin 1.1.8 by davidramiro This is my slightly customized version of the [Marlin Firmware](https://github.com/MarlinFirmware/Marlin), gratefully based on [derhopp's repo](https://github.com/derhopp/Marlin-with-Anycubic-i3-Mega-TFT) with his remarkable efforts to get the Anycubic i3 Mega TFT screen to work. @@ -202,7 +202,6 @@ After flashing the new version, issue a `M502` and `M500`. After that, enter eve - TMC2208 configured in standalone mode - Stepper orientation flipped (you don't have to flip the connectors on the board anymore) - Linear advance unlocked (Off by default. [Research, calibrate](http://marlinfw.org/docs/features/lin_advance.html) and then enable with `M900 Kx`) -- S-Curve Acceleration enabled - G26 Mesh Validation enabled - Some redundant code removed to save memory - Minor tweaks on default jerk and acceleration diff --git a/buildroot/bin/opt_disable b/buildroot/bin/opt_disable index c219f36..35ad1aa 100644 --- a/buildroot/bin/opt_disable +++ b/buildroot/bin/opt_disable @@ -1,7 +1,5 @@ #!/usr/bin/env bash -SED=$(which gsed || which sed) - for opt in "$@" ; do - eval "${SED} -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\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 index bbb7ca5..80d8318 100644 --- a/buildroot/bin/opt_disable_adv +++ b/buildroot/bin/opt_disable_adv @@ -1,7 +1,5 @@ #!/usr/bin/env bash -SED=$(which gsed || which sed) - for opt in "$@" ; do - eval "${SED} -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration_adv.h" + 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 7be02ed..7b119fa 100644 --- a/buildroot/bin/opt_enable +++ b/buildroot/bin/opt_enable @@ -1,7 +1,5 @@ #!/usr/bin/env bash -SED=$(which gsed || which sed) - for opt in "$@" ; do - eval "${SED} -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\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 73a9d95..a34e56f 100644 --- a/buildroot/bin/opt_enable_adv +++ b/buildroot/bin/opt_enable_adv @@ -1,7 +1,5 @@ #!/usr/bin/env bash -SED=$(which gsed || which sed) - for opt in "$@" ; do - eval "${SED} -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\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 c1de22f..cf8c0d8 100644 --- a/buildroot/bin/opt_set +++ b/buildroot/bin/opt_set @@ -1,5 +1,3 @@ #!/usr/bin/env bash -SED=$(which gsed || which sed) - -eval "${SED} -i 's/\(#define \b${1}\b\).*$/\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 4c72c4a..54076a0 100644 --- a/buildroot/bin/opt_set_adv +++ b/buildroot/bin/opt_set_adv @@ -1,5 +1,3 @@ #!/usr/bin/env bash -SED=$(which gsed || which sed) - -eval "${SED} -i 's/\(#define \b${1}\b\).*$/\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 639995e..ae6549f 100644 --- a/buildroot/bin/pins_set +++ b/buildroot/bin/pins_set @@ -1,5 +1,3 @@ #!/usr/bin/env bash -SED=$(which gsed || which sed) - -eval "${SED} -i 's/\(#define \b${2}\b\).*$/\1 ${3}/g' Marlin/src/pins/pins_${1}.h" +eval "sed -i 's/\(#define \b${2}\b\).*$/\1 ${3}/g' Marlin/pins_${1}.h" diff --git a/buildroot/share/git/README.md b/buildroot/share/git/README.md index de93e4c..8d98524 100644 --- a/buildroot/share/git/README.md +++ b/buildroot/share/git/README.md @@ -4,38 +4,39 @@ A Pull Request is often just the start of a longer process of patching and refining the code until it's ready to merge. In that process it's common to accumulate a lot of commits, some of which are non-functional. Before merging any PR, excess commits need to be "squashed" and sometimes rearranged or reworked to produce a well-packaged set of changes and keep the commit history relatively clean. -In addition, while a PR is being worked on other commits may be merged, leading to conflicts that need resolution. For this reason, it's a best practice to periodically refresh the PR so the working copy closely reflects the final merge into upstream `MarlinFirmware`. +In addition, while a PR is being worked on other commits may be merged, leading to conflicts that need resolution. For this reason, it's a best practice to periodically refresh the PR so the working copy closely reflects the final merge. #### Merge vs Rebase -If you plan to create PRs and work on them after submission I recommend not using Github Desktop to sync and merge. Use the command line instead. Github Desktop provides a "merge" option, but I've found that "`git rebase`" is much cleaner and easier to manage. Merge applies new work _after_ your commits, which buries them deeper in the commit history and makes it hard to bring them together as a final packaged unit. Rebase helpfully moves your commits to the tip of the branch, ensuring that your commits are adapted to the current code. This makes it easier to keep revising the commits in-place. +I recommend not using Github Desktop to sync and merge. Use the command line instead. Github Desktop provides a "merge" option, but for best results "`git rebase`" is recommended. Merge applies new work after your commits. This buries them and makes it hard to bring them together as a final packaged unit. Rebase moves your commits to the end of the branch, ensuring that your commits will be adapted to the current code. This makes it easier to keep revising the commits in-place. ### The Scripts -The following scripts can be used on any system with a GNU environment to speed up the process of working with Marlin branches and submitting changes to the project. +The following scripts can be used on macOS or Linux to speed up the process of working with Marlin and submitting changes to the project. #### Remotes File|Description ----|----------- -mfadd [user]|Add and Fetch Remote - Add another Github user's fork of Marlin as a remote, then fetch it. Optionally, check out one of their branches. -mfinit|Init Working Copy - Create a remote named '`upstream`' (for use by the other scripts) pointing to the '`MarlinFirmware`' fork. This only needs to be used once. Newer versions of Github Desktop may create `upstream` on your behalf. +mfadd [user]|Add Remote - Add another Github user's fork of Marlin as a remote, then fetch it. After this you can check out one of their branches and either make a PR targeted at their fork or targeted at `bugfix-1.1.x`. +mfinit|Init Working Copy - Creates a remote named '`upstream`' (for use by the other scripts) pointing to the '`MarlinFirmware`' fork. Use once after checking out your fork. + #### Branches File|Description ----|----------- -mfnew [branch]|New Branch - Creates a new branch based on `upstream/[PR-target]`. All new work should start with this command. -mffp|Fast Push - Push the HEAD or a commit ID to `upstream` immediately. Requires privileged access to the MarlinFirmware repo. +mfnew [branch]|New Branch - Creates a new branch based on `upstream/[PR-target]`. All new work should start here. firstpush|Push the current branch to 'origin' -your fork on Github- and set it to track '`origin`'. The branch needs to reside on Github before you can use it to make a PR. + #### Making / Amending PRs File|Description ----|----------- mfpr|Pull Request - Open the Compare / Pull Request page on Github for the current branch. mfrb|Do a `git rebase` then `git rebase -i` of the current branch onto `upstream/[PR-target]`. Use this to edit your commits anytime. -mfqp|Quick Patch - Commit all current changes as "patch", then do `mfrb`, followed by `git push -f` if no conflicts need resolution. +mfqp|Quick Patch - Commit all current changes as "patch", `mfrb`, and `git push -f`. #### Documentation diff --git a/buildroot/share/git/mfadd b/buildroot/share/git/mfadd index 48a810b..8b6ded3 100644 --- a/buildroot/share/git/mfadd +++ b/buildroot/share/git/mfadd @@ -2,22 +2,12 @@ # # mfadd # -# Add a remote and fetch it. Optionally copy a branch. -# -# Example: mfadd thinkyhead:patch-1 copy_of_patch-1 +# Add a remote and fetch it # -[[ $# > 0 && $# < 3 && $1 != "-h" && $1 != "--help" ]] || { echo "Usage: `basename $0` (user | ref copyname)" 1>&2 ; exit 1; } +[[ $# == 1 ]] || { echo "Usage: `basename $0` user" 1>&2 ; exit 1; } -# If a colon is included, split the parts -if [[ $1 =~ ":" ]]; then - IFS=':' read -a DATA <<< "$1" - USER=${DATA[0]} - BRANCH=${DATA[1]} - NAME=$2 -else - USER=$1 -fi +USER=$1 MFINFO=$(mfinfo) || exit 1 IFS=' ' read -a INFO <<< "$MFINFO" @@ -26,7 +16,5 @@ REPO=${INFO[2]} set -e echo "Adding and fetching $USER..." -git remote add "$USER" "git@github.com:$USER/$REPO.git" >/dev/null 2>&1 || echo "Remote exists." +git remote add "$USER" "git@github.com:$USER/$REPO.git" git fetch "$USER" - -[[ ! -z "$BRANCH" && ! -z "$NAME" ]] && git checkout $USER/$BRANCH -b $NAME diff --git a/buildroot/share/git/mfclean b/buildroot/share/git/mfclean index f389974..99fd227 100644 --- a/buildroot/share/git/mfclean +++ b/buildroot/share/git/mfclean @@ -6,7 +6,7 @@ # Great way to clean up your branches after messing around a lot # -KEEP="RC|RCBugFix|dev|master|bugfix-1|bugfix-2" +KEEP="RC|RCBugFix|dev|master|bugfix-1" echo "Fetching latest upstream and origin..." git fetch upstream diff --git a/buildroot/share/git/mfinfo b/buildroot/share/git/mfinfo index c7ae159..51b1e86 100644 --- a/buildroot/share/git/mfinfo +++ b/buildroot/share/git/mfinfo @@ -16,8 +16,6 @@ usage() { echo "Usage: `basename $0` [1|2] [branch]" 1>&2 } -[[ $# < 3 && $1 != "-h" && $1 != "--help" ]] || { usage; exit 1; } - CURR=$(git branch 2>/dev/null | grep ^* | sed 's/\* //g') [[ -z $CURR ]] && { echo "No git repository here!" 1>&2 ; exit 1; } [[ $CURR == "(no"* ]] && { echo "Git is busy with merge, rebase, etc." 1>&2 ; exit 1; } diff --git a/buildroot/share/git/mfnew b/buildroot/share/git/mfnew index a33c3f0..6226227 100644 --- a/buildroot/share/git/mfnew +++ b/buildroot/share/git/mfnew @@ -9,7 +9,7 @@ usage() { echo "Usage: `basename $0` [1|2] [name]" 1>&2 } -[[ $# < 3 && $1 != "-h" && $1 != "--help" ]] || { usage; exit 1; } +[[ $# < 3 ]] || { usage ; exit 1 ; } MFINFO=$(mfinfo "$@") || exit 1 IFS=' ' read -a INFO <<< "$MFINFO" @@ -31,4 +31,4 @@ case "$#" in esac git fetch upstream -git checkout --no-track upstream/$TARG -b $BRANCH +git checkout upstream/$TARG -b $BRANCH diff --git a/buildroot/share/git/mfpr b/buildroot/share/git/mfpr index 2750195..025b686 100644 --- a/buildroot/share/git/mfpr +++ b/buildroot/share/git/mfpr @@ -5,7 +5,7 @@ # Make a PR of the current branch against RCBugFix or dev # -[[ $# < 2 && $1 != "-h" && $1 != "--help" ]] || { echo "Usage: `basename $0` [branch]" 1>&2 ; exit 1; } +[[ $# < 2 ]] || { echo "Usage: `basename $0` [branch]" 1>&2 ; exit 1; } MFINFO=$(mfinfo "$@") || exit 1 IFS=' ' read -a INFO <<< "$MFINFO" diff --git a/buildroot/share/git/mfpub b/buildroot/share/git/mfpub index 85b8905..9a3e1ca 100644 --- a/buildroot/share/git/mfpub +++ b/buildroot/share/git/mfpub @@ -9,7 +9,7 @@ # any permanent changes to 'master'. # -[[ $# < 2 && $1 != "-h" && $1 != "--help" ]] || { echo "Usage: `basename $0` [branch]" 1>&2 ; exit 1; } +[[ $# < 2 ]] || { echo "Usage: `basename $0` [branch]" 1>&2 ; exit 1; } MFINFO=$(mfinfo "$@") || exit 1 IFS=' ' read -a INFO <<< "$MFINFO" diff --git a/buildroot/share/git/mfqp b/buildroot/share/git/mfqp index e00e7e5..5a91a8a 100644 --- a/buildroot/share/git/mfqp +++ b/buildroot/share/git/mfqp @@ -5,7 +5,7 @@ # Add all changed files, commit as "patch", do `mfrb` and `git push -f` # -[[ $# < 2 && $1 != "-h" && $1 != "--help" ]] || { echo "Usage: `basename $0` [1|2]" 1>&2 ; exit 1; } +[[ $# < 2 ]] || { echo "Usage: `basename $0` [1|2]" 1>&2 ; exit 1; } MFINFO=$(mfinfo "$@") || exit 1 IFS=' ' read -a INFO <<< "$MFINFO" diff --git a/buildroot/share/git/mfrb b/buildroot/share/git/mfrb index 32d5055..af4de26 100644 --- a/buildroot/share/git/mfrb +++ b/buildroot/share/git/mfrb @@ -5,7 +5,7 @@ # Do "git rebase -i" against the "target" branch (bugfix-1.1.x, bugfix-2.0.x, or master) # -[[ $# < 2 && $1 != "-h" && $1 != "--help" ]] || { echo "Usage: `basename $0` [1|2]" 1>&2 ; exit 1; } +[[ $# < 2 ]] || { echo "Usage: `basename $0` [1|2]" 1>&2 ; exit 1; } MFINFO=$(mfinfo "$@") || exit 1 IFS=' ' read -a INFO <<< "$MFINFO" diff --git a/buildroot/share/git/mfup b/buildroot/share/git/mfup index f28d76a..132c36b 100644 --- a/buildroot/share/git/mfup +++ b/buildroot/share/git/mfup @@ -7,7 +7,7 @@ # - Force-push the branch to 'origin' # -[[ $# < 3 && $1 != "-h" && $1 != "--help" ]] || { echo "Usage: `basename $0` [1|2] [branch]" 1>&2 ; exit 1; } +[[ $# < 3 ]] || { echo "Usage: `basename $0` [1|2] [branch]" 1>&2 ; exit 1; } MFINFO=$(mfinfo "$@") || exit 1 IFS=' ' read -a INFO <<< "$MFINFO" diff --git a/buildroot/share/scripts/findMissingTranslations.sh b/buildroot/share/scripts/findMissingTranslations.sh index 2dc924f..2ef9c14 100644 --- a/buildroot/share/scripts/findMissingTranslations.sh +++ b/buildroot/share/scripts/findMissingTranslations.sh @@ -28,7 +28,7 @@ fi echo -n "Building list of missing strings..." for i in $(awk '/#ifndef/{print $2}' language_en.h); do - [[ $i == "LANGUAGE_EN_H" || $i == "CHARSIZE" ]] && continue + [[ $i == "LANGUAGE_EN_H" ]] && continue LANG_LIST="" for j in $TEST_LANGS; do [[ $(grep -c " ${i} " language_${j}.h) -eq 0 ]] && LANG_LIST="$LANG_LIST $j" @@ -40,8 +40,5 @@ done echo for K in $( printf "%s\n" "${!STRING_MAP[@]}" | sort ); do - case "$#" in - 1 ) echo $K ;; - * ) printf "%-35s :%s\n" "$K" "${STRING_MAP[$K]}" ;; - esac + printf "%-35s :%s\n" "$K" "${STRING_MAP[$K]}" done diff --git a/platformio.ini b/platformio.ini index 9c2c71a..dbd90e5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1,173 +1,92 @@ # -# Marlin Firmware -# PlatformIO Configuration File -# -# For detailed documentation with EXAMPLES: +# Project Configuration File # +# A detailed documentation with the EXAMPLES is located here: # http://docs.platformio.org/en/latest/projectconf.html # -# Automatic targets - enable auto-uploading -# targets = upload - # # By default platformio build will abort after 5 errors. # Remove '-fmax-errors=5' from build_flags below to see all. # +# Automatic targets - enable auto-uploading +# targets = upload + [platformio] -src_dir = Marlin -build_dir = .pioenvs -lib_dir = .piolib +src_dir = Marlin +envs_dir = .pioenvs +lib_dir = .piolib libdeps_dir = .piolibdeps env_default = megaatmega2560 [common] -build_flags = -fmax-errors=5 - -g - -ggdb lib_deps = - https://github.com/MarlinFirmware/U8glib-HAL/archive/dev.zip - LiquidCrystal_I2C@1.1.2 + U8glib@1.19.1 TMC2130Stepper - https://github.com/teemuatlut/TMC2208Stepper/archive/v0.1.1.zip - Adafruit NeoPixel@1.1.3 - https://github.com/lincomatic/LiquidTWI2/archive/30aa480.zip - https://github.com/ameyer/Arduino-L6470/archive/master.zip - https://github.com/trinamic/TMC26XStepper/archive/c1921b4.zip + Adafruit NeoPixel + https://github.com/lincomatic/LiquidTWI2.git + https://github.com/trinamic/TMC26XStepper.git +build_flags = -I $BUILDSRC_DIR -fmax-errors=5 -################################# -# # -# Unique Core Architectures # -# # -# Add a new "env" below if no # -# entry has values suitable to # -# build for a given board. # -# # -################################# - -# -# ATmega2560 -# [env:megaatmega2560] -platform = atmelavr -framework = arduino -board = megaatmega2560 -build_flags = ${common.build_flags} -board_build.f_cpu = 16000000L -lib_deps = ${common.lib_deps} -monitor_speed = 250000 +platform = atmelavr +framework = arduino +board = megaatmega2560 +build_flags = ${common.build_flags} +board_f_cpu = 16000000L +lib_deps = ${common.lib_deps} -# -# ATmega1280 -# [env:megaatmega1280] -platform = atmelavr -framework = arduino -board = megaatmega1280 -build_flags = ${common.build_flags} -board_build.f_cpu = 16000000L -lib_deps = ${common.lib_deps} -monitor_speed = 250000 +platform = atmelavr +framework = arduino +board = megaatmega1280 +build_flags = ${common.build_flags} +board_f_cpu = 16000000L +lib_deps = ${common.lib_deps} -# -# AT90USB1286 boards using CDC bootloader -# - BRAINWAVE -# - BRAINWAVE_PRO -# - SAV_MKI -# - TEENSYLU -# -[env:at90USB1286_CDC] -platform = teensy -framework = arduino -board = at90USB1286 -build_flags = ${common.build_flags} -lib_deps = ${common.lib_deps} -lib_ldf_mode = deep+ -extra_scripts = pre:buildroot/share/atom/create_custom_upload_command_CDC.py +[env:printrboard] +platform = teensy +framework = arduino +board = teensy20pp +build_flags = ${common.build_flags} -D MOTHERBOARD=BOARD_PRINTRBOARD +# Bug in arduino framework does not allow boards running at 20Mhz +#board_f_cpu = 20000000L +lib_deps = ${common.lib_deps} -# -# AT90USB1286 boards using DFU bootloader -# - PrintrBoard -# - PrintrBoard Rev.F -# - ? 5DPRINT ? -# -[env:at90USB1286_DFU] -platform = teensy -framework = arduino -board = at90USB1286 -build_flags = ${common.build_flags} -lib_deps = ${common.lib_deps} -lib_ldf_mode = deep+ -extra_scripts = pre:buildroot/share/atom/create_custom_upload_command_DFU.py +[env:printrboard_revf] +platform = teensy +framework = arduino +board = teensy20pp +build_flags = ${common.build_flags} -D MOTHERBOARD=BOARD_PRINTRBOARD_REVF +lib_deps = ${common.lib_deps} -# -# Melzi and clones (ATmega1284p) -# -[env:melzi] -platform = atmelavr -framework = arduino -board = sanguino_atmega1284p -build_flags = ${common.build_flags} -upload_speed = 57600 -lib_deps = ${common.lib_deps} -monitor_speed = 250000 +[env:brainwavepro] +platform = teensy +framework = arduino +board = teensy20pp +build_flags = ${common.build_flags} -D MOTHERBOARD=BOARD_BRAINWAVE_PRO +lib_deps = ${common.lib_deps} -# -# Melzi and clones (Optiboot bootloader) -# -[env:melzi_optiboot] -platform = atmelavr -framework = arduino -board = sanguino_atmega1284p -build_flags = ${common.build_flags} -upload_speed = 115200 -lib_deps = ${common.lib_deps} -monitor_speed = 250000 - -# -# RAMBo -# [env:rambo] -platform = atmelavr -framework = arduino -board = reprap_rambo -build_flags = ${common.build_flags} -board_build.f_cpu = 16000000L -lib_deps = ${common.lib_deps} -monitor_speed = 250000 +platform = atmelavr +framework = arduino +board = reprap_rambo +build_flags = ${common.build_flags} +board_f_cpu = 16000000L +lib_deps = ${common.lib_deps} + +[env:anet10] +platform = atmelavr +framework = arduino +board = sanguino_atmega1284p +build_flags = ${common.build_flags} +upload_speed = 57600 +lib_deps = ${common.lib_deps} -# -# Sanguinololu (ATmega644p) -# [env:sanguino_atmega644p] -platform = atmelavr -framework = arduino -board = sanguino_atmega644p -build_flags = ${common.build_flags} -lib_deps = ${common.lib_deps} -monitor_speed = 250000 - -# -# Sanguinololu (ATmega1284p) -# -[env:sanguino_atmega1284p] -platform = atmelavr -framework = arduino -board = sanguino_atmega1284p -build_flags = ${common.build_flags} -lib_deps = ${common.lib_deps} -monitor_speed = 250000 - -# -# Teensy++ 2.0 -# -[env:teensy20] -platform = teensy -framework = arduino -board = teensy20pp -build_flags = ${common.build_flags} -#board_build.f_cpu = 20000000L ; Bug in Arduino framework disallows boards running at 20Mhz -lib_deps = ${common.lib_deps} -lib_ldf_mode = deep+ -monitor_speed = 250000 +platform = atmelavr +framework = arduino +board = sanguino_atmega644p +build_flags = ${common.build_flags} +lib_deps = ${common.lib_deps}